Update api documentation with new endpoints and fixes (#501)
* Fix documentation on search's `sort` parameter * remove `news` from trending type * Remove channels/comments documentation * Remove channels search documentation from api.md page * add missing endpoints * fix `resolveurl` name * update param description for community post comments * update `search-filters.md` and `url-parameters.md` to include api changes
This commit is contained in:
parent
11d7a9a1e1
commit
bd5c262fb1
225
docs/api.md
225
docs/api.md
|
@ -301,7 +301,7 @@ Captions can also be selected with an ISO `lang`, e.g. &lang=en, `tlang` will au
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
```
|
```
|
||||||
type: "music", "gaming", "news", "movies"
|
type: "music", "gaming", "movies", "default"
|
||||||
region: ISO 3166 country code (default: "US")
|
region: ISO 3166 country code (default: "US")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -337,183 +337,6 @@ region: ISO 3166 country code (default: "US")
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
##### GET `/api/v1/channels/comments/:ucid`, `/api/v1/channels/:ucid/comments`
|
|
||||||
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
{
|
|
||||||
"authorId": String,
|
|
||||||
"comments": [
|
|
||||||
{
|
|
||||||
"author": String,
|
|
||||||
"authorThumbnails": [
|
|
||||||
"url": String,
|
|
||||||
"width": Int32,
|
|
||||||
"height": Int32
|
|
||||||
],
|
|
||||||
"authorId": String,
|
|
||||||
"authorUrl": String,
|
|
||||||
"isEdited": Bool,
|
|
||||||
"content": String,
|
|
||||||
"contentHtml": String,
|
|
||||||
"published": Int64,
|
|
||||||
"publishedText": String,
|
|
||||||
"likeCount": Int32,
|
|
||||||
"commentId": String,
|
|
||||||
"authorIsChannelOwner": Bool,
|
|
||||||
"creatorHeart": {
|
|
||||||
"creatorThumbnail": String,
|
|
||||||
"creatorName": String
|
|
||||||
}?,
|
|
||||||
"replies": {
|
|
||||||
"replyCount": Int32,
|
|
||||||
"continuation": String
|
|
||||||
}?,
|
|
||||||
"attachment": Attachment?
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"continuation": String?
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
The `authorId` for top-level comments will always(?) be the same as the requested channel. Top-level comments will also have an optional `attachment`, which can be one of:
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
{
|
|
||||||
"type": "image",
|
|
||||||
"imageThumbnails": [
|
|
||||||
{
|
|
||||||
"url": String,
|
|
||||||
"width": Int32,
|
|
||||||
"height": Int32
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
{
|
|
||||||
"type": "video",
|
|
||||||
"title": String,
|
|
||||||
"videoId": String,
|
|
||||||
"videoThumbnails": [
|
|
||||||
{
|
|
||||||
"quality": String,
|
|
||||||
"url": String,
|
|
||||||
"width": Int32,
|
|
||||||
"height": Int32
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"lengthSeconds": Int32,
|
|
||||||
"author": String,
|
|
||||||
"authorId": String,
|
|
||||||
"authorUrl": String,
|
|
||||||
"published": Int64,
|
|
||||||
"publishedText": String,
|
|
||||||
"viewCount": Int64,
|
|
||||||
"viewCountText": String
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
{
|
|
||||||
"type": "unknown",
|
|
||||||
"error": "Unrecognized attachment type."
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Some attachments may only have a `type` and `error`, similar to the above. Attachments will *only* be present on top-level comments.
|
|
||||||
|
|
||||||
Parameters:
|
|
||||||
|
|
||||||
```
|
|
||||||
continuation: String
|
|
||||||
```
|
|
||||||
|
|
||||||
##### GET `/api/v1/channels/search/:ucid`
|
|
||||||
|
|
||||||
> 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,
|
|
||||||
paid: Bool,
|
|
||||||
premium: 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
|
|
||||||
```
|
|
||||||
|
|
||||||
##### GET `/api/v1/search/suggestions`
|
##### GET `/api/v1/search/suggestions`
|
||||||
|
|
||||||
> Schema:
|
> Schema:
|
||||||
|
@ -616,7 +439,7 @@ Parameters:
|
||||||
```
|
```
|
||||||
q: String
|
q: String
|
||||||
page: Int32
|
page: Int32
|
||||||
sort_by: "relevance", "rating", "upload_date", "view_count"
|
sort: "relevance", "rating", "date", "views"
|
||||||
date: "hour", "today", "week", "month", "year"
|
date: "hour", "today", "week", "month", "year"
|
||||||
duration: "short", "long", "medium"
|
duration: "short", "long", "medium"
|
||||||
type: "video", "playlist", "channel", "movie", "show", "all", (default: all)
|
type: "video", "playlist", "channel", "movie", "show", "all", (default: all)
|
||||||
|
@ -707,3 +530,47 @@ page: Int32
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### GET `/api/v1/hashtag/:tag`
|
||||||
|
> Schema:
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
results: VideoObject[],
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Parameters:
|
||||||
|
```
|
||||||
|
page: Int32
|
||||||
|
```
|
||||||
|
|
||||||
|
##### GET `/api/v1/resolveurl`
|
||||||
|
> Schema:
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
ucid?: String,
|
||||||
|
videoId?: String,
|
||||||
|
playlistId?: String,
|
||||||
|
startTimeSeconds?: String,
|
||||||
|
params?: String,
|
||||||
|
pageType: string
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Parameters:
|
||||||
|
```
|
||||||
|
url: URL
|
||||||
|
```
|
||||||
|
|
||||||
|
##### GET `/api/v1/clips`
|
||||||
|
> Schema:
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
startTime: Float64, // in seconds
|
||||||
|
endTime: Float64, // in seconds
|
||||||
|
clipTitle: String,
|
||||||
|
video: VideoObject
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Parameters:
|
||||||
|
```
|
||||||
|
id: string
|
||||||
|
```
|
|
@ -85,6 +85,39 @@ This is the same as requesting `/api/v1/channels/:id/videos` without URL paramet
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### GET `/api/v1/channels/:id/podcasts`
|
||||||
|
|
||||||
|
> URL parameters:
|
||||||
|
|
||||||
|
* `continuation`: A continuation token to get the next chunk of items. The token is provided each time this API is requested.
|
||||||
|
|
||||||
|
> Response:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
"playlists": [
|
||||||
|
// One or more PlaylistOject
|
||||||
|
],
|
||||||
|
"continuation": continuation
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### GET `/api/v1/channels/:id/releases`
|
||||||
|
|
||||||
|
> URL parameters:
|
||||||
|
|
||||||
|
* `continuation`: A continuation token to get the next chunk of items. The token is provided each time this API is requested.
|
||||||
|
|
||||||
|
> Response:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
{
|
||||||
|
"playlists": [
|
||||||
|
// One or more PlaylistOject
|
||||||
|
],
|
||||||
|
"continuation": continuation
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
##### GET `/api/v1/channels/:id/shorts`
|
##### GET `/api/v1/channels/:id/shorts`
|
||||||
|
|
||||||
|
@ -206,3 +239,34 @@ This usually means that parsing support for the attachment type has not yet been
|
||||||
"error": String
|
"error": String
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
##### GET `/api/v1/channels/:ucid/search`
|
||||||
|
|
||||||
|
> Url parameters
|
||||||
|
* `q`: The query to search
|
||||||
|
* `page`: The page number of the search (Int32)
|
||||||
|
|
||||||
|
> Response:
|
||||||
|
```javascript
|
||||||
|
[
|
||||||
|
VideoObject,
|
||||||
|
PlaylistObject
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
##### GET `/api/v1/post/:id`
|
||||||
|
> Url parameters
|
||||||
|
|
||||||
|
* `ucid`: You can optionally provide the channel's id for fetching the post.
|
||||||
|
|
||||||
|
> Response:
|
||||||
|
Same as [`/api/v1/channels/:id/community`](#get-apiv1channelsidcommunity) but only returns one post in the comments array
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##### GET `/api/v1/post/:id/comments`
|
||||||
|
|
||||||
|
* `ucid`: You can optionally provide the channel's id for fetching the post's comments.
|
||||||
|
|
||||||
|
> Response:
|
||||||
|
Same as [`/api/v1/channels/:id/comments`](../api.md#get-apiv1commentsid) but has a postId instead of a videoId
|
|
@ -13,8 +13,8 @@ Supported operators:
|
||||||
- `sort:`
|
- `sort:`
|
||||||
- `relevance` (default)
|
- `relevance` (default)
|
||||||
- `rating`
|
- `rating`
|
||||||
- `upload_date`, `date`
|
- `date`
|
||||||
- `view_count`, `views`
|
- `views`
|
||||||
- `date:`
|
- `date:`
|
||||||
- `hour`
|
- `hour`
|
||||||
- `today`
|
- `today`
|
||||||
|
@ -30,11 +30,13 @@ Supported operators:
|
||||||
- `show`
|
- `show`
|
||||||
- `duration:`
|
- `duration:`
|
||||||
- `short`
|
- `short`
|
||||||
|
- `medium`
|
||||||
- `long`
|
- `long`
|
||||||
- `features:` Multiple can be specified, for example `features:live,4k,subtitles`
|
- `features:` Multiple can be specified, for example `features:live,4k,subtitles`
|
||||||
- `hd`
|
- `hd`
|
||||||
- `subtitles`
|
- `subtitles`
|
||||||
- `creative_commons`,`cc`
|
- `creative_commons`,`cc`
|
||||||
|
- `3d`
|
||||||
- `live`, `livestream`
|
- `live`, `livestream`
|
||||||
- `purchased`
|
- `purchased`
|
||||||
- `4k`
|
- `4k`
|
||||||
|
|
|
@ -86,7 +86,6 @@ _This list is incomplete. You can help by expanding it._
|
||||||
| `type=Default` | Default |
|
| `type=Default` | Default |
|
||||||
| `type=Music` | Music |
|
| `type=Music` | Music |
|
||||||
| `type=Gaming` | Gaming |
|
| `type=Gaming` | Gaming |
|
||||||
| `type=News` | News |
|
|
||||||
| `type=Movies` | Movies |
|
| `type=Movies` | Movies |
|
||||||
| _Region_ | Provide "hint" (as ISO 3166 country code) for Invidious to load trending videos from the specified region | |
|
| _Region_ | Provide "hint" (as ISO 3166 country code) for Invidious to load trending videos from the specified region | |
|
||||||
| `region=JP` | Load videos that are trending in Japan |
|
| `region=JP` | Load videos that are trending in Japan |
|
||||||
|
|
Loading…
Reference in New Issue