-
Notifications
You must be signed in to change notification settings - Fork 6
How to communicate with Invidious companion with any client (HTTP API)
-
127.0.0.1:8282
is the default couple IP address and port. If you have changed the port, then change 8282 accordingly. - some public Invidious instances may restrict you from using the endpoints
/api/manifest/dash/id/
and/latest_version
. If that's the case, then please respect this decision and do not try to circumvent the protections.
Invidious companion is not locked to Invidious, you can use it with other clients through HTTP requests.
Invidious companion expose multiple APIs:
-
/youtubei/v1/player
: Give back the same results from YouTube servers but the videoplayback URLs are decrypted and ready to be used. -
/api/manifest/dash/id/
: Same DASH manifest API as Invidious. Get a DASH manifest with videoplayback URLs fully decrypted and ready to be used. -
/latest_version
: Same endpoint as Invidious. Get the videoplayback URL fully decrypted and ready to be used.
HTTP method: POST
Send your data the same way that you would send to YouTube servers, but only the parameter "videoId" is parsed at the moment. You have no control through this API of what client type you want to use in order to requests video URLs from YouTube servers (WEB, ANDROID, TV, IOS and more).
Example body:
{ "videoId": "jNQXAC9IVRw" }
And you need to authenticate the request using the HTTP header like this: Authorization: Bearer YOURSECRETKEY
.
Example with curl:
curl --request POST \
--url 'http://127.0.0.1:8282/youtubei/v1/player' \
--header 'Authorization: Bearer YOURSECRETKEY' \
--header 'Content-Type: application/json' \
--data '{ "videoId": "jNQXAC9IVRw" }'
HTTP method: GET
Add the video ID after /api/manifest/dash/id/
. Example /api/manifest/dash/id/jNQXAC9IVRw
.
If you want to get videoplayback URLs already proxied for usage in invidious, then add the query string ?local=true
. Example /api/manifest/dash/id/jNQXAC9IVRw?local=true
HTTP method: GET
Query strings available:
-
id
: the video ID (required) -
itag
: the itag requested (required) -
local=true
: If you want to get videoplayback already proxied for usage in invidious (optional)
Example: /latest_version?id=jNQXAC9IVRw&itag=18