Start
Authentication
Every endpoint needs an API key. You get one by writing to or to on Discord.
Two ways to send it
Header (preferred for server code):
X-API-Key: YOUR_KEY
Query parameter (for places that cannot set headers, like an HTML <video> tag):
https://api.ytbro.net/player?id=aqz-KE-bpKQ&key=YOUR_KEY
If both are present, the header wins.
# Header
curl -H "X-API-Key: $YTBRO_KEY" "https://api.ytbro.net/player?id=aqz-KE-bpKQ"
# Query parameter
curl "https://api.ytbro.net/player?id=aqz-KE-bpKQ&key=$YTBRO_KEY"const res = await fetch('https://api.ytbro.net/player?id=aqz-KE-bpKQ', {
headers: { 'X-API-Key': process.env.YTBRO_KEY },
});requests.get(
"https://api.ytbro.net/player",
params={"id": "aqz-KE-bpKQ"},
headers={"X-API-Key": os.environ["YTBRO_KEY"]},
timeout=30,
)reqwest::Client::new()
.get("https://api.ytbro.net/player?id=aqz-KE-bpKQ")
.header("X-API-Key", std::env::var("YTBRO_KEY")?)
.send()
.await?;Missing or wrong key
The API answers 401 Unauthorized with a plain text body:
HTTP/2 401
content-type: text/plain; charset=utf-8
invalid or missing api key
Your key is inside the links
/player puts the key you called it with into every link it returns: downloadUrl,
streamUrl and dashUrl all carry key=YOUR_KEY. That is what makes them work in a browser
without extra headers.
It also means a link is as good as your key. Anyone who sees it can make billed requests.
Fetch /player on your server, not in the browser. If you put a streamUrl into a public
page, every visitor can read the key from the page source. For public playback, ask us for a
separate key that you can have revoked without touching your backend.