Skip to content
Browse documentation
Get started

Authentication

Every request to Raspberry API is authenticated with a single API key. One key unlocks every endpoint — send it on each request and you're connected.

Your API key

API keys start with ra_live_. Create one in your dashboard (free to start) and copy it. The same key works for Sentiment, the Breakout Radar, Strategies, Insider data — every product on one key.

Example key
ra_live_8f2a9c4d1e6b7a3f0c5d2e1b4a6f8c9d

Sending your key

There are three ways to present your key. The x-api-key header is the recommended one for production.

MethodHowWhen to use
x-api-key headerx-api-key: ra_live_…Recommended for all server-side calls.
Authorization headerAuthorization: Bearer ra_live_…If your HTTP client defaults to Bearer tokens.
?api_key= query—Removed on 2026-09-26: URLs end up in browser history and server logs. Use the header.

The ?api_key= query option is handy for a one-off test in the address bar, but it leaks the key into logs and browser history. Use the header everywhere else.

Authenticated request

The same call in three languages:

cURL
curl "https://raspberrytrades.com/api/sentiment?ticker=NVDA" \
  -H "x-api-key: ra_live_your_key_here"
Python
import requests

resp = requests.get(
    "https://raspberrytrades.com/api/sentiment",
    params={"ticker": "NVDA"},
    headers={"x-api-key": "ra_live_your_key_here"},
)
data = resp.json()
print(data)
JavaScript
const res = await fetch(
  "https://raspberrytrades.com/api/sentiment?ticker=NVDA",
  { headers: { "x-api-key": "ra_live_your_key_here" } }
);
const data = await res.json();
console.log(data);

When auth fails

A missing or unrecognized key returns 401 Unauthorized. A valid key that isn't scoped to the product you're calling — or an account an admin has disabled — returns 403 Forbidden. Past your monthly quota you'll see 429. See the Errors reference for the full list.

Keep your key secret

Treat your key like a password. Keep it on your server and pass it from your backend — never ship it in front-end JavaScript, a mobile bundle, or a public repo. If a key leaks, rotate it from your dashboard; the old one stops working immediately.