Updated API (markdown)

This commit is contained in:
Omar Roth 2018-09-28 10:48:24 -05:00
parent 959a9fbd02
commit f1d7e48f18

136
API.md
View File

@ -15,7 +15,8 @@
"description": String, "description": String,
"descriptionHtml": String, "descriptionHtml": String,
"published": Int64 "published": Int64,
"publishedText": String,
"keywords": Array(String), "keywords": Array(String),
"viewCount": Int64, "viewCount": Int64,
@ -25,6 +26,7 @@
"isFamilyFriendly": Bool, "isFamilyFriendly": Bool,
"allowedRegions": Array(String), "allowedRegions": Array(String),
"genre": String, "genre": String,
"genreUrl": String,
"author": String, "author": String,
"authorId": String, "authorId": String,
@ -69,7 +71,8 @@
"captions": [ "captions": [
{ {
"label": String, "label": String,
"languageCode": String "languageCode": String,
"url": String,
}, },
], ],
"recommendedVideos": [ "recommendedVideos": [
@ -111,9 +114,11 @@
"viewCount": Int64, "viewCount": Int64,
"author": String, "author": String,
"authorId": String,
"authorUrl": String, "authorUrl": String,
"published": Int64, "published": Int64,
"publishedText": String,
"description": String, "description": String,
"descriptionHtml": String "descriptionHtml": String
} }
@ -139,9 +144,11 @@
"viewCount": Int64, "viewCount": Int64,
"author": String, "author": String,
"authorId": String,
"authorUrl": String, "authorUrl": String,
"published": Int64, "published": Int64,
"publishedText": String,
"description": String, "description": String,
"descriptionHtml": String "descriptionHtml": String
} }
@ -176,12 +183,16 @@
"paid": Bool, "paid": Bool,
"isFamilyFriendly": Bool, "isFamilyFriendly": Bool,
"description": String, "description": String,
"descriptionHtml": String,
"allowedRegions": Array(String), "allowedRegions": Array(String),
"latestVideos": [ "latestVideos": [
{ {
"title": String, "title": String,
"videoId": String, "videoId": String,
"published": Int64, "author": String,
"authorId": String,
"authorUrl": String,
"videoThumbnails": [ "videoThumbnails": [
{ {
"quality": String, "quality": String,
@ -189,7 +200,13 @@
"width": Int32, "width": Int32,
"height": 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` ##### GET `/api/v1/channels/:ucid/videos`
> Schema: > 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, "title": String,
"videoId": String, "videoId": String,
"author": String, "author": String,
"authorId": String,
"authorUrl": String, "authorUrl": String,
"videoThumbnails": [ "videoThumbnails": [
@ -248,11 +236,88 @@ page: Int32
"viewCount": Int64, "viewCount": Int64,
"published": Int64, "published": Int64,
"publishedText": String,
"lengthSeconds": Int32 "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 Parameters
``` ```
q: String, q: String,
@ -260,6 +325,7 @@ page: Int32,
sort_by: "relevance", "rating", "upload_date", "view_count" sort_by: "relevance", "rating", "upload_date", "view_count"
date: "hour", "today", "week", "month", "year" date: "hour", "today", "week", "month", "year"
duration: "short", "long" duration: "short", "long"
type: "video", "playlist", "channel", "all", (default: video)
``` ```
##### GET `/api/v1/captions/:id` ##### GET `/api/v1/captions/:id`
@ -300,7 +366,9 @@ A request with `label` will return the selected captions in WebVTT format.
"authorUrl": String, "authorUrl": String,
"content": String, "content": String,
"contentHtml": String,
"published": Int64, "published": Int64,
"publishedText": String,
"likeCount": Int32, "likeCount": Int32,
"commentId": String, "commentId": String,