From f1d7e48f18b31c783b3c47a8e97aa5fee73e5102 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Fri, 28 Sep 2018 10:48:24 -0500 Subject: [PATCH] Updated API (markdown) --- API.md | 136 ++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 102 insertions(+), 34 deletions(-) diff --git a/API.md b/API.md index 515eb02..4bd0dfe 100644 --- a/API.md +++ b/API.md @@ -15,7 +15,8 @@ "description": String, "descriptionHtml": String, - "published": Int64 + "published": Int64, + "publishedText": String, "keywords": Array(String), "viewCount": Int64, @@ -25,6 +26,7 @@ "isFamilyFriendly": Bool, "allowedRegions": Array(String), "genre": String, + "genreUrl": String, "author": String, "authorId": String, @@ -69,7 +71,8 @@ "captions": [ { "label": String, - "languageCode": String + "languageCode": String, + "url": String, }, ], "recommendedVideos": [ @@ -111,9 +114,11 @@ "viewCount": Int64, "author": String, + "authorId": String, "authorUrl": String, "published": Int64, + "publishedText": String, "description": String, "descriptionHtml": String } @@ -139,9 +144,11 @@ "viewCount": Int64, "author": String, + "authorId": String, "authorUrl": String, "published": Int64, + "publishedText": String, "description": String, "descriptionHtml": String } @@ -176,12 +183,16 @@ "paid": Bool, "isFamilyFriendly": Bool, "description": String, + "descriptionHtml": String, "allowedRegions": Array(String), "latestVideos": [ { "title": String, "videoId": String, - "published": Int64, + "author": String, + "authorId": String, + "authorUrl": String, + "videoThumbnails": [ { "quality": String, @@ -189,7 +200,13 @@ "width": Int32, "height": Int32 } - ] + ], + "description": String, + "descriptionHtml": String, + "viewCount": Int64, + "published": Int64, + "publishedText": String, + "lengthSeconds": Int32 } ] } @@ -198,41 +215,12 @@ ##### GET `/api/v1/channels/:ucid/videos` > Schema: ``` -[ - { - "title": String, - "videoId": String, - "videoThumbnails": [ - { - "quality": String, - "url": String, - "width": Int32, - "height": Int32 - } - ], - "description": String, - "descriptionHtml": String, - - "viewCount": Int64, - "published": Int64, - "lengthSeconds": Int32 - } -] -``` - -Parameters: -``` -page: Int32 -``` - -##### GET `/api/v1/search` -> Schema: -``` [ { "title": String, "videoId": String, "author": String, + "authorId": String, "authorUrl": String, "videoThumbnails": [ @@ -248,11 +236,88 @@ page: Int32 "viewCount": Int64, "published": Int64, + "publishedText": String, "lengthSeconds": Int32 } ] ``` +Parameters: +``` +page: Int32 +``` + +##### GET `/api/v1/search` +> Schema: +``` +[ + { + "type": "video", + "title": String, + "videoId": String, + "author": String, + "authorId": String, + "authorUrl": String, + "videoThumbnails": [ + { + "quality": String, + "url": String, + "width": Int32, + "height": Int32 + } + ], + "description": String, + "descriptionHtml": String, + "viewCount": Int64, + "published": Int64, + "publishedText": String, + "lengthSeconds": Int32, + "liveNow": Bool + }, + { + "type": "playlist", + "title": String, + "playlistId": String, + "author": String, + "authorId": String, + "authorUrl": String, + + "videoCount": Int32, + "videos": [ + "title": String, + "videoId": String, + "lengthSeconds": Int32, + "videoThumbnails": [ + { + "quality": String, + "url": String, + "width": Int32, + "height": Int32 + } + ] + ] + }, + { + "type": "channel", + "author": String, + "authorId": String, + "authorUrl": String, + + "authorThumbnails": [ + { + "url": String, + "width": Int32, + "height": Int32 + } + ], + "subCount": Int32, + "videoCount": Int32, + "description": String, + "descriptionHtml": String, + } +] +``` + Parameters ``` q: String, @@ -260,6 +325,7 @@ page: Int32, sort_by: "relevance", "rating", "upload_date", "view_count" date: "hour", "today", "week", "month", "year" duration: "short", "long" +type: "video", "playlist", "channel", "all", (default: video) ``` ##### GET `/api/v1/captions/:id` @@ -300,7 +366,9 @@ A request with `label` will return the selected captions in WebVTT format. "authorUrl": String, "content": String, + "contentHtml": String, "published": Int64, + "publishedText": String, "likeCount": Int32, "commentId": String,