Authentication

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 Referer headers, 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 the Ortex-Api-Key header.

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 rows
curl --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.

Checking your key

GET /api/v11/whoami/ tells you whether a key works and what it carries, without calling a data endpoint. Every valid key may call it, whatever its plan, and it is never charged (it is rate limited like any other call). If the key fails, you get the same 401 or 403 described below, so it is also the quickest way to diagnose an authentication error.

curl --header "Ortex-Api-Key: YOUR_API_KEY" "https://api.ortex.com/api/v11/whoami/"

The data block describes the key:

{
  "keyPrefix": "AbCd1234",
  "tier": "Quant",
  "rateLimit": "5/sec",
  "creditsRemaining": 48210.5,
  "expiresAt": null,
  "enterprise": false,
  "regionRestriction": null,
  "viewGroups": ["Full Access"]
}
FieldMeaning
keyPrefixThe public part of the key, before the dot. Quote it to support; never share the rest.
tierThe API plan the key's limits come from. test for the TEST key.
rateLimitThe rate the key is throttled at.
creditsRemainingCredits left this cycle on a plan charged per call; null on Enterprise, whose endpoints are uncharged.
expiresAtWhen the key stops working, or null if it does not expire.
enterpriseWhether the key may call the enterprise endpoints.
regionRestrictionThe regions the key's data is limited to, or null when unrestricted.
viewGroupsThe endpoint groups the key may call. Full Access means every endpoint your plan covers.

When authentication fails

Authentication failures use the standard error envelope with these codes — see Response & Error Codes for the envelope structure:

HTTPcodeMeaningWhat to do
401apiKeyMissingNo key was found in the request headersSend the key in Ortex-Api-Key
401apiKeyInvalidThe key does not match any account — often a truncated or prefix-only keyRe-copy the full key; re-issue it if lost
403apiKeyExpiredThe key has passed its expiry dateContact your account manager to renew
403apiKeyRevokedThe key has been revokedEmail [email protected] for a replacement
403apiKeyDisabledThe account linked to the key is disabledEmail [email protected]
403endpointNotInPlanThe key is valid but this endpoint is not in your planContact your account manager to add it