How to issue an ORTEX API key and authenticate your v1.1 API requests, with examples in Python, curl, and Node.js.
Every request to /api/v11/ endpoints is authenticated with an ORTEX API key sent in a request header. This page covers getting a key, sending it correctly, and what happens when authentication fails.
Getting an API key
If you don't have an API key yet, go to app.ortex.com/apis/plans to choose a plan and issue one.
An ORTEX API key has two parts separated by a dot:
AbCd1234.k9XyZ...rest-of-secret
└──────┘ └──────────────────┘
prefix secret
Send the whole key, not just the prefix.The part before the dot is the key's public prefix — it identifies the key in your dashboard and in our logs, but it cannot authenticate anything on its own. The full key, including everything after the dot, is shown only once, when the key is issued. Store it somewhere safe (a secrets manager or environment variable); if you lose it, revoke the key and issue a new one.
Treat the key like a password: keep it server-side, never commit it to source control, and never embed it in client-side (browser or mobile) code.
Sending the key
Put the key in the Ortex-Api-Key request header:
GET /api/v11/stock/NYSE/M/short/short_interest/?format=json HTTP/1.1
Host: api.ortex.com
Ortex-Api-Key: YOUR_API_KEY
If your HTTP client only exposes the standard Authorization header, that works too — the following schemes are all accepted, case-insensitively:
Authorization: ApiKey YOUR_API_KEY
Authorization: Bearer YOUR_API_KEY
Authorization: Api-Key YOUR_API_KEY
The key cannot be passed as a query parameter.URLs end up in server access logs, browser history, and
Refererheaders, so v1.1 deliberately never reads keys from the query string. If you are migrating from an older ORTEX API that used?authid=, move the key into theOrtex-Api-Keyheader.
Examples
All three examples call the same endpoint — Macy's (M on NYSE) short interest — and print the response. Replace YOUR_API_KEY with your full API key (better: read it from an environment variable, as the Node example does).
import requests
url = "https://api.ortex.com/api/v11/stock/NYSE/M/short/short_interest/?format=json"
headers = {"Ortex-Api-Key": "YOUR_API_KEY"}
response = requests.get(url, headers=headers)
response.raise_for_status()
payload = response.json()
print(payload["instrument"]) # which listing the ticker resolved to
print(payload["meta"]) # counts, credits, timestamps
print(payload["data"][:3]) # the first three rowscurl --request GET \
--header "Ortex-Api-Key: YOUR_API_KEY" \
"https://api.ortex.com/api/v11/stock/NYSE/M/short/short_interest/?format=json"const url = "https://api.ortex.com/api/v11/stock/NYSE/M/short/short_interest/?format=json";
const response = await fetch(url, {
headers: { "Ortex-Api-Key": process.env.ORTEX_API_KEY },
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.status} ${error.code}: ${error.message}`);
}
const payload = await response.json();
console.log(payload.instrument); // which listing the ticker resolved to
console.log(payload.meta); // counts, credits, timestamps
console.log(payload.data.slice(0, 3));A successful call returns 200 with the standard envelope — see The Response Envelope for what each block means.
Trying the API without a key
The literal key TEST (case-sensitive) works on every data endpoint and returns a small, fixed sample of data — the date range and result count are system-controlled and no credits are charged. Responses made with the TEST key carry a meta.testKeyNote reminder. It's the quickest way to see an endpoint's real response shape before subscribing.
The one exception is the universe-maintainer endpoints (Bulk APIs → Universes), which create and modify universes belonging to your ORTEX account. The TEST key has no account, so those endpoints reject it with 403 insufficientSubscription.
When authentication fails
Authentication failures use the standard error envelope with these codes — see Response & Error Codes for the envelope structure:
| HTTP | code | Meaning | What to do |
|---|---|---|---|
401 | apiKeyMissing | No key was found in the request headers | Send the key in Ortex-Api-Key |
401 | apiKeyInvalid | The key does not match any account — often a truncated or prefix-only key | Re-copy the full key; re-issue it if lost |
403 | apiKeyExpired | The key has passed its expiry date | Contact your account manager to renew |
403 | apiKeyRevoked | The key has been revoked | Email [email protected] for a replacement |
403 | apiKeyDisabled | The account linked to the key is disabled | Email [email protected] |
403 | endpointNotInPlan | The key is valid but this endpoint is not in your plan | Contact your account manager to add it |
