Stake API Key Setup: How to Get One and What It Enables

Published 2026-04-06 · Tags: guides, api, product

Stake's API key grants programmatic account access. How to generate one, what it lets you do, security considerations, and the scripts actually worth building.

Stake offers an API key system that lets you access your account programmatically, read bet history, pull balance info, even place bets. Most players never use it. The ones who do get significant extra capability. This post walks through how to get one, what it enables, the security considerations, and why we use them to power our Stake Profile cards.

What a Stake API key is

Stake's API key is a bearer token that authenticates you to their GraphQL API without logging in via the browser. You paste it into a header (x-access-token) and any request is authorized as you.

Think of it as a "permanent password" that bypasses 2FA for API access. You generate it once and reuse it.

How to generate one

  1. Log into Stake.com in your browser
  2. Click your avatar → Settings
  3. Navigate to API or Developer (the exact location changes periodically, check the settings menu)
  4. Click Generate API Key
  5. Copy the key immediately — Stake usually shows it only once, then stores a hashed version

The key looks something like: sk_live_AbCdEf123..., roughly 40 characters of random alphanumerics.

If you lose it, generate a new one; the old one stays valid until explicitly revoked.

What the API lets you do

Stake exposes most of the user-facing functionality through GraphQL:

Read operations (safe)

Write operations (potentially destructive)

Anyone with your API key can do any of these. Treat it like a password. More on security below.

Why we use API keys (for Stake Profile cards)

Our Sports Tracker's Stake Profile feature lets you connect your Stake API key to build a profile card with:

We encrypt your key with AES-256-GCM before storing it, and use it only to fetch your public bet data through a rate-limited proxy on our VPS. You can revoke the key at any time on Stake's side, our access immediately dies.

If you're curious about what's stored and how: see our security audit post (if published) or inspect our backend profile module which is open source.

Useful scripts with an API key

A few things advanced players build with their key:

1. Automated bet export

Pull your last 10,000 bets nightly into a local database. Feed into our Bet Analyzer offline or into your own custom scripts.

const r = await fetch("https://stake.com/_api/graphql", {
  method: "POST",
  headers: {
    "x-access-token": YOUR_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    query: `{ user { sportBetList(limit: 100) { edges { node { id amount payout ... } } } } }`,
  }),
});

2. Balance monitoring

Alert yourself when a specific coin's balance crosses a threshold. Useful for auto-withdrawing winnings or detecting unusual drops.

3. Auto-bet bots

Technically possible but heavily discouraged:

If you're thinking "but I've written a smart bot that will win", no. You haven't. Every gambling bot ever written loses at the same rate as manual play, because the game's house edge is deterministic.

4. Provably fair batch verification

If you have a custom verifier implementation, a key lets you pull the seed + nonce + payout for every bet in your history and audit them in bulk. Our Stake Verifier supports this workflow via bet archive upload (no API key needed), same result.

Security — treat the key like a master password

The key has the power to:

Concrete threat models:

Best practices:

  1. Use a dedicated environment variable (e.g. STAKE_API_KEY) instead of hardcoding in scripts
  2. Rotate the key periodically (every 90 days is reasonable for active scripts)
  3. Revoke immediately if you suspect exposure (Settings → API → Revoke)
  4. Don't share it with anyone, including support, Stake's support will never ask for your key
  5. Check account login history regularly in Settings → Security → Activity log

API rate limits

Stake enforces rate limits on API requests:

For normal usage (daily bet export, balance checks), you'll never hit limits. If you're running a heavy query every minute, you might.

Key differences from direct session auth

Session cookieAPI key
Persists indefinitely?No, expiresYes, until revoked
Works with 2FA?Requires fresh 2FA sometimesBypasses 2FA
Tied to a browser?YesNo
Can place bets?YesYes
Risk if leakedShort window (session expires)Permanent until revoked

API keys are more powerful and more dangerous. Use them deliberately.

The "I lost my API key but it's still in use somewhere" fix

If you generated a key, used it in a script, and lost track of it:

  1. Log into Stake → Settings → API
  2. Revoke any keys you don't recognize
  3. Generate a new one
  4. Update your scripts with the new one

Old revoked keys become instant 401s on any future call — safe even if they're sitting in an old backup somewhere.

What NOT to build with an API key

What the API can't do

Good to know what it can't do:

Net-net

Stake's API key is a powerful, permanent credential that enables automated access to your account. Most players don't need one. If you do use one (e.g. for our Profile cards, custom analytics, or controlled exports), treat it like a master password: store securely, rotate periodically, revoke immediately if exposed, and don't use it for betting bots that will get you banned.

Connect your key to view your full sports bet profile. Open the Tracker →

Related Posts

Free Stake Tools

More Free Stake Tools