INDEPENDENT DEVELOPER REFERENCE
Can I call the API from browser JavaScript?
Do not call it from browser code. A key in a client bundle is readable by anyone, and all keys on an account share one allowance. Data endpoints also do not send cross-origin headers. Call the API from a server route and return only what your page needs.
Editorial review: · Not a live coverage report
A small server route
Your route holds the key in its environment, validates what the browser asked for, and caches the response. Caching protects your allowance as well as your response time, since API responses are themselves no-store.
// app/api/board/route.ts, in your own Next.js app
export async function GET() {
const r = await fetch(
"https://draftkingsapi.com/api/v1/pick6/projections?sport=NHL&limit=25",
{ headers: { Authorization: "Bearer " + process.env.DRAFTKINGS_API_KEY } },
);
if (!r.ok) return Response.json({ error: "Upstream " + r.status }, { status: 502 });
const { data } = await r.json();
return Response.json(data.filter((row) => !row.stale));
}Check the recorded data
Related resources
Call the API from Node.js with built-in fetch: timeouts, retries, async pagination and a server route that keeps your key private.
How do I get an API key?Create an account, open the dashboard and create a named key. The secret appears once, and every /api/v1 data request needs it as a Bearer token.
DraftKings API quickstart: your first call in one minuteFor developers who want a response now: a keyless sample, then a free key, then an authenticated call. Not for production hardening or sportsbook player props.
Independent service operated by DD Inc., not affiliated with or endorsed by DraftKings. Technical access is not a redistribution license. No wagering: this service does not place, recommend or settle entries or bets. Check sources and status for actual capture context.