Authentication
Send your Fiscal.ai API key in the X-Api-Key header on every request.
Every request to https:/ needs your API key. Send it in the X-Api-Key header:
curl -H "X-Api-Key: $FISCAL_API_KEY" "https://api.fiscal.ai/v3/company/profile?companyKey=NASDAQ_MSFT"
import os
import requests
response = requests.get(
"https://api.fiscal.ai/v3/company/profile",
params={"companyKey": "NASDAQ_MSFT"},
headers={"X-Api-Key": os.environ["FISCAL_API_KEY"]},
)
const response = await fetch("https://api.fiscal.ai/v3/company/profile?companyKey=NASDAQ_MSFT", {
headers: { "X-Api-Key": process.env.FISCAL_API_KEY },
});
Read the key from an environment variable or a secret manager. Never commit it or ship it in browser code.
To get a key, open https://fiscal.ai/get-started/api/professional/. It starts a free trial (no credit card), and if your organization already has the API, it opens your keys.
A key shows in full only once, when you create it, so copy it then. The key list only shows a masked version. If you lose a key, create a new one and delete the old one.
The Try It panels on these docs send the key you enter at the top of the page in the same header.
Errors
| Status | Message | Meaning |
|---|---|---|
400 | Missing api key | The request had no key. |
403 | Invalid api key: ... | The key is malformed or not recognized. |
403 | Data API access is not enabled for this organization. | The key is valid, but its organization doesn't have the Data API. |
The apiKey query parameter
The API also accepts the key as an apiKey query parameter, so existing integrations keep working. Don't use it in new code: a key in the URL ends up in server and proxy logs, browser history and anything else that records URLs. If a request sends both, the query parameter wins.