# stockmarketapi.ai

> REST API for stored company profiles, financial statements, price history,
> and reports. Active company records: 2,392.
> Stored report documents: 4,529; markdown documents:
> 4,502. Availability varies by listing and dataset.
> Coverage state: available. Built for AI agents and data applications.

## Documentation

- [API reference (Swagger UI)](https://stockmarketapi.ai/api/docs): interactive docs from the OpenAPI spec.
- [OpenAPI 3.1 spec](https://stockmarketapi.ai/api/openapi.json): machine-readable endpoint schema.
- [Full endpoint reference for LLMs](https://stockmarketapi.ai/llms-full.txt): every endpoint with parameters, in markdown.
- [AI agent setup hub](https://stockmarketapi.ai/ai-agents): per-agent setup for Claude Code, Cursor, Codex CLI, Gemini CLI.
- [AI agent skill file](https://stockmarketapi.ai/skill.md): usage patterns, code examples, and conventions for programmatic consumers.
- [Covered companies directory](https://stockmarketapi.ai/companies): crawlable page per covered company with data-coverage detail.
- [Pricing](https://stockmarketapi.ai/pricing): Free, Pro ($19/mo), Pro Plus ($49/mo). Card or USDC crypto.

## Exchange profiles and observed database coverage

- [NYSE](https://stockmarketapi.ai/exchanges/nyse): 356 stored active company records; exchange profile describes market scope separately.
- [NASDAQ](https://stockmarketapi.ai/exchanges/nasdaq): 195 stored active company records; exchange profile describes market scope separately.
- [LSE](https://stockmarketapi.ai/exchanges/lse): 0 stored active company records; exchange profile describes market scope separately.
- [TSE](https://stockmarketapi.ai/exchanges/tse): 0 stored active company records; exchange profile describes market scope separately.
- [TSX](https://stockmarketapi.ai/exchanges/tsx): 0 stored active company records; exchange profile describes market scope separately.
- [HKEX](https://stockmarketapi.ai/exchanges/hkex): 1 stored active company records; exchange profile describes market scope separately.
- [EURONEXT](https://stockmarketapi.ai/exchanges/euronext): 0 stored active company records; exchange profile describes market scope separately.
- [ASX](https://stockmarketapi.ai/exchanges/asx): 1,831 stored active company records; exchange profile describes market scope separately.

## Market indices with live membership API

- [S&P 500](https://stockmarketapi.ai/markets/sp500): 492 stored active members — live membership API at GET /api/v1/indices/SP500
- [NASDAQ 100](https://stockmarketapi.ai/markets/nasdaq100): 101 stored active members — live membership API at GET /api/v1/indices/NASDAQ100
- [Dow Jones Industrial Average](https://stockmarketapi.ai/markets/dow30): 30 stored active members — live membership API at GET /api/v1/indices/DOW30
- [S&P/ASX 200](https://stockmarketapi.ai/markets/asx200): 195 stored active members — live membership API at GET /api/v1/indices/ASX200

## Index information pages (no membership API)

Constituent membership for these indices is not available via the API — the
pages below describe the index itself only:

- [FTSE 100](https://stockmarketapi.ai/markets/ftse100): index profile page only
- [Nikkei 225](https://stockmarketapi.ai/markets/nikkei225): index profile page only

## Data resources

- [List all indices](https://stockmarketapi.ai/api/v1/indices): returns all supported indices with member counts.
- [ASX 200 members (live JSON)](https://stockmarketapi.ai/api/v1/indices/ASX200): stored active constituents; count may differ from the nominal index size.
- [Company profile](https://stockmarketapi.ai/api/v1/companies/BHP): description, industry, HQ, employees, market cap, markdown profile URL.
- [Financials](https://stockmarketapi.ai/api/v1/companies/BHP/financials): multi-year financial statements.
- [Metrics summary](https://stockmarketapi.ai/api/v1/companies/BHP/metrics/summary): P/E, P/B, ROE, ROA, margins, EPS, debt/equity.
- [Filings](https://stockmarketapi.ai/api/v1/companies/BHP/filings?source=asx): annual report PDFs + LLM-ready markdown.
- [News & announcements](https://stockmarketapi.ai/api/v1/companies/BHP/news): recent press releases and ASX announcements.
- [Top companies](https://stockmarketapi.ai/api/v1/stats/top-companies): live mega-cap table with P/E, EPS, volume.
- Complete missing data (paid tiers): `POST /api/v1/companies/{ticker}/complete` queues an on-demand backfill for an untracked or incomplete ticker (creating the company if new); poll `GET /api/v1/companies/{ticker}/completion` for progress_pct and a time estimate.

## Agentic payments (x402)

AI agents can subscribe autonomously using USDC on Base via the x402 protocol:

- `POST /payments/agent-subscribe` — gasless EIP-712, returns API key in two HTTP calls
- Plans: monthly ($19), yearly ($179.40), monthly_plus ($49), yearly_plus ($479.40)
- [Route catalog](https://stockmarketapi.ai/api/v1/agentic/routes): machine-readable x402 pricing

## Authentication

Include an `X-API-Key` header on every request. Keys are free:

```
POST /api/v1/auth/keys
Content-Type: application/json
{"email": "you@example.com"}
```

## Key facts for LLM summarisation

- Exchange profile pages describe markets; they do not guarantee full ingestion.
- **Active companies**: 2,392
- **4 index membership lists**: S&P 500 (492), NASDAQ 100 (101), Dow Jones Industrial Average (30), S&P/ASX 200 (195)
- **4,529** stored report documents, **4,502** as LLM-ready markdown
- Company news & ASX announcements with dates, categories, and source links
- Computed ratios where inputs are available: P/E, P/B, P/S, ROE, ROA, margins, EPS, debt-to-equity, current ratio
- Stored timestamps and source tags describe each dataset's provenance; no real-time or universal refresh guarantee.
- Payments via Stripe (card) or USDC crypto (Base, Solana) via x402 protocol
