Ad

Build on RaozanTV

A REST API that answers JSON: show this site's videos in your own app or on your own website, sign members in, let them comment, like, subscribe and bring videos in.

1. A key

Sign in, open Settings → API keys, give the key a name and tick what it may do. The key starts with avk_; you can show and copy it there again at any time. Send it with every call as a header:

X-API-Key: avk_your_key_here

What a key may do:

readRead - Public videos, channels, categories, Shorts, playlists and comments.
accountAccount - Register and sign members in, read and change the signed-in member's own details and playlists.
writeWrite - Comment, like and subscribe as the signed-in member.
uploadUpload - Bring a video in by its link (an import) as the signed-in member.

Keep the key on your server when you can. A key used from a web page is seen by everybody who opens it: give such a key the Read scope only, and list your site under the key's "sites that may use it from a browser" so nobody else can borrow it.

2. The address

https://raozantv.com/developer-api/{route}

Every answer looks like {"ok": true, "data": ..., "meta": {...}}, or {"ok": false, "error": {"code": "...", "message": "..."}} with the HTTP status that fits (401 no or bad key, 403 not allowed, 404 not found, 422 wrong input, 429 too many calls). Lists carry meta.page and meta.next_page.

Limits: so many calls a minute and a day per key (the site decides; your key's page shows them). The headers X-RateLimit-Limit and X-RateLimit-Remaining tell you where you are.

3. Try it

curl -H "X-API-Key: avk_your_key_here" "https://raozantv.com/developer-api/videos?sort=trending&limit=5"

curl -H "X-API-Key: avk_your_key_here" "https://raozantv.com/developer-api/videos/qMUJH2kQTmg"

4. Every route

RouteNeedsWhat it does
GETstatusreadThe site, the API and what your key may do.
GETvideosreadVideos. ?sort=latest|trending|popular|oldest|liked, ?q= words, ?category= id or slug, ?channel= username, ?tag=, ?page=, ?limit= (up to 50).
GETvideos/{id}readOne video with its description, tags and - when the site allows it - the files the signed-in member may play.
GETvideos/{id}/relatedreadVideos like it.
GETvideos/{id}/commentsreadIts comments with their replies. ?sort=top|newest|oldest
POSTvideos/{id}/commentswriteComment as the signed-in member: body, parent (a comment id to answer).
POSTvideos/{id}/likewriteLike (value=1), dislike (-1) or take it back (0).
GETsearchreadVideos and channels for ?q=.
GETchannelsreadChannels with videos, the biggest first. ?q= to look for one.
GETchannels/{username}readOne channel.
GETchannels/{username}/videosreadIts videos. ?sort=latest|popular|oldest
GETchannels/{username}/playlistsreadIts public playlists.
POSTchannels/{username}/subscribewriteSubscribe (subscribe=1) or leave (0) as the signed-in member.
GETcategoriesreadEvery category.
GETcategories/{slug}readThe videos of one category.
GETshortsreadShorts, the newest first (when the Shorts plugin is on).
GETplaylists/{id}readA playlist with its videos.
POSTauth/registeraccountMake an account: username, email, password, name. Answers a token.
POSTauth/loginaccountSign a member in: login (username or e-mail), password, and code when they use two-step sign-in. Answers a token.
GETauth/meaccountWho the token belongs to.
POSTauth/logoutaccountEnds the token.
GETmeaccountThe member the call acts for.
GETme/videosaccountTheir own videos, drafts and private ones included.
GETme/playlistsaccountTheir playlists.
GETme/subscriptionsaccountThe channels they follow.
POSTimportuploadBring a video in by its link (YouTube, Vimeo, Facebook, another AIO Video site and the rest the site imports from): url, title, description, tags, privacy, category.

POST bodies may be a form (application/x-www-form-urlencoded) or JSON (application/json).

5. Members: register, sign in, act for them

A key alone acts for the member who made it (good for your own scripts). An app used by other people signs each of them in and sends their token along with the key:

curl -X POST -H "X-API-Key: avk_your_key_here" \
     -d "login=member@example.com" -d "password=their-password" \
     "https://raozantv.com/developer-api/auth/login"
# {"ok":true,"data":{"token":"avt_...","token_type":"Bearer","expires_in":2592000,"member":{...}}}

curl -X POST -H "X-API-Key: avk_your_key_here" -H "Authorization: Bearer avt_..." \
     -d "body=Lovely video!" "https://raozantv.com/developer-api/videos/qMUJH2kQTmg/comments"

When the member uses two-step sign-in the first answer is 401 twofa_required (with the way: app or email); send the same call again with code. auth/register takes username, email, password and name and answers a token too.

A video's answer carries files - the sizes this member may play, as the site's own player would get them - when the site allows it; locked says age or region when it may not be played here, and embed_url is the player to put in an iframe.

6. "Sign in with RaozanTV" on your own site

This site is also an OAuth 2.0 / OpenID Connect provider: your site can put a "Continue with RaozanTV" button on its sign-in page without ever seeing a password. Everything a library needs is in the discovery document:

https://raozantv.com/.well-known/openid-configuration

An AIO Video site does it without a library: Admin → Plugins → "Sign in with another site", paste this site's address, done.

Ad