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

# llms.txt

> The keyless, self-describing text indexes an agent reads to discover the Financial Data API.

Financial Data API publishes two plain-text artifacts that describe the entire API in a form an LLM agent can read directly: a compact index at `GET /llms.txt` and the full reference at `GET /llms-full.txt`. Both are generated from the same OpenAPI 3.1 document the API serves, so they never drift from the live surface.

Neither needs an API key. An agent can fetch one cold, learn the endpoints and conventions, then start making authenticated calls.

<Info>
  `GET /llms.txt`, `GET /llms-full.txt`, and `GET /openapi.json` are all keyless, alongside `GET /health` and `GET /ready`.
</Info>

## The two files

<Columns cols={2}>
  <Card title="/llms.txt" icon="list">
    A compact, sectioned index. A short preamble (base URL, auth, envelope, error codes, pagination, time model) followed by one line per endpoint grouped into sections such as "Public data (redistribution-safe)", "Observations & provenance", and "Calendar & official events". Start here to learn the surface quickly.
  </Card>

  <Card title="/llms-full.txt" icon="file-lines">
    The full endpoint reference. Same preamble, then every endpoint with its summary, description, and parameters (types, enums, formats, and whether each is a path or query parameter). Use this when an agent needs to construct a call precisely.
  </Card>
</Columns>

## What the preamble tells an agent

Both files open with the same machine-readable conventions, so an agent gets the contract before it sees a single endpoint:

* **Base URL** and **version** (`v1`).
* **Auth.** Send `x-api-key: <key>` or `Authorization: Bearer <key>`. Scopes are `data:read`, `ops:read`, `admin`. The keyless endpoints are listed explicitly.
* **Envelope.** `{ data, meta: { request_id, api_version, pagination }, requestId }`, with the error shape and the stable codes (`bad_request`, `not_found`, `unauthorized`, `forbidden`, `rate_limited`, `internal_error`). It states plainly that unknown query params are rejected with `bad_request`.
* **Pagination.** Cursor-based: `limit` (1 to 500, default 100) and `cursor`, with `meta.pagination.next_cursor` and `has_more`.
* **Time model.** How `period` / `period_start` / `period_end`, `start_date` / `end_date`, and `as_of` differ.
* **Read-only.** Every endpoint is `GET`.

## Fetch them

<CodeGroup>
  ```bash cURL theme={"theme":"css-variables"}
  # Compact index (no key required)
  curl "https://api.financialdatapi.com/llms.txt"

  # Full reference with parameters (no key required)
  curl "https://api.financialdatapi.com/llms-full.txt"
  ```

  ```python Python theme={"theme":"css-variables"}
  import requests

  BASE = "https://api.financialdatapi.com"

  index = requests.get(f"{BASE}/llms.txt").text
  full = requests.get(f"{BASE}/llms-full.txt").text
  print(index[:500])
  ```

  ```typescript TypeScript theme={"theme":"css-variables"}
  const BASE = "https://api.financialdatapi.com";

  const index = await (await fetch(`${BASE}/llms.txt`)).text();
  const full = await (await fetch(`${BASE}/llms-full.txt`)).text();
  ```
</CodeGroup>

## How an agent uses them

<Steps>
  <Step title="Discover" icon="magnifying-glass">
    Fetch `/llms.txt` to read the conventions and scan the endpoint index. This is enough to choose the right endpoint for a question (for example, `/observations/latest` for the latest reading, or `/screener` to filter countries).
  </Step>

  <Step title="Construct" icon="wrench">
    Fetch `/llms-full.txt` (or `/openapi.json` for the structured spec) to read the exact parameters, types, and enums for the chosen endpoint, then build a valid request. Because unknown params are rejected, getting names right up front avoids a `bad_request`.
  </Step>

  <Step title="Call and follow" icon="play">
    Make the authenticated request with your key. The response is the standard envelope. For list endpoints, follow `meta.pagination.next_cursor` while `has_more` is `true`.
  </Step>
</Steps>

<Tip>
  For programmatic consumers (Postman, Insomnia, code generators, or your own tooling), the structured OpenAPI 3.1 document at `GET /openapi.json` is the canonical source the text files are projected from. Use the text files for agents that read prose, and the OpenAPI document for machine import.
</Tip>

## Related

<Columns cols={2}>
  <Card title="MCP server" icon="plug" href="/ai-agents/mcp-server">
    Skip the manual HTTP and give your agent native tools instead.
  </Card>

  <Card title="TypeScript SDK" icon="code" href="/sdks/typescript">
    A typed client over the same envelope and errors.
  </Card>
</Columns>
