পণ্যের অংশে চলে যান
LCPanelলাইসেন্স সেন্টার প্যানেল
AIOV AIO Video টি অধ্যায়

AIO Video ডকুমেন্টেশন

ডেভেলপার API

মেম্বারদের API কী আর অ্যাপ ও অন্য ওয়েবসাইটের জন্য JSON API - ভিডিও, চ্যানেল, কমেন্ট, লাইক, সাইন-ইন ও ইমপোর্ট - লিমিট, অনুমোদন আর লগ সহ।

প্লাগিন হালনাগাদ ৬ নভে ২০২৬ ৩১ / ৩৫

The Developer API plugin opens your site to apps and other websites. Members make their own API keys; a phone app, a website or a script uses a key to read your videos and channels, to sign members in and to act for them - comment, like, subscribe, bring a video in by its link. Everything answers JSON.

Switching it on

The plugin is free and works with every licence. Switch it on at Admin → Plugins (the card says Developer API). Its pages are Developer API, API keys and API log under Plugins in the admin menu (admin/plugin.php?code=developer-api). Members find their keys under Settings → API keys; the guide for developers is at /developers.

Your site's own api.php - the one its pages talk to - does not change. A call without a key never reaches the plugin.

Keys for members

Under Settings → API keys a member gives a key a name ("My Android app"), ticks what it may do and, if the key will be used from a web page, lists the sites that may use it from a browser.

ScopeWhat a key with it may do
ReadPublic videos, channels, categories, Shorts, playlists and comments.
AccountRegister and sign members in, read the signed-in member's own videos, playlists and subscriptions.
WriteComment, like and subscribe as the signed-in member.
UploadBring a video in by its link (an import) as the signed-in member.

A key starts with avk_. It stays hidden on the page; Show puts it in, Hide takes it out, Copy puts it on the clipboard - as often as needed. New secret makes a new key and stops the old one at once. The site keeps a hash of the key and a copy sealed with the site's own secret (AES-256-GCM), never the key in plain text.

A key used alone acts for the member who owns it. An app that signs other members in gets a token for each of them (avt_…) and sends it as Authorization: Bearer … next to the key; the call then acts for that member.

The settings

SettingWhat it does
The API is onOff, every call is answered "switched off"; keys are kept.
Who may have keysEveryone · members with a confirmed e-mail · members whose package has "May have API keys" · everyone, but each new key waits for your approval · only the people who run the site. Admins and moderators always may.
Keys a member may haveHow many keys one member may have.
Calls a minute, per key / Calls a day, per keyThe limits of every key, unless you give a key its own under API keys. Answers carry X-RateLimit-Limit and X-RateLimit-Remaining.
What keys may be allowed to doUntick a scope to keep it from everyone.
Anybody may read public things without a keyRead routes answer without a key; Calls a minute from one address without a key limits them.
Apps may sign members in (auth/login) / Apps may make new accounts (auth/register)A member signed in through an app stays signed in for so many days.
Hand apps the video files they may playOne video lists the files the member may play, as addresses that work for so many hours.
Imports a member may make through the API in an hourPer member.
Keep a log of the callsEvery call, kept so many days.

API keys and the log

API keys lists every key of every member: the member, what it may do, its calls today and in all, when and from where it was last used, and its state. Approve a key that waits, Block a key (its calls are refused, the member sees it as blocked), give it its own limits and scopes, or Delete it.

API log shows the latest calls - when, which key, which member, the call, the answer, how long it took and where it came from. Tick Refused calls only to see what went wrong. A cron job removes old lines and old tokens.

For developers

The guide at /developers has the address (https://your-site/developer-api/{route}), the answer format ({"ok": true, "data": …, "meta": …} or {"ok": false, "error": {"code", "message"}} with an HTTP status that fits), every route, and samples in curl, JavaScript and PHP. The routes cover videos (latest, trending, popular, search, by channel, category or tag), one video with its files, related videos, comments (read and write), likes, channels with their videos and playlists, subscribe, categories, Shorts, playlists, the member's own videos, playlists and subscriptions, imports, and auth/register, auth/login (with the two-step code), auth/me and auth/logout.

Honest limits

  • A key used in a web page can be read by anybody who opens that page. Give such a key the Read scope only and list your site under its allowed sites; a browser on another site is then refused. Programs (not browsers) send no Origin, so the allowed-sites list cannot stop a copied key used from a server - New secret does.
  • Uploading a video file through the API is not offered; a video comes in by its link (an import), as the Upload scope says.
  • The secret that seals the keys is stored with the site's settings. Restoring a database without it leaves the stored keys unreadable; members then make new keys.
এটি কি কাজে লেগেছে?
এই অধ্যায়টি শেয়ার করুন