key. Everything else about your existing calls stays the same.
fetch
Append
&key=YOUR_KEY
to the URL. That's it.
- const url = `https://sub.wyzie.io/search?id=${id}&language=en`;
+ const url = `https://sub.wyzie.io/search?id=${id}&language=en&key=${API_KEY}`;
const API_KEY = "your_key_here"; // store in env, not source
const subs = await fetch(
`https://sub.wyzie.io/search?id=${tmdbId}&language=en&key=${API_KEY}`
).then(r => r.json());
If you build the URL with
URLSearchParams
just call
.set("key", API_KEY)
before stringifying.
const params = new URLSearchParams({ id: tmdbId, language: "en" });
params.set("key", API_KEY); // ← add this line
const subs = await fetch(`https://sub.wyzie.io/search?${params}`)
.then(r => r.json());
Pass
key
as an extra param
- const data = await searchSubtitles({
- tmdb_id: 286217,
- language: ["en"],
- });
+ const data = await searchSubtitles({
+ tmdb_id: 286217,
+ language: ["en"],
+ key: API_KEY, // ← add this line
+ });
Keep the key out of the browser entirely by forwarding requests through your own backend and injecting there.
app.get("/subs", async (req, res) => {
const params = new URLSearchParams(req.query);
params.set("key", process.env.WYZIE_API_KEY); // injected server-side
const upstream = await fetch(
`https://sub.wyzie.io/search?${params}`
);
res.json(await upstream.json());
});
# 1. clone
git clone https://github.com/wyzie/wyzie-worker
# 2. set the secret
npx wrangler secret put NITRO_API_TOKEN
# 3. deploy
pnpm build && npx wrangler deploy .output/server/index.mjs
# Done point your app at the worker URL.
Most scraper-based frontends (movie-web forks, sudo-flix, p-stream,
etc.) hit the subtitle API inside a provider or scraper function. Find
the file that constructs the
sub.wyzie.io/search
URL and add the key there.
// somewhere in providers/subtitles/*.ts
function buildSubUrl(id: string, lang: string) {
- return `https://sub.wyzie.io/search?id=${id}&language=${lang}`;
+ const key = globalThis._importMeta_.env.VITE_WYZIE_KEY ?? process.env.WYZIE_KEY;
+ return `https://sub.wyzie.io/search?id=${id}&language=${lang}&key=${key}`;
}
If subtitles are fetched inside a
useEffect
or a React Query function, the same one-liner applies just tack on
&key=…
wherever the URL string is assembled.
If your app runs in the browser, the key will be visible in network requests. For open-source or publicly deployed sites, use one of these strategies to keep it server-side only:
Deploy the official wyzie-worker Cloudflare Worker. It stores your token as a secret and injects it automatically your frontend never sees the key.
git clone https://github.com/wyzie/wyzie-worker
npx wrangler secret put NITRO_API_TOKEN
pnpm build && npx wrangler deploy .output/server/index.mjs
Then point your app at the worker URL instead of
sub.wyzie.io
no key required in client code.
Add a thin route to your existing backend that injects the key before forwarding to Wyzie Subs. The client calls your route, never the real API directly.
app.get("/subs", async (req, res) => {
const params = new URLSearchParams(req.query);
params.set("key", process.env.WYZIE_API_KEY);
const data = await fetch(`https://sub.wyzie.io/search?${params}`).then(r => r.json());
res.json(data);
});
Never hard-code the key in source files that get committed. Pick the right place for your stack:
# Vite / Nuxt front-end
VITE_WYZIE_KEY=your_key # .env (add .env to .gitignore)
# Node / Bun back-end
WYZIE_API_KEY=your_key # .env, Railway, Render, etc.
# Cloudflare Workers
npx wrangler secret put NITRO_API_TOKEN
# Vercel
vercel env add WYZIE_API_KEY