> ## Documentation index
> Fetch the complete documentation index at: https://api-docs.scanr.ai/llms.txt
> Use it to discover every page before exploring further.

# scanr.ai API

The scanr.ai API puts the scanner behind [scanr.ai](https://scanr.ai) in your code and your AI agents. Describe a screen once (price, volume, 100+ technical studies, fundamentals, relative strength, candlestick and chart patterns) and get back every U.S.-listed stock that matches, in one request.

It is built for two kinds of caller: **programs** that run screens on a schedule and act on the results, and **AI agents** that turn a question like *"which semiconductor stocks are breaking out on heavy volume?"* into a scan and read the answer.

**Connect your agent:** Paste this prompt into your agent. It connects the [MCP server](https://api-docs.scanr.ai/mcp-server.md) or the REST API for you and runs a first scan.

```text
Read https://api-docs.scanr.ai/connect.md and follow the instructions to connect me to scanr.ai.
```

- [Quick Start](https://api-docs.scanr.ai/quickstart.md): Create a token and run your first scan in about two minutes.
- [How Scanning Works](https://api-docs.scanr.ai/scanning.md): The scan model: universe, filters, groups, timeframes and results.
- [MCP Server](https://api-docs.scanr.ai/mcp-server.md): Give Claude, Cursor or any MCP client the scanner as a tool.
- [API Reference](https://api-docs.scanr.ai/api): Every endpoint, with request and response schemas.

## How a scan works

Every scan, from a script, a notebook or an AI agent, follows the same three steps:

1. **Get a scan payload.** A payload is the JSON that describes a screen. Describe the screen in English and [`POST /scan/natural`](https://api-docs.scanr.ai/natural-language-scans.md) writes the payload for you, or build the scan in the [scanr.ai scanner](https://scanr.ai/scan) and use **Export filters**. Either way you get the same JSON, so you don't need to learn the payload format to start.
2. **Run it.** Send the payload to [`POST /scan`](https://api-docs.scanr.ai/scanning.md) as `instructions`. You get back every matching ticker.
3. **Use the results.** Rank the matches, enrich them with the [data endpoints](https://api-docs.scanr.ai/datasets.md), or [save the scan](https://api-docs.scanr.ai/saved-scans.md) so scanr.ai runs it for you and alerts on new matches.

Keep the payload from step 1. Running it again costs one request and no AI credits. The examples in these docs show payloads written out in full so you can read exactly what they screen; you can get the same ones from a sentence or from the scanner.

## What you can do

**Scan the market.** The core of the API. One request screens the whole U.S. market and returns every match:

- **[Run scans](https://api-docs.scanr.ai/scanning.md)** with any combination of stock, technical, indicator, fundamental and pattern filters, on intraday, daily, weekly or monthly timeframes.
- **[Describe a scan in English](https://api-docs.scanr.ai/natural-language-scans.md)** and get a runnable payload back, with the reasoning behind each filter, then refine it in follow-up sentences.
- **[Save scans](https://api-docs.scanr.ai/saved-scans.md)** so scanr.ai runs them continuously, then read their alerts, history and forward-return performance.

**Read the data behind the scanner.** The same datasets a scan filters on, served directly (see [Datasets](https://api-docs.scanr.ai/datasets.md)):

- **Relative strength**: 1–99 percentile ranks against the market, sector and industry, and ranked lists of leaders.
- **Chart patterns** and **supply/demand zones** detected per ticker.
- **Market themes**: correlation-based groups of stocks, and their daily performance.
- **Technical indicators**: 80+ studies computed server-side for any ticker, one at a time or in bulk.
- **Reference data**: security search, sectors, industries, peers, ETF holdings and market status.

## Built for agents

Every page of these docs is available as plain markdown for AI agents. Add `.md` to any URL, or start from the index at [/llms.txt](https://api-docs.scanr.ai/llms.txt). There is also an installable [Agent Skill](https://api-docs.scanr.ai/agents.md#agent-skill) and a normalized [OpenAPI spec](https://api-docs.scanr.ai/openapi.json). See [Docs for Agents](https://api-docs.scanr.ai/agents.md).

## Base URL

```text
https://scanr.ai/api/v2
```

All endpoints are versioned under `/api/v2`. Requests and responses are JSON; send `Content-Type: application/json` with every request body. Authenticate with a token in the `Authorization` header (see [Authentication](https://api-docs.scanr.ai/authentication.md)).

## Plans

API access is a paid add-on with three plans. Every plan gets the full scanner; higher plans add request volume and more datasets:

| Plan | Built for | Adds |
| --- | --- | --- |
| **Starter** | Scanning | The full scanner, natural-language scans, saved scans, reference data, the MCP server |
| **Power User** | Signals | Relative strength, stock indicators, chart patterns, peers, ETF holdings, technical indicators, scan performance |
| **Business** | Alpha | Supply/demand zones, market themes and theme performance, regime indicators |

Limits and the endpoint-by-plan table are on [Plans & Rate Limits](https://api-docs.scanr.ai/rate-limits.md); prices are on [API pricing](https://scanr.ai/api-pricing).

## Versioning & stability

The current version is `v2`. Breaking changes ship under a new version path. Additive changes (new endpoints, new response fields, new filters in the scan catalog) can land on `v2` at any time, so treat unknown fields as forward-compatible.

## Status & support

- Service status: [status.scanr.ai](https://status.scanr.ai/)
- Questions and bugs: [contact@bagsbydata.com](mailto:contact@bagsbydata.com)
