Authentication
Send your KashRock API key, keep it safe, and connect sockets from clients that cannot set headers.
Send your key
Every request carries your key in one header. Both forms work:
curl "https://kashrock.up.railway.app/v7/meta" -H "x-api-key: $KASHROCK_API_KEY"
curl "https://kashrock.up.railway.app/v7/meta" -H "Authorization: Bearer $KASHROCK_API_KEY"A missing or wrong key answers 401:
{"error":{"code":"invalid_key","message":"The API key is unknown or deactivated.","status":401}}Keep it safe
- Call KashRock from server code only (an API route, a backend, a bot). Never ship the key to a browser or mobile app.
- Read it from an environment variable such as
KASHROCK_API_KEY, and keep.envout of git. - The full key is shown once, when you create it. Manage keys, revoke a leaked one, and see when each was last used in the console. How many keys you can hold depends on your plan:
| Plan | Price | Credits | Rate limit | API keys | Live data | History | WebSocket |
|---|---|---|---|---|---|---|---|
| Sandbox | $0/mo | 1,500 credits a day | 10 req/min | 1 | No live data | None | None |
| Hobby | $29.99/mo | 1.5M credits a month | 30 req/min | 1 | 15s delay | Last 90 days | None |
| Builder | $99/mo | 5M credits a month | 100 req/min | 3 | Real time | Full archive | 2 connections, 5 matches |
| Pro | $199/mo | 10M credits a month | 250 req/min | 5 | Real time | Full archive | 10 connections, 25 matches, whole board |
| Quant | $299/mo or $2,990/yr | 20M credits a month | 500 req/min | 10 | Real time | Full archive | 20 connections, 50 matches, whole board |
Sockets from browsers
The live WebSocket accepts the same headers. A client that cannot set headers (a browser) first asks for a ticket, then opens the socket with it:
curl -X POST "https://kashrock.up.railway.app/v7/ws-ticket" -H "x-api-key: $KASHROCK_API_KEY"
# then connect to wss://kashrock.up.railway.app/v7/live/ws?ticket=<ticket>A ticket works once and lasts 60 seconds. Mint it from your server, not the browser. See WebSockets.
Looking around without a key
https://kashrock.up.railway.app/v6/demo/cs2-prop returns one live prop with no key. Every other request needs your own key.
