Updated API (markdown)
This commit is contained in:
parent
dc85721f49
commit
439f02c4b8
382
API.md
382
API.md
|
@ -1,6 +1,8 @@
|
|||
##### GET `/api/v1/videos/:id`
|
||||
|
||||
> Schema:
|
||||
```
|
||||
|
||||
```javascript
|
||||
{
|
||||
"title": String,
|
||||
"videoId": String,
|
||||
|
@ -95,8 +97,75 @@
|
|||
}
|
||||
```
|
||||
|
||||
##### GET `/api/v1/trending`
|
||||
##### GET `/api/v1/comments/:id`
|
||||
|
||||
> Schema:
|
||||
|
||||
```javascript
|
||||
{
|
||||
"commentCount": Int32?,
|
||||
"comments": [
|
||||
{
|
||||
"author": String,
|
||||
"authorThumbnails": [
|
||||
"url": String,
|
||||
"width": Int32,
|
||||
"height": Int32
|
||||
],
|
||||
"authorId": String,
|
||||
"authorUrl": String,
|
||||
|
||||
"content": String,
|
||||
"contentHtml": String,
|
||||
"published": Int64,
|
||||
"publishedText": String,
|
||||
"likeCount": Int32,
|
||||
"commentId": String,
|
||||
|
||||
"replies": {
|
||||
"replyCount": Int32,
|
||||
"continuation": String
|
||||
}?
|
||||
}
|
||||
],
|
||||
"continuation": String?
|
||||
}
|
||||
```
|
||||
|
||||
Parameters:
|
||||
|
||||
```
|
||||
continuation: String
|
||||
```
|
||||
|
||||
##### GET `/api/v1/captions/:id`
|
||||
|
||||
> Schema:
|
||||
|
||||
```javascript
|
||||
{
|
||||
"captions": [
|
||||
{
|
||||
"label": String,
|
||||
"languageCode": String,
|
||||
"url": String
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Parameters:
|
||||
|
||||
```
|
||||
label: String
|
||||
```
|
||||
|
||||
A request with `label` will return the selected captions in WebVTT format.
|
||||
|
||||
##### GET `/api/v1/trending`
|
||||
|
||||
> Schema:
|
||||
|
||||
```
|
||||
[
|
||||
{
|
||||
|
@ -126,7 +195,9 @@
|
|||
```
|
||||
|
||||
##### GET `/api/v1/top`
|
||||
|
||||
> Schema:
|
||||
|
||||
```
|
||||
[
|
||||
{
|
||||
|
@ -156,7 +227,9 @@
|
|||
```
|
||||
|
||||
##### GET `/api/v1/channels/:ucid`
|
||||
|
||||
> Schema:
|
||||
|
||||
```
|
||||
{
|
||||
"author": String,
|
||||
|
@ -213,176 +286,255 @@
|
|||
```
|
||||
|
||||
##### GET `/api/v1/channels/:ucid/videos`, `/api/v1/channels/videos/:ucid`
|
||||
|
||||
> Schema:
|
||||
```
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
"title": String,
|
||||
"videoId": String,
|
||||
"author": String,
|
||||
"authorId": String,
|
||||
"authorUrl": String,
|
||||
title: String,
|
||||
videoId: String,
|
||||
author: String,
|
||||
authorId: String,
|
||||
authorUrl: String,
|
||||
|
||||
"videoThumbnails": [
|
||||
videoThumbnails: [
|
||||
{
|
||||
"quality": String,
|
||||
"url": String,
|
||||
"width": Int32,
|
||||
"height": Int32
|
||||
quality: String,
|
||||
url: String,
|
||||
width: Int32,
|
||||
height: Int32
|
||||
}
|
||||
],
|
||||
"description": String,
|
||||
"descriptionHtml": String,
|
||||
description: String,
|
||||
descriptionHtml: String,
|
||||
|
||||
"viewCount": Int64,
|
||||
"published": Int64,
|
||||
"publishedText": String,
|
||||
"lengthSeconds": Int32
|
||||
viewCount: Int64,
|
||||
published: Int64,
|
||||
publishedText: String,
|
||||
lengthSeconds: Int32
|
||||
}
|
||||
]
|
||||
];
|
||||
```
|
||||
|
||||
Parameters:
|
||||
|
||||
```
|
||||
page: Int32
|
||||
```
|
||||
|
||||
##### GET `/api/v1/search`
|
||||
##### GET `/api/v1/channels/search/:ucid`
|
||||
|
||||
> Schema:
|
||||
```
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
"type": "video",
|
||||
"title": String,
|
||||
"videoId": String,
|
||||
"author": String,
|
||||
"authorId": String,
|
||||
"authorUrl": String,
|
||||
"videoThumbnails": [
|
||||
type: "video",
|
||||
title: String,
|
||||
videoId: String,
|
||||
author: String,
|
||||
authorId: String,
|
||||
authorUrl: String,
|
||||
videoThumbnails: [
|
||||
{
|
||||
"quality": String,
|
||||
"url": String,
|
||||
"width": Int32,
|
||||
"height": Int32
|
||||
quality: String,
|
||||
url: String,
|
||||
width: Int32,
|
||||
height: Int32
|
||||
}
|
||||
],
|
||||
"description": String,
|
||||
"descriptionHtml": String,
|
||||
"viewCount": Int64,
|
||||
"published": Int64,
|
||||
"publishedText": String,
|
||||
"lengthSeconds": Int32,
|
||||
"liveNow": Bool
|
||||
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,
|
||||
type: "playlist",
|
||||
title: String,
|
||||
playlistId: String,
|
||||
author: String,
|
||||
authorId: String,
|
||||
authorUrl: String,
|
||||
|
||||
"videoCount": Int32,
|
||||
"videos": [
|
||||
videoCount: Int32,
|
||||
videos: [
|
||||
"title": String,
|
||||
"videoId": String,
|
||||
"lengthSeconds": Int32,
|
||||
"videoThumbnails": [
|
||||
{
|
||||
"quality": String,
|
||||
"url": String,
|
||||
"width": Int32,
|
||||
"height": Int32
|
||||
quality: String,
|
||||
url: String,
|
||||
width: Int32,
|
||||
height: Int32
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "channel",
|
||||
"author": String,
|
||||
"authorId": String,
|
||||
"authorUrl": String,
|
||||
type: "channel",
|
||||
author: String,
|
||||
authorId: String,
|
||||
authorUrl: String,
|
||||
|
||||
"authorThumbnails": [
|
||||
authorThumbnails: [
|
||||
{
|
||||
"url": String,
|
||||
"width": Int32,
|
||||
"height": Int32
|
||||
url: String,
|
||||
width: Int32,
|
||||
height: Int32
|
||||
}
|
||||
],
|
||||
"subCount": Int32,
|
||||
"videoCount": Int32,
|
||||
"description": String,
|
||||
"descriptionHtml": String,
|
||||
subCount: Int32,
|
||||
videoCount: Int32,
|
||||
description: String,
|
||||
descriptionHtml: String
|
||||
}
|
||||
]
|
||||
];
|
||||
```
|
||||
|
||||
Parameters
|
||||
Parameters:
|
||||
|
||||
```
|
||||
q: String,
|
||||
page: Int32,
|
||||
q: String
|
||||
page: Int32
|
||||
```
|
||||
|
||||
##### GET `/api/v1/search`
|
||||
|
||||
> Schema:
|
||||
|
||||
```javascript
|
||||
[
|
||||
{
|
||||
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
|
||||
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`
|
||||
##### GET `/api/v1/playlists/:plid`
|
||||
|
||||
> Schema:
|
||||
```
|
||||
|
||||
```javascript
|
||||
{
|
||||
"captions": [
|
||||
"title": String,
|
||||
"playlistId": String,
|
||||
|
||||
"author": String,
|
||||
"authorId": String,
|
||||
"authorThumbnails": [
|
||||
{
|
||||
"label": String,
|
||||
"languageCode": String
|
||||
"url": String,
|
||||
"width": String,
|
||||
"height": String
|
||||
}
|
||||
],
|
||||
"description": String,
|
||||
"descriptionHtml": String,
|
||||
|
||||
"videoCount": Int32,
|
||||
"viewCount": Int64,
|
||||
"updated": Int64,
|
||||
|
||||
"videos": [
|
||||
"title": String,
|
||||
"videoId": String,
|
||||
"author": String,
|
||||
"authorId": String,
|
||||
"authorUrl": String,
|
||||
|
||||
"videoThumbnails": [
|
||||
{
|
||||
"quality": String,
|
||||
"url": String,
|
||||
"width": Int32,
|
||||
"height": Int32
|
||||
}
|
||||
],
|
||||
"index": Int32,
|
||||
"lengthSeconds": Int32
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Parameters
|
||||
```
|
||||
label: String
|
||||
```
|
||||
|
||||
A request with `label` will return the selected captions in WebVTT format.
|
||||
|
||||
|
||||
##### GET `/api/v1/comments/:id`
|
||||
> Schema:
|
||||
```
|
||||
{
|
||||
"commentCount": Int32?,
|
||||
"comments": [
|
||||
{
|
||||
"author": String,
|
||||
"authorThumbnails": [
|
||||
"url": String,
|
||||
"width": Int32,
|
||||
"height": Int32
|
||||
],
|
||||
"authorId": String,
|
||||
"authorUrl": String,
|
||||
|
||||
"content": String,
|
||||
"contentHtml": String,
|
||||
"published": Int64,
|
||||
"publishedText": String,
|
||||
"likeCount": Int32,
|
||||
"commentId": String,
|
||||
|
||||
"replies": {
|
||||
"replyCount": Int32,
|
||||
"continuation": String
|
||||
}?
|
||||
}
|
||||
],
|
||||
"continuation": String?
|
||||
}
|
||||
```
|
||||
|
||||
Parameters:
|
||||
|
||||
```
|
||||
continuation: String
|
||||
page: Int32
|
||||
```
|
Loading…
Reference in New Issue