Skip to content
Last updated

Authentication

Every Vanda API accepts the same two credentials. Both run under your own Vanda account, so you get exactly the data your subscription covers.

MethodSend on each requestBest for
API key (recommended)x-api-key: <key>Scripts, notebooks, scheduled jobs
Bearer tokenAuthorization: Bearer <token>Quick tests, or tools that only support bearer auth

API keys

  1. Sign in to Vanda Analytics and open Tools → API keys.
  2. Create a key. Give it a name you will recognise later, such as the project or machine it is for.
  3. Copy the key straight away. It is shown once and cannot be recovered.
  4. Send it as the x-api-key header:
curl https://api.vanda-analytics.com/positioning/users/me \
  -H "x-api-key: $VANDA_SDK_KEY"

Keys last 90 days by default. Revoke a key on the same page as soon as you stop using it, or if it may have leaked. A key belongs to your user: it carries your entitlements and tier limits, and never widens them.

Bearer tokens

Exchange your Vanda Analytics email and password for a short-lived token:

curl -X POST https://api.vanda-analytics.com/auth/basic \
  -H "Content-Type: application/json" \
  -d '{"email": "you@yourfirm.com", "password": "your_password"}'

The response holds access_token, token_type and expires_in (seconds). Send the token on each request until it expires, then request a new one:

curl https://api.vanda-analytics.com/positioning/users/me \
  -H "Authorization: Bearer $VANDA_API_TOKEN"

Python SDK

vanda-api reads credentials from environment variables, so nothing sensitive sits in your code.

VariableHolds
VANDA_SDK_KEYAn API key
VANDA_API_TOKENA bearer token
VANDA_LOGIN_EMAIL and VANDA_PASSWORDYour login; the SDK exchanges it for a token
from vanda import VandaClient

client = VandaClient()                       # reads the variables above
client = VandaClient(sdk_key="your_api_key")  # or pass a credential directly

If more than one credential is set, the API key wins, then the token, then email and password. AsyncVandaClient takes the same arguments.

Tiers and limits

Your subscription tier sets three limits on each request:

  • Page size: the most records one page can return.
  • Series per request: how many series one call can ask for.
  • History per request: how far back one call can reach. Split longer histories into several requests.

Check yours at any time:

curl https://api.vanda-analytics.com/positioning/users/me \
  -H "x-api-key: $VANDA_SDK_KEY"

A request over a limit is refused with 429. Full-history exports also need Data Licence access; ask your account manager.

Errors

StatusMeaningWhat to do
400A filter or value the endpoint does not recogniseCheck the value against /catalog/facets or the reference
401Missing, invalid or expired credentialsCheck the header name; request a new token or create a new key
403Your account is not entitled to this dataAsk your account manager about access
404None of the identifiers matched a seriesSearch the catalog for the right label or slug
422A parameter is missing or has the wrong typeThe response body names the parameter
429The request is over a tier limitNarrow the date range, page size or series list

When some identifiers match and others do not, Flow and Macro return what matched and list the rest under unresolved, so check it before treating a short result as complete. On Macro, a request where nothing matches returns no rows rather than 404.

Keep credentials safe

  • Store keys in environment variables or a secrets manager, never in code, notebooks you share, or version control.
  • Never paste a key or password into an AI assistant. Tell it which variable holds the key instead.
  • Use one key per project or machine, so you can revoke one without breaking the others.