Every Vanda API accepts the same two credentials. Both run under your own Vanda account, so you get exactly the data your subscription covers.
| Method | Send on each request | Best for |
|---|---|---|
| API key (recommended) | x-api-key: <key> | Scripts, notebooks, scheduled jobs |
| Bearer token | Authorization: Bearer <token> | Quick tests, or tools that only support bearer auth |
- Sign in to Vanda Analytics and open Tools → API keys.
- Create a key. Give it a name you will recognise later, such as the project or machine it is for.
- Copy the key straight away. It is shown once and cannot be recovered.
- Send it as the
x-api-keyheader:
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.
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"vanda-api reads credentials from environment variables, so nothing sensitive sits in your code.
| Variable | Holds |
|---|---|
VANDA_SDK_KEY | An API key |
VANDA_API_TOKEN | A bearer token |
VANDA_LOGIN_EMAIL and VANDA_PASSWORD | Your 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 directlyIf more than one credential is set, the API key wins, then the token, then email and password. AsyncVandaClient takes the same arguments.
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.
| Status | Meaning | What to do |
|---|---|---|
400 | A filter or value the endpoint does not recognise | Check the value against /catalog/facets or the reference |
401 | Missing, invalid or expired credentials | Check the header name; request a new token or create a new key |
403 | Your account is not entitled to this data | Ask your account manager about access |
404 | None of the identifiers matched a series | Search the catalog for the right label or slug |
422 | A parameter is missing or has the wrong type | The response body names the parameter |
429 | The request is over a tier limit | Narrow 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.
- 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.