> ## Documentation Index
> Fetch the complete documentation index at: https://docs.financialdatasets.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Financial Datasets API is served at https://api.financialdatasets.ai. Authenticate with the `X-API-KEY` header; create keys at https://financialdatasets.ai. Agents can open and fund their own account without a dashboard: see https://docs.financialdatasets.ai/agents.md.
> Tool-using agents can call Financial Datasets without writing code through the hosted MCP server at https://mcp.financialdatasets.ai/.
> The OpenAPI spec at https://financialdatasets.ai/openapi.json is the source of truth for request and response schemas.
> The index of every docs page is at https://docs.financialdatasets.ai/llms.txt. Append .md to any docs URL to get that page as Markdown.

# Agent Onboarding

> AI agents can open their own Financial Datasets account: sign up, pay, and pull data.

You are an AI agent (or you are building one). You can get a working, funded Financial Datasets API key without a dashboard, password, or OAuth. The account owner does exactly one thing: pay a Stripe link you hand them.

Machine-readable version of this flow: [financialdatasets.ai/skill.md](https://www.financialdatasets.ai/skill.md) (also served at `/.well-known/skills/default/skill.md`).

> [!NOTE]
>
> Have a wallet with USDC on Base? You can skip the account entirely and [pay per request with x402](https://docs.financialdatasets.ai/x402.md) on every documented GET data endpoint and the stock screener. Open an account when you need the few endpoints x402 does not cover.

## 1. Sign up

```python Python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

response = requests.post(
    "https://api.financialdatasets.ai/agent/signup",
    json={"email": "owner@realmail.com", "agent_name": "a-name-for-yourself"},
)
api_key = response.json()["api_key"]  # shown once - save it now
```

```bash cURL theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
curl -X POST "https://api.financialdatasets.ai/agent/signup" \
  -H "Content-Type: application/json" \
  -d '{"email": "owner@realmail.com", "agent_name": "a-name-for-yourself"}'
```

A `201` returns `api_key`. Save it immediately; it is not shown again. Rules:

* `email` must be the account owner's real inbox. Placeholder domains (example.com, test.com, ...) are rejected. The confirmation email and the payment link both depend on it.
* `agent_name`: 1-64 characters (letters, digits, spaces, dots, hyphens, underscores). The account owner sees it in the email, so pick something they recognize.
* Lost the key? While the account is unconfirmed and unfunded, call signup again with the same email to rotate it (`200`, fresh key). After confirmation or funding, key management moves to the [dashboard](https://www.financialdatasets.ai).
* `409` means the email already has an account that cannot be modified from here.

> [!NOTE]
>
> At signup we email the account owner once, with a one-click confirmation link (subject: "An AI agent created a Financial Datasets account with your email"). Tell them to expect it. Clicking it is optional but recommended: it marks the account as human-approved, and the page offers a funding button. Until the account is confirmed or funded, an owner who instead signs into the dashboard revokes your key.

## 2. Pay for access

Every data call returns `402 Payment Required` until the account is funded. The 402 body includes `checkout_link_endpoint` and `checkout_link_hint`. Mint the link yourself:

```python Python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

response = requests.post(
    "https://api.financialdatasets.ai/agent/checkout-link",
    headers={"X-API-KEY": api_key},
)
checkout_url = response.json()["checkout_url"]
```

```bash cURL theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
curl -X POST "https://api.financialdatasets.ai/agent/checkout-link" \
  -H "X-API-KEY: your_api_key_here"
```

The `200` response contains `checkout_url`: a Stripe Checkout page (\$20 minimum credits purchase; pass `{"amount_to_add": 50}` for more; below-minimum or non-numeric values return `400 invalid_amount_to_add`). Send it to the account owner; they pay in the browser with no login, and the account is credited within seconds. The payment page also offers optional auto-refill; if the account owner turns it on, the balance refills itself when it runs low. Paying the link can only credit the account tied to your key. Links expire after 24 hours; mint a fresh one anytime. A `502` means the link could not be created; retry.

## 3. Query data

Retry your call. `402` gone means funded: your key now works on every endpoint with the `X-API-KEY` header.

```python Python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

response = requests.get(
    "https://api.financialdatasets.ai/financials/income-statements",
    params={"ticker": "AAPL", "period": "annual", "limit": 4},
    headers={"X-API-KEY": api_key},
)
income_statements = response.json()["income_statements"]
```

```bash cURL theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
curl "https://api.financialdatasets.ai/financials/income-statements?ticker=AAPL&period=annual&limit=4" \
  -H "X-API-KEY: your_api_key_here"
```

When the balance runs out you will see `402` again; repeat step 2.

## What you can pull

The same key works on every dataset. Each line links to its endpoint page; the [docs llms.txt](https://docs.financialdatasets.ai/llms.txt) lists every parameter.

* **Fundamentals**: [financial statements](https://docs.financialdatasets.ai/api/financials/income-statements.md) (income, balance sheet, cash flow; annual, quarterly, TTM), [segments](https://docs.financialdatasets.ai/api/financials/all-segments.md), [as-reported line items](https://docs.financialdatasets.ai/api/financials/as-reported.md), and [financial metrics](https://docs.financialdatasets.ai/api/financial-metrics/historical.md). US companies, plus UK (`market=UK`) and France (`market=FR`).
* **Prices**: [historical prices](https://docs.financialdatasets.ai/api/prices/historical.md), a [real-time snapshot](https://docs.financialdatasets.ai/api/prices/snapshot.md) for one ticker, and the [whole market](https://docs.financialdatasets.ai/api/prices/market-snapshot.md) in one call.
* **Earnings**: [earnings results](https://docs.financialdatasets.ai/api/earnings.md) per company and a [feed](https://docs.financialdatasets.ai/api/earnings/feed.md) of the newest across all companies.
* **KPIs**: [operating KPIs](https://docs.financialdatasets.ai/api/kpi/metrics.md), [forward guidance](https://docs.financialdatasets.ai/api/kpi/guidance.md), and [non-GAAP metrics](https://docs.financialdatasets.ai/api/kpi/non-gaap.md) from earnings releases.
* **Filings**: [SEC filings](https://docs.financialdatasets.ai/api/filings/ticker.md) and [single sections](https://docs.financialdatasets.ai/api/filings/items.md) such as Item 1A Risk Factors, plus [IPO filings](https://docs.financialdatasets.ai/api/ipos.md).
* **Company**: [company facts](https://docs.financialdatasets.ai/api/company/facts/ticker.md) such as sector, industry, and exchange.
* **News**: [company news](https://docs.financialdatasets.ai/api/news/company.md) and [market news](https://docs.financialdatasets.ai/api/news/market.md).
* **Insiders**: [insider trades](https://docs.financialdatasets.ai/api/insider-trades.md) (Forms 4 and 5), [insider sale notices](https://docs.financialdatasets.ai/api/insider-sale-notices.md) (Form 144), and [insider ownership](https://docs.financialdatasets.ai/api/insider-ownership.md) (Forms 3 and 5).
* **Politicians**: [politician trades](https://docs.financialdatasets.ai/api/politician-trades.md), the stock trades that members of the US House disclose.
* **Ownership**: [13F holdings](https://docs.financialdatasets.ai/api/institutional-holdings/ticker.md) by investor or by stock, [beneficial ownership](https://docs.financialdatasets.ai/api/beneficial-ownership.md) (13D and 13G), [activist stakes](https://docs.financialdatasets.ai/api/activist-ownership.md), and [ETF holdings](https://docs.financialdatasets.ai/api/index-funds/ticker.md) or the [ETFs that hold a stock](https://docs.financialdatasets.ai/api/index-funds/holding.md).
* **Macro**: [central bank rates](https://docs.financialdatasets.ai/api/macro/interest-rates/historical.md), [Treasury yields](https://docs.financialdatasets.ai/api/macro/yield-curve/historical.md), [inflation](https://docs.financialdatasets.ai/api/macro/inflation/historical.md), the [labor market](https://docs.financialdatasets.ai/api/macro/labor/historical.md), [GDP](https://docs.financialdatasets.ai/api/macro/gdp/historical.md), and [GPU rental prices](https://docs.financialdatasets.ai/api/macro/gpu-prices/historical.md).
* **Search**: the [stock screener](https://docs.financialdatasets.ai/api/financials/search-screener.md) and [line-item search](https://docs.financialdatasets.ai/api/financials/search-line-items.md) across many tickers.

## Send feedback

Is a field missing, a number wrong, or an error unclear? Tell us with one free call: `POST /feedback` with `{"note": "..."}` and your `X-API-KEY` header. Any valid key works, also before the account is funded. We read every note and ship what agents ask for most. Error responses from the data endpoints include a `feedback` field that names this endpoint. Details: [Feedback](https://docs.financialdatasets.ai/feedback.md).

## Security rules for agents

* Your API key is a secret. Send it only to `api.financialdatasets.ai`, only in the `X-API-KEY` header.
* Sign up only with the email of the person who should own the account; the email owner controls it forever.
* If your key suddenly returns 401, the account owner may have revoked or replaced it. Ask them for a new key from the dashboard; do not re-signup loop.

## What's next?

> [card] [Full endpoint map](https://www.financialdatasets.ai/llms.txt)
>
> Every endpoint with parameters, in agent-readable llms.txt form.

> [card] [Financial Statements](https://docs.financialdatasets.ai/api/financials/income-statements.md)
>
> Income statements, balance sheets, and cash flow statements.

> [card] [Stock Prices](https://docs.financialdatasets.ai/api/prices/historical.md)
>
> Historical and real-time price data.

> [card] [MCP Server](https://docs.financialdatasets.ai/mcp-server.md)
>
> Person at the keyboard? MCP with OAuth is the faster path.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.