2022-11-12 16:40:11 +00:00
|
|
|
# cobalt API Documentation
|
|
|
|
This document provides info about methods and acceptable variables for all cobalt API requests.<br>
|
2023-06-05 06:43:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
⚠️ Main API instance has moved to https://co.wuk.sh/
|
|
|
|
|
|
|
|
Previous API domain will stop redirecting users to correct API instance after July 25th.
|
|
|
|
Make sure to update your projects in time.
|
|
|
|
```
|
|
|
|
|
2022-11-12 16:40:11 +00:00
|
|
|
## POST: ``/api/json``
|
|
|
|
Main processing endpoint.<br>
|
|
|
|
|
|
|
|
Request Body Type: ``application/json``<br>
|
|
|
|
Response Body Type: ``application/json``
|
|
|
|
|
|
|
|
### Request Body Variables
|
2023-02-26 16:49:25 +00:00
|
|
|
| key | type | variables | default | description |
|
|
|
|
|:----------------|:--------|:----------------------------------|:----------|:-------------------------------------------------------------------------------|
|
|
|
|
| url | string | Sharable URL encoded as URI | ``null`` | **Must** be included in every request. |
|
|
|
|
| vCodec | string | ``h264 / av1 / vp9`` | ``h264`` | Applies only to YouTube downloads. ``h264`` is recommended for phones. |
|
2023-02-26 17:50:57 +00:00
|
|
|
| vQuality | string | ``144 / ... / 2160 / max`` | ``720`` | ``720`` quality is recommended for phones. |
|
2023-02-26 16:49:25 +00:00
|
|
|
| aFormat | string | ``best / mp3 / ogg / wav / opus`` | ``mp3`` | |
|
|
|
|
| isAudioOnly | boolean | ``true / false`` | ``false`` | |
|
|
|
|
| isNoTTWatermark | boolean | ``true / false`` | ``false`` | Changes whether downloaded TikTok & Douyin videos have watermarks. |
|
|
|
|
| isTTFullAudio | boolean | ``true / false`` | ``false`` | Enables download of original sound used in a TikTok video. |
|
|
|
|
| isAudioMuted | boolean | ``true / false`` | ``false`` | Disables audio track in video downloads. |
|
|
|
|
| dubLang | boolean | ``true / false`` | ``false`` | Backend uses Accept-Language for YouTube video audio tracks when ``true``. |
|
2022-11-12 16:40:11 +00:00
|
|
|
|
|
|
|
### Response Body Variables
|
|
|
|
| key | type | variables |
|
|
|
|
|:-----------|:-------|:--------------------------------------------------------------|
|
|
|
|
| status | string | ``error / redirect / stream / success / rate-limit / picker`` |
|
|
|
|
| text | string | Text |
|
|
|
|
| url | string | Direct link to a file / link to cobalt's stream |
|
|
|
|
| pickerType | string | ``various / images`` |
|
|
|
|
| picker | array | Array of picker items |
|
|
|
|
| audio | string | Direct link to a file / link to cobalt's stream |
|
|
|
|
|
|
|
|
### Picker Item Variables
|
|
|
|
Item type: ``object``
|
|
|
|
| key | type | variables | description |
|
|
|
|
|:-----------|:-------|:------------------------------------------------|:--------------------------------------------|
|
|
|
|
| type | string | ``video`` | Used only if ``pickerType`` is ``various``. |
|
|
|
|
| url | string | Direct link to a file / link to cobalt's stream | |
|
|
|
|
| thumb | string | Item thumbnail that's displayed in the picker | Used only for ``video`` type. |
|
|
|
|
|
|
|
|
## GET: ``/api/stream``
|
|
|
|
Content live render streaming endpoint.<br>
|
|
|
|
|
|
|
|
### Request Query Variables
|
2023-01-13 18:34:48 +00:00
|
|
|
| key | variables | description |
|
|
|
|
|:----|:-----------------|:-------------------------------------------------------------------------------------------------------------------------------|
|
2023-04-08 16:55:44 +00:00
|
|
|
| p | ``1`` | Used for probing the rate limit. |
|
|
|
|
| t | Stream token | Unique stream ID. Used for retrieving cached stream info data. |
|
2023-01-13 18:34:48 +00:00
|
|
|
| h | HMAC | Hashed combination of: (hashed) ip address, stream token, expiry timestamp, and service name. Used for verification of stream. |
|
|
|
|
| e | Expiry timestamp | |
|
2022-11-12 16:40:11 +00:00
|
|
|
|
|
|
|
## GET: ``/api/onDemand``
|
|
|
|
On-demand website element loading. Currently used only for older changelogs.<br>
|
|
|
|
|
|
|
|
### Request Query Variables
|
|
|
|
| key | variables | description |
|
|
|
|
|:--------|:----------|:---------------------------------------|
|
|
|
|
| blockId | ``0`` | Block ID to be rendered on the server. |
|
|
|
|
|
|
|
|
### Response Body Variables
|
2023-06-07 15:41:06 +00:00
|
|
|
| key | type | variables |
|
|
|
|
|:-------|:-------|:-----------------------------|
|
|
|
|
| status | string | ``error / success`` |
|
|
|
|
| text | string | Error text or rendered block |
|
|
|
|
|
|
|
|
## GET: ``/api/serverInfo``
|
|
|
|
Returns current basic server info.<br>
|
|
|
|
Response Body Type: ``application/json``
|
|
|
|
|
|
|
|
### Response Body Variables
|
|
|
|
| key | type | variables |
|
|
|
|
|:----------|:-------|:------------------|
|
|
|
|
| version | string | cobalt version |
|
|
|
|
| commit | string | Git commit |
|
|
|
|
| branch | string | Git branch |
|
|
|
|
| name | string | Server name |
|
|
|
|
| url | string | Server url |
|
|
|
|
| cors | string | CORS status |
|
|
|
|
| startTime | string | Server start time |
|