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

> ## Agent Instructions
> These docs cover the Darvas financial data API, its MCP server, data API and Darvas Pro+ webhooks, and Pine Script custom indicators for Darvas charts.
> https://docs.darvas.app/llms.txt lists every indexed page with a summary, and https://docs.darvas.app/llms-full.txt holds them in one file. Add .md to any page URL to read that page as Markdown. The lookup lists of tickers, types and series are named at https://docs.darvas.app/ai-agents.
> The docs MCP server https://docs.darvas.app/mcp searches and reads these docs. It needs no key.
> Call the REST API at https://api.darvas.app/v1. Send the API key, which starts with dvk_, in the X-API-KEY header or as Authorization: Bearer. The OpenAPI 3.1 spec of all 168 operations is https://docs.darvas.app/openapi.yaml.
> Name a company by ticker or cik. A share class takes a dot or a dash, so BRK.B and BRK-B name the same shares. Dates are YYYY-MM-DD.
> A list answer holds one page. Request its next_page_url as it is until the answer has none. limit counts rows across all pages.
> Errors are JSON with a stable error code and a message: 400 VALIDATION_ERROR, 401 UNAUTHORIZED, 403 PLAN_REQUIRED, 404 NOT_FOUND, 429 RATE_LIMITED or QUOTA_EXCEEDED, 500 INTERNAL_ERROR and 503 UNAVAILABLE. On a 429, wait the seconds in Retry-After. 1 credit = 1 successful call: a 2xx answer with data costs one credit however many rows it holds (at most 1,000 a page), and empty answers, errors and FINRA /short-volume cost 0 credits.
> The Financial Data MCP server is https://api.darvas.app/mcp (Streamable HTTP, protocol 2025-11-25, the same API key in X-API-KEY or as a Bearer token). tools/list answers 8 flagship tools plus search_data_tools and call_data_tool by default; ?mode=full lists all 164 tools and ?toolsets=sec,crypto,macro lists domains. Every tool is callable by name, takes response_format (json, compact or tsv) and fields, and a list answer's cursor value goes in the cursor argument. The darvas://catalog/* resources cost 0 credits. Setup for each client is at https://docs.darvas.app/mcp-server.
> The data API covers SEC filers and their filings, statements, XBRL facts, debt maturities, ownership and earnings, US stock prices, technicals and FINRA short volume, macro series and a global economic calendar.
> Its crypto data covers prices, indices, order books, order flow, volume profiles, derivatives, options, liquidations, spot ETF flows and a screener across 9 exchanges. It also covers DeFi protocols, stablecoins, yields and DEX pairs, and Polymarket, Kalshi and OKX prediction markets. https://docs.darvas.app/market-coverage gives the history and update time of each dataset.
> https://docs.darvas.app/ai-agents names the endpoint and the MCP tool that answer each kind of question about these datasets.
> Custom indicators for Darvas charts are Pine Script v5 or v6 indicator() or strategy() scripts. Darvas rewrites Pine v1 to v4 to v5 and runs no other indicator language. Start at https://docs.darvas.app/pine-script/introduction.
> https://docs.darvas.app/pine-script/support lists the Pine Script that Darvas runs. https://docs.darvas.app/pine-script/request-security covers request.security() and request.financial(), and https://docs.darvas.app/pine-script/limits lists the run limits.
> Darvas Pro+ webhooks send a signed POST for alarm fires and pauses, scheduled answers, economic calendar alerts, ETF flow updates, ended connections and the data API events. https://docs.darvas.app/pro/webhooks lists every event, its object and how to verify the Darvas-Signature header.

# Cursor Pagination, Limits & Response Paging

> Page cleanly through large SEC, stock, macro and crypto datasets with next_page_url cursors, row limits, MCP cursor arguments and page size rules.

A list endpoint answers one page per request. The page size depends on the dataset, from 10 periods of financial statements to 1,000 crypto trades.

* `limit` counts rows across all pages. On a 100-row endpoint, `limit=250` returns three pages of 100, 100 and 50.
* When more rows remain, the answer has `next_page_url`. Request it as it is; its `cursor` carries every filter of the first request and replaces the other parameters.
* `next_page_url` keeps the host and base path you called, so a client that checks the origin of each link keeps working.
* The last page has no `next_page_url`.

```python theme={null}
import os
import requests

headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]}
url = "https://api.darvas.app/v1/insider-trades"
params = {"ticker": "NVDA", "transaction_type": "Sale", "limit": 500}

trades = []
while url:
    page = requests.get(url, headers=headers, params=params).json()
    trades.extend(page["insider_trades"])
    url = page.get("next_page_url")
    params = None  # the cursor in next_page_url holds the filters

print(len(trades))
```

## Page sizes

| Endpoints | Rows per page | `limit` |
| - | - | - |
| [Financial statements](https://docs.darvas.app/financials/income-statements.md) | 10 periods | Counts periods across pages, up to 400 |
| [Earnings releases](https://docs.darvas.app/earnings/releases.md) | 10 filings | Counts periods across pages, up to 40 |
| [GPU rental prices](https://docs.darvas.app/macro/gpu-rental-prices.md) | Up to 10 days | Pages by date; the last 90 days without dates |
| [SEC filings](https://docs.darvas.app/sec-edgar/filings.md), [IPO filings](https://docs.darvas.app/sec-edgar/ipo-filings.md), [insider trades](https://docs.darvas.app/ownership/insider-trading.md), [insider holdings](https://docs.darvas.app/ownership/insider-holdings.md), [Form 144](https://docs.darvas.app/ownership/form-144-sale-notices.md), [13D and 13G](https://docs.darvas.app/ownership/beneficial-13d-13g.md) | 100 | Up to 10,000 |
| [13F holdings](https://docs.darvas.app/ownership/13f-institutional-holdings.md), [ETF and fund holdings](https://docs.darvas.app/ownership/etf-fund-holdings.md) | 100 | Counts across pages; fund holdings default to 50 and take `offset` |
| [Historical stock prices](https://docs.darvas.app/stocks/historical-prices.md) | Up to 100 bars | Counts across pages |
| [Financial news](https://docs.darvas.app/stocks/financial-news.md) | `limit`, 1 to 100 | 5 by default |
| [Economic calendar](https://docs.darvas.app/macro/economic-calendar.md) | `limit`, 1 to 200 | 100 by default |
| [XBRL facts](https://docs.darvas.app/financials/xbrl-facts.md), [tokenized stock prices](https://docs.darvas.app/tokenized-stocks/prices.md) and [trades](https://docs.darvas.app/tokenized-stocks/trades.md) | `limit`, 1 to 1,000 | 200 by default |
| [Crypto prices](https://docs.darvas.app/crypto/prices.md), [crypto order flow](https://docs.darvas.app/crypto/order-flow.md) | 500 bars | 5,000 by default, up to 50,000 |
| [Crypto trades](https://docs.darvas.app/crypto/trades.md) | 1,000 trades | 1,000 by default, up to 100,000 |
| Macro history: [inflation](https://docs.darvas.app/macro/cpi-pce-inflation.md), [labor market](https://docs.darvas.app/macro/labor-market.md), [GDP and income](https://docs.darvas.app/macro/gdp-income.md) and the other series | Up to 1,000 rows | Pages by date: send `start_date` and `end_date` |

Lists of tickers, CIKs, types and series answer in one response with no `next_page_url`.

## Pagination on the MCP server

55 of the 164 tools on the [MCP server](https://docs.darvas.app/mcp-server.md) take a `cursor` argument. Pass only the `cursor` value of `next_page_url`, not the whole URL, to the same tool:

```python theme={null}
from urllib.parse import parse_qs, urlparse

cursor = parse_qs(urlparse(answer["next_page_url"]).query)["cursor"][0]
next_page = call_tool("list_insider_trades", {"cursor": cursor})  # call_tool from the MCP server page
```

A full URL in `cursor` fails with `VALIDATION_ERROR`, because a cursor holds only letters, digits, `-` and `_`.


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