> Fiscal.ai API docs. Source: https://docs.fiscal.ai/docs/authentication. Every page is listed in https://docs.fiscal.ai/llms.txt; append `.md` to any docs URL for its Markdown.

# Authentication

Send your Fiscal.ai API key in the X-Api-Key header on every request.

Every request to `https://api.fiscal.ai` needs your API key. Send it in the `X-Api-Key` header:

```bash
curl -H "X-Api-Key: $FISCAL_API_KEY" "https://api.fiscal.ai/v3/company/profile?companyKey=NASDAQ_MSFT"
```

```python

response = requests.get(
    "https://api.fiscal.ai/v3/company/profile",
    params={"companyKey": "NASDAQ_MSFT"},
    headers={"X-Api-Key": os.environ["FISCAL_API_KEY"]},
)
```

```javascript
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, sign up at https://fiscal.ai/onboarding/org/create/api, open **Data API** and create one. The free trial needs no credit card.

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.
