From fb4d17bbdabd1e97decb017d11fdadad56731ed7 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sun, 5 Aug 2018 12:07:48 -0500 Subject: [PATCH] Updated API (markdown) --- API.md | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 103 insertions(+), 7 deletions(-) diff --git a/API.md b/API.md index 0b0d9d4..596712c 100644 --- a/API.md +++ b/API.md @@ -1,7 +1,103 @@ -List of endpoints: -- `/api/v1/videos` -- `/api/v1/trending` -- `/api/v1/top` -- `/api/v1/channels/:ucid` -- `/api/v1/channels/:ucid/videos` -- `/api/v1/search` +GET `/api/v1/videos/:id` +> Given :id, return `video` +> Schema: +``` +{ + "title": String, + "videoId": String, + "videoThumbnails": [ + { + "quality": String, + "url": String, + "width": Int32, + "height": Int32 + }, + ], + + "description": String, + "descriptionHtml": String, + "published": Int64 + + "keywords": Array(String), + "viewCount": Int64, + "likeCount": Int32, + "dislikeCount": Int32, + + "isFamilyFriendly": Bool, + "allowedRegions": Array(String), + "genre": String, + + "author": String, + "authorId": String, + "authorUrl": String, + + "lengthSeconds": Int32, + "allowRatings": Bool, + "rating": Float32, + "isListed": Bool, + + "adaptiveFormats": [ + { + "index": String, + "bitrate": String, + "init": String, + "url": String, + "itag": String, + "type": String, + "clen": String, + "lmt": String, + "projectionType": Int32, + "container": String, + "encoding": String, + "qualityLabel": String?, + "resolution": String? + }, + ], + "formatStreams": [ + { + "url": String, + "itag": String, + "type": String, + "quality": String, + "container": String, + "encoding": String, + "qualityLabel": String, + "resolution": String, + "size": String + }, + ], + "captions": [ + { + "label": String, + "languageCode": String + }, + ], + "recommendedVideos": [ + { + "videoId": String, + "title": String, + "videoThumbnails": [ + { + "quality": String, + "url": String, + "width": Int32, + "height": Int32 + }, + ], + "author": String, + "lengthSeconds": Int32, + "viewCountText" String + } + ] +} +``` + +GET `/api/v1/trending` + +GET `/api/v1/top` + +GET `/api/v1/channels/:ucid` + +GET `/api/v1/channels/:ucid/videos` + +GET `/api/v1/search`