Authentication
Scority requests require x-api-key. Store it in server-side environment variables, not notebooks, client apps, or public repos.
Open →Move from local youtube-transcript-api scripts to Scority's HTTP API with clear differences around auth, response shape, errors, and limits.
The open-source youtube-transcript-api package runs inside your Python process. Scority is a hosted HTTP API that returns normalized transcript JSON. Moving between them means changing authentication, request construction, error handling, and operational limits.
The main change is that transcript retrieval moves from an in-process library call to a server-side HTTP request. That makes auth, retries, quota, and observability explicit.
Scority requests require x-api-key. Store it in server-side environment variables, not notebooks, client apps, or public repos.
Open →Scority returns text, segments, source, and language. Segments include text, start, and duration.
Open →Plan for invalid_video_id, unauthorized, rate_limited, quota_exceeded, transcript_not_available, and upstream_transcript_failed.
Open →Use the API from server-side Python. This example reads the key from the server-side environment and keeps it out of browser code.
import os
import requests
response = requests.get(
"https://api.scority.ai/v1/youtube/transcript",
headers={"x-api-key": os.environ["SCORITY_API_KEY"]},
params={
"video_id": "dQw4w9WgXcQ",
"language": "en",
},
timeout=30,
)
body = response.json()
if not response.ok:
code = body.get("error", {}).get("code", "transcript_request_failed")
raise RuntimeError(code)
segments = body["segments"]
text = body["text"]Before routing production traffic through Scority, test the videos, languages, and error cases that matter to your app.
The migration should not rely on claims that are not true in production. Scority does not promise a transcript for every video and does not expose a public web proxy at /api/transcript. Fallback processing is available for supported accounts and harder videos, but it is not a drop-in guarantee for every failed library call.