# Darvas > This file is very large and may be truncated. For an index of this content, please refer to https://docs.darvas.app/llms.txt instead. > Darvas financial data API docs: SEC filings, statements, 13F, stock, macro, crypto, DeFi and prediction market data, an MCP server and Pine Script. > ## 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. # AI Agent Integration: llms.txt & MCP Routing Source: https://docs.darvas.app/ai-agents Give coding and finance agents structured access via llms.txt, Markdown pages, docs MCP search and the complete task-to-tool routing directory. These docs are written for people and for the AI agents that work for them. An agent can list every page, read any page as Markdown, search the docs over MCP and call the data API's 164 tools. ## What the site serves to agents | Path | What it holds | | - | - | | [`/llms.txt`](https://docs.darvas.app/llms.txt) | The index: every indexed page with a one-line summary, in the order of the navigation, and how to call the API. The lookup lists of tickers, types and series are left out; the [discovery tables](#discovery-and-catalog-tools) below name them. | | [`/llms-full.txt`](https://docs.darvas.app/llms-full.txt) | Every indexed page in one Markdown file | | Page URL + `.md` | One page as Markdown, with its endpoint's parameters and answer from the OpenAPI spec, such as [`/futures/commitment-of-traders.md`](https://docs.darvas.app/futures/commitment-of-traders.md) | | [`openapi.yaml`](https://docs.darvas.app/openapi.yaml) | The OpenAPI 3.1 spec of every endpoint: parameters, schemas and examples | | [`/skill.md`](https://docs.darvas.app/skill.md) | What an agent can do with Darvas, in the agent skills format | | `/mcp` | An MCP server that searches and reads these docs | The menu in each page's header copies the page as Markdown, opens it in Claude, ChatGPT, Perplexity or Grok, or connects the docs search to Cursor, VS Code, Windsurf or Devin. API pages also download the spec. ## Three MCP servers The docs search server, `https://docs.darvas.app/mcp`, answers questions about the docs: which endpoint gives insider sales, what a field means, how pagination works. It needs no key. The [data API server](/mcp-server), `https://api.darvas.app/mcp`, answers with data: a company's income statements, a fund's holdings, last week's 8-Ks. It needs your API key. Each message counts against your account's [rate limit](/authentication#rate-limits-and-credits) as one request, and a tool call that returns data costs one credit, however many rows it holds. It lists 10 tools by default; `search_data_tools` finds the other 154 by keyword, and `?mode=full` lists all 164. The account server, `https://darvas.app/mcp`, is for apps that connect by sign-in, such as Claude and ChatGPT. It uses your Darvas account through OAuth 2.1 instead of an API key. An agent that writes code against the API uses the docs server. An agent that answers questions with numbers uses the data API server, and the docs server when it needs to know which tool to call. ## Which endpoint answers which question Every read and search endpoint is also a tool on the data API server, so the two tables below name all 164 tools. Pass the endpoint's parameters as arguments. | Question | Endpoint | MCP tool | | - | - | - | | A company's profile, CIK and tickers | [`GET /company/facts`](/companies/profile) | `get_company_facts` | | A company by name, ticker, CIK, CUSIP, ISIN, FIGI or LEI | [`GET /companies/search`](/companies/search) | `search_companies` | | Everything Darvas holds about a US stock, in one call | [`GET /company/dossier`](/companies/dossier) | `get_company_dossier` | | The tickers and CIKs that have a profile or filings | [`GET /company/facts/tickers`](/companies/tickers), [`/company/facts/ciks`](/companies/ciks), [`/filings/tickers`](/sec-edgar/filings-tickers), [`/filings/ciks`](/sec-edgar/filings-ciks) | `list_company_facts_tickers`, `list_company_facts_ciks`, `list_filings_tickers`, `list_filings_ciks` | | A company's filings, newest first | [`GET /filings`](/sec-edgar/filings) | `list_filings` | | The SEC form types to filter filings by | [`GET /filings/types`](/sec-edgar/filing-types) | `list_filing_types` | | The text of a 10-K, 10-Q or 8-K item, such as Item 1A Risk Factors | [`GET /filings/items`](/sec-edgar/filing-items) | `get_filing_items` | | The items of a filing Darvas was still reading, after a `202` | [`GET /filings/items/requests/{request_id}`](/sec-edgar/filing-items-requests) | `get_filing_items_request` | | 8-K events, such as officer changes or acquisitions | [`GET /filings/events`](/sec-edgar/8k-events) | `list_filing_events` | | Every company's newest filings, by form, 8-K item or sector | [`GET /filings/feed`](/sec-edgar/filings-feed) | `list_filings_feed` | | Executive changes, votes, auditor changes, non-reliance and cyber incidents as fields | [`GET /events/8k-structured`](/sec-edgar/8k-structured-events) | `list_structured_eight_k_events` | | Rule 10b5-1 plan adoptions and terminations | [`GET /sec/rule-10b5-1`](/sec-edgar/rule-10b5-1-plans) | `list_trading_arrangements` | | Private offerings and fund raises on Form D | [`GET /filings/form-d`](/sec-edgar/form-d-offerings) | `list_sec_form_d_offerings` | | The crypto public companies hold | [`GET /sec/crypto-treasuries`](/sec-edgar/crypto-treasuries) | `list_crypto_treasuries` | | A company's federal government contracts | [`GET /government/contracts`](/companies/government-contracts) | `list_government_contracts` | | Filing passages that answer a question | [`POST /search`](/sec-edgar/full-text-search) | `search_documents` | | Revenue, earnings and EPS over time | [`GET /financials/income-statements`](/financials/income-statements) | `list_income_statements` | | Assets, debt and equity | [`GET /financials/balance-sheets`](/financials/balance-sheets) | `list_balance_sheets` | | Operating cash flow, capex and free cash flow | [`GET /financials/cash-flow-statements`](/financials/cash-flow-statements) | `list_cash_flow_statements` | | Any XBRL fact a company reports, by concept tag | [`GET /financials/xbrl-facts`](/financials/xbrl-facts) | `list_xbrl_facts` | | Debt due in each of the next five years | [`GET /financials/debt-schedule`](/financials/debt-schedule) | `get_debt_schedule` | | Margins, returns and other ratios | [`GET /financial-metrics`](/financials/metrics) | `list_financial_metrics` | | A company's latest P/E, EV/EBITDA, market cap and other TTM ratios | [`GET /financial-metrics/snapshot`](/financials/metrics-snapshot) | `get_financial_metrics_snapshot` | | Valuation and ratios of 2 to 20 peers, with the group medians | [`GET /financials/peer-comparison`](/financials/peer-comparison) | `compare_financial_peers` | | Every valuation, return, leverage and growth metric per period | [`GET /financial-metrics/extended`](/financials/extended-metrics) | `list_extended_financial_metrics` | | Each metric's formula, unit and inputs | [`GET /financial-metrics/catalog`](/financials/metrics-catalog) | `get_financial_metrics_catalog` | | Altman Z, Piotroski F and Beneish M scores | [`GET /financials/scores`](/financials/quality-scores) | `list_financial_scores` | | A DCF value per share and the growth the price implies | [`GET /valuation/dcf`](/financials/dcf-valuation) | `get_dcf_valuation` | | A stock's P/E or EV/EBITDA on every past day | [`GET /valuation/history`](/financials/valuation-history) | `list_valuation_history` | | Companies that pass fundamental filters | [`POST /financials/search/screener`](/financials/stock-screener) | `screen_companies` | | A few statement fields for many companies | [`POST /financials/search/line-items`](/financials/line-items) | `search_line_items` | | All three statements of the same periods in one call | [`GET /financials`](/financials/all-statements) | `list_financials` | | Statements exactly as the filing presents them, with the company's own labels | [`GET /financials/as-reported`](/financials/as-reported-statements), [`/financials/income-statements/as-reported`](/financials/as-reported-income-statements), [`/financials/balance-sheets/as-reported`](/financials/as-reported-balance-sheets), [`/financials/cash-flow-statements/as-reported`](/financials/as-reported-cash-flow-statements) | `list_as_reported_financials`, `list_income_statements_as_reported`, `list_balance_sheets_as_reported`, `list_cash_flow_statements_as_reported` | | Revenue by product, region or segment | [`GET /financials/segments`](/financials/segments) | `list_segmented_financials` | | One statement's segment values: revenue and operating income, assets, or capital expenditure | [`GET /financials/income-statements/segments`](/financials/segment-income-statements), [`/financials/balance-sheets/segments`](/financials/segment-balance-sheets), [`/financials/cash-flow-statements/segments`](/financials/segment-cash-flow-statements) | `list_income_statement_segments`, `list_balance_sheet_segments`, `list_cash_flow_statement_segments` | | A quarter's results as the earnings release reported them | [`GET /earnings`](/earnings/releases) | `list_earnings` | | Sector KPIs, guidance and non-GAAP figures | [`GET /kpi/metrics`](/earnings/kpis), [`/kpi/guidance`](/earnings/guidance), [`/kpi/non-gaap`](/earnings/non-gaap) | `list_kpi_metrics`, `list_kpi_guidance`, `list_kpi_non_gaap` | | Insider buys and sells | [`GET /insider-trades`](/ownership/insider-trading) | `list_insider_trades` | | Insider trades of every company, screened by type, value and role | [`GET /insider-trades/screener`](/ownership/insider-screener) | `screen_insider_trades` | | Companies where several insiders bought at once | [`GET /insider-trades/clusters`](/ownership/insider-cluster-buys) | `list_insider_clusters` | | Planned insider sales on Form 144 | [`GET /insider-trades/sale-notices`](/ownership/form-144-sale-notices) | `list_sale_notices` | | What insiders hold | [`GET /insider-ownership`](/ownership/insider-holdings) | `list_insider_ownership` | | Owners of more than 5% and activist stakes | [`GET /beneficial-ownership`](/ownership/beneficial-13d-13g), [`/activist-ownership`](/ownership/activist-13d) | `list_beneficial_owners`, `list_activist_owners` | | A manager's 13F portfolio, or the managers that hold a stock | [`GET /institutional-holdings`](/ownership/13f-institutional-holdings) | `list_institutional_holdings` | | Who opened, added, cut or sold a position last quarter | [`GET /institutional-ownership/changes`](/ownership/13f-position-changes) | `list_institutional_changes` | | The stocks 13F managers bought or sold most | [`GET /institutional-ownership/top-bought`](/ownership/13f-most-bought) | `list_institutional_top_bought` | | Everyone who owns a company, in one call | [`GET /ownership/summary`](/ownership/ownership-summary) | `get_ownership_summary` | | The CIK of a 13F filer | [`GET /institutional-holdings/investors`](/ownership/13f-investors) | `list_institutional_investors` | | What an ETF or fund holds, or the funds that hold a stock | [`GET /index-funds`](/ownership/etf-fund-holdings) | `list_index_fund_holdings` | | New IPO filings | [`GET /ipos`](/sec-edgar/ipo-filings) | `list_ipos` | | Company and market news | [`GET /news`](/stocks/financial-news) | `list_news` | | Daily, weekly or monthly stock prices | [`GET /prices`](/stocks/historical-prices) | `list_prices` | | A stock's latest price | [`GET /prices/snapshot`](/stocks/price-snapshot) | `get_price_snapshot` | | Every US stock's latest price in one call | [`GET /prices/snapshot/market`](/stocks/market-snapshot) | `get_market_snapshot` | | A stock's RSI, MACD, moving averages and 52-week range | [`GET /prices/technicals`](/stocks/technical-indicators) | `get_stock_technicals` | | A stock's beta, Sharpe ratio, drawdown and value at risk | [`GET /prices/risk`](/stocks/risk-statistics) | `get_price_risk` | | Dividends and splits | [`GET /dividends`](/stocks/dividends), [`GET /splits`](/stocks/splits) | `list_dividends`, `list_splits` | | Shares that failed to settle | [`GET /fails-to-deliver`](/stocks/fails-to-deliver) | `list_fails_to_deliver` | | Daily short sale volume and short ratio | [`GET /short-volume`](/stocks/short-volume) | `list_short_volume` | | Futures positions by trader group | [`GET /cot`](/futures/commitment-of-traders) | `list_cot` | | COT Index, positioning z-scores and extremes | [`GET /cot/analytics`](/futures/cot-analytics) | `get_cot_analytics` | | Upcoming and past economic releases, with consensus and surprise | [`GET /macro/economic-calendar`](/macro/economic-calendar), [`/macro/economic-calendar/countries`](/macro/economic-calendar-countries) | `list_economic_calendar`, `list_economic_calendar_countries` | | Central bank policy rates | [`GET /macro/interest-rates`](/macro/interest-rates) | `list_interest_rates`, `get_interest_rates_snapshot` | | Treasury yields | [`GET /macro/yield-curve`](/macro/treasury-yield-curve) | `list_yield_curve`, `get_yield_curve_snapshot` | | Yield curve spreads, inversions and the Sahm Rule | [`GET /macro/spreads`](/macro/yield-curve-spreads) | `get_macro_spreads` | | Fed net liquidity, reverse repo, TGA and SOFR | [`GET /macro/liquidity`](/macro/fed-net-liquidity) | `get_macro_liquidity` | | CPI and PCE inflation | [`GET /macro/inflation`](/macro/cpi-pce-inflation) | `list_inflation`, `get_inflation_snapshot` | | Payrolls, unemployment and jobless claims | [`GET /macro/labor`](/macro/labor-market) | `list_labor`, `get_labor_snapshot` | | GDP, profits and income | [`GET /macro/gdp`](/macro/gdp-income) | `list_gdp`, `get_gdp_snapshot` | | GPU rental prices | [`GET /macro/gpu-prices`](/macro/gpu-rental-prices) | `list_gpu_prices`, `get_gpu_prices_snapshot` | | The tokenized stocks Darvas follows, by venue | [`GET /tokenized-stocks`](/tokenized-stocks/markets) | `list_tokenized_stocks` | | Prices of tokenized stocks | [`GET /tokenized-stocks/prices/snapshot`](/tokenized-stocks/snapshot) | `get_tokenized_stock_snapshot` | | Price and trade history of a tokenized stock | [`GET /tokenized-stocks/prices`](/tokenized-stocks/prices), [`/tokenized-stocks/trades`](/tokenized-stocks/trades) | `list_tokenized_stock_prices`, `list_tokenized_stock_trades` | | Crypto candles and latest price (Darvas aggregated or per exchange) | [`GET /crypto/prices`](/crypto/prices), [`/crypto/prices/snapshot`](/crypto/price-snapshot) | `list_crypto_prices`, `get_crypto_price_snapshot` | | Crypto instruments and Darvas aggregated pairs (`ALLUSD` and constituents) | [`GET /crypto/tickers`](/crypto/tickers) | `list_crypto_tickers` | | Crypto raw trades and aggregated order flow | [`GET /crypto/trades`](/crypto/trades), [`/crypto/order-flow`](/crypto/order-flow) | `list_crypto_trades`, `list_crypto_order_flow` | | Crypto price-level footprint bars, cells and delta clusters | [`GET /crypto/footprint`](/crypto/footprint-charts) | `get_crypto_footprint` | | Crypto technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands, ATR) | [`GET /crypto/indicators`](/crypto/technical-indicators) | `get_crypto_indicators` | | Every crypto pair's price, 24-hour change and volume | [`GET /crypto/prices/snapshot/market`](/crypto/market-snapshot) | `get_crypto_market_snapshot` | | A perpetual's 24-hour volume across exchanges | [`GET /crypto/volume/aggregated`](/crypto/aggregated-volume) | `get_crypto_aggregated_volume` | | A brief of one crypto market: price ranges, funding, open interest and macro releases | [`GET /crypto/context`](/crypto/market-context) | `get_crypto_market_context` | | Composite crypto spot index candles and prices | [`GET /crypto/index/prices`](/crypto/index-prices), [`/crypto/index/snapshot`](/crypto/index-snapshot) | `list_crypto_index_prices`, `get_crypto_index_snapshot` | | Hyperliquid perpetuals with funding and open interest | [`GET /crypto/hyperliquid/markets`](/crypto/hyperliquid-markets) | `list_hyperliquid_markets` | | Spot Bitcoin, Ethereum and Solana ETF flows | [`GET /crypto/etf-flows`](/crypto/etf-flows) | `list_crypto_etf_flows` | | The Coinbase premium | [`GET /crypto/coinbase-premium`](/crypto/coinbase-premium) | `get_crypto_coinbase_premium` | | Crypto fear and greed, and altcoin season | [`GET /crypto/sentiment`](/crypto/sentiment-index) | `get_crypto_sentiment` | | A coin's realized volatility, correlation to stocks and seasonality | [`GET /crypto/analytics`](/crypto/volatility-correlation) | `get_crypto_analytics` | | A live crypto order book, merged across exchanges | [`GET /crypto/order-book`](/crypto/order-book) | `get_crypto_order_book` | | Resting bid and ask size over time | [`GET /crypto/order-book/heatmap`](/crypto/order-book-heatmap) | `get_crypto_order_book_heatmap` | | Order book depth, imbalance and slippage per bar | [`GET /crypto/order-book/imbalance-history`](/crypto/order-book-imbalance) | `get_crypto_order_book_imbalance_history` | | Whale trades, and the price zones where they traded | [`GET /crypto/large-trades`](/crypto/large-trades), [`/crypto/large-trades/zones`](/crypto/whale-trade-zones) | `list_crypto_large_trades`, `list_crypto_large_trade_zones` | | Volume profiles by session or for any time range | [`GET /crypto/volume-profile`](/crypto/volume-profile), [`/crypto/volume-profile/fixed-range`](/crypto/fixed-range-volume-profile) | `get_crypto_volume_profile`, `get_crypto_fixed_range_volume_profile` | | TPO market profiles | [`GET /crypto/tpo`](/crypto/tpo-market-profile) | `get_crypto_tpo` | | Smart Money Concepts, order blocks, fair value gaps and swings | [`GET /crypto/market-structure`](/crypto/market-structure) | `get_crypto_market_structure` | | Funding, open interest, basis and long-short ratios over time | [`GET /crypto/derivatives`](/crypto/derivatives) | `list_crypto_derivatives` | | Live funding, open interest and basis of one contract | [`GET /crypto/derivatives/snapshot`](/crypto/derivatives-snapshot) | `get_crypto_derivatives_snapshot` | | Contracts whose open interest changed the most | [`POST /crypto/derivatives/oi-scan`](/crypto/open-interest-scanner) | `scan_crypto_oi_change` | | Funding rate arbitrage across venues | [`GET /crypto/funding-arbitrage`](/crypto/funding-arbitrage) | `scan_crypto_funding_arbitrage` | | A coin's open interest, funding and CVD summed across venues | [`GET /crypto/aggregated-derivatives`](/crypto/aggregated-derivatives) | `get_crypto_aggregated_derivatives` | | Perpetual and futures basis and the term structure | [`GET /crypto/basis`](/crypto/basis) | `get_crypto_basis` | | An options chain with Greeks, and IV skew and term structure | [`GET /crypto/derivatives/option-chain`](/crypto/options-chain), [`/crypto/derivatives/iv-skew`](/crypto/options-iv-skew) | `list_crypto_options_chain`, `get_crypto_options_iv_skew` | | Options max pain, dealer gamma exposure and IV surface | [`GET /crypto/derivatives/options-analytics`](/crypto/options-analytics) | `get_crypto_options_analytics` | | The DVOL index, IV rank and realized volatility cone | [`GET /crypto/derivatives/dvol`](/crypto/dvol-index) | `get_crypto_options_dvol` | | Liquidation fills, and estimated liquidation levels | [`GET /crypto/liquidations`](/crypto/liquidations), [`/crypto/liquidations/heatmap`](/crypto/liquidation-heatmap) | `list_crypto_liquidations`, `get_crypto_liquidation_heatmap` | | Crypto markets that pass technical or derivatives conditions | [`POST /crypto/screener`](/crypto/screener), [`GET /crypto/screener/metrics`](/crypto/screener-metrics) | `screen_crypto_markets`, `list_crypto_screener_metrics` | | DeFi protocols ranked by TVL | [`GET /defi/protocols`](/defi/protocols-tvl) | `list_defi_protocols` | | Stablecoin supply | [`GET /defi/stablecoins`](/defi/stablecoins) | `list_stablecoin_supply` | | DeFi lending, staking and pool yields | [`GET /defi/yields`](/defi/yields) | `list_defi_yields` | | DEX pairs, their liquidity, and trending tokens | [`GET /defi/dex-tokens`](/defi/dex-tokens) | `list_dex_tokens` | | DeFi protocol fees and revenue | [`GET /defi/fees`](/defi/fees-revenue) | `list_defi_fees` | | DEX, aggregator and options volume | [`GET /defi/dex-volumes`](/defi/dex-volumes) | `list_defi_dex_volumes` | | One protocol's TVL by chain and its history | [`GET /defi/protocols/{slug}`](/defi/protocol-profile) | `get_defi_protocol` | | Prediction market odds on Polymarket, Kalshi and OKX | [`GET /prediction-markets`](/prediction-markets/markets) | `list_prediction_markets` | | Prediction market series and categories | [`GET /prediction-markets/series`](/prediction-markets/series) | `list_prediction_market_series` | | The same question priced apart on Polymarket and Kalshi | [`GET /prediction-markets/arbitrage`](/prediction-markets/arbitrage) | `scan_prediction_market_arbitrage` | | One prediction market's rules, prices and history | [`GET /prediction-markets/markets/{id}`](/prediction-markets/market-detail) | `get_prediction_market` | | A prediction market's live order book | [`GET /prediction-markets/orderbook`](/prediction-markets/order-book) | `get_prediction_market_order_book` | | Market-implied FOMC, CPI, payrolls and recession odds | [`GET /prediction-markets/macro-odds`](/prediction-markets/macro-odds) | `list_prediction_macro_odds` | ### Discovery and catalog tools These lists tell an agent which tickers, types and series a dataset takes before it asks for data. Each costs at most 1 credit per call, and 0 when the list is empty. The [catalog resources](/mcp-server#catalog-resources) hold the series tables for 0 credits. | What it lists | Endpoint | MCP tool | | - | - | - | | Tickers with earnings releases | [`GET /earnings/tickers`](/earnings/tickers) | `list_earnings_tickers` | | Tickers and sectors with operating KPIs | [`GET /kpi/metrics/tickers`](/earnings/kpi-tickers), [`/kpi/metrics/sectors`](/earnings/kpi-sectors) | `list_kpi_tickers`, `list_kpi_sectors` | | The items a 10-K, 10-Q or 8-K can have | [`GET /filings/items/types`](/sec-edgar/filing-item-types) | `list_filing_item_types` | | The 8-K event types and their items | [`GET /filings/events/types`](/sec-edgar/8k-event-types) | `list_filing_event_types` | | Companies with standardized statements | [`GET /financials/income-statements/tickers`](/financials/tickers) | `list_statement_tickers` | | Tickers with a financial metrics snapshot | [`GET /financial-metrics/snapshot/tickers`](/financials/metrics-tickers) | `list_financial_metrics_tickers` | | The fields the stock screener filters on | [`GET /financials/search/screener/filters`](/financials/screener-filters) | `list_screener_filters` | | Tickers held in 13F reports, and fund share class tickers | [`GET /institutional-holdings/tickers`](/ownership/13f-tickers), [`/index-funds/tickers`](/ownership/fund-tickers) | `list_institutional_tickers`, `list_index_fund_tickers` | | Stocks with price history, and stocks with a snapshot | [`GET /prices/tickers`](/stocks/tickers), [`/prices/snapshot/tickers`](/stocks/snapshot-tickers) | `list_price_tickers`, `list_price_snapshot_tickers` | | Commitments of Traders markets | [`GET /cot/markets`](/futures/cot-markets) | `list_cot_markets` | | Central banks with a policy rate | [`GET /macro/interest-rates/banks`](/macro/central-banks) | `list_interest_rates_series` | | Inflation, labor, GDP and GPU rental series | [`GET /macro/inflation/series`](/macro/inflation-series), [`/macro/labor/series`](/macro/labor-market-series), [`/macro/gdp/series`](/macro/gdp-series), [`/macro/gpu-prices/series`](/macro/gpu-prices-series) | `list_inflation_series`, `list_labor_series`, `list_gdp_series`, `list_gpu_price_series` | When an agent does not know a tool's name, `search_data_tools` on the [MCP server](/mcp-server#tool-lists) finds it by keyword or domain. [Market coverage](/market-coverage) gives the history and update time of each dataset. ## How an agent uses the docs 1. Read `/llms.txt` to find the page of what it needs. Endpoint pages are grouped by dataset: financial statements, filings, insider trades, institutional holdings, prices, macro and the rest. 2. Read that page's `.md`. It names the endpoint, every parameter with its type and limits, and an example answer. 3. Call `https://api.darvas.app/v1` with the key in `X-API-KEY`. Companies go by `ticker` or `cik`, and dates are `YYYY-MM-DD`. 4. Follow `next_page_url` until the answer has none. See [Pagination](/pagination). 5. On `429`, wait the seconds in `Retry-After`. Other errors carry a stable `error` code, listed in [Errors](/authentication#errors). ## Add the docs to your agent Install the skill, so the agent knows what Darvas offers before it reads a page: ```bash theme={null} npx skills add https://docs.darvas.app ``` Connect the docs search to Claude Code: ```bash theme={null} claude mcp add --transport http darvas-docs https://docs.darvas.app/mcp ``` Connect the docs search to Codex in `~/.codex/config.toml`: ```toml theme={null} [mcp_servers.darvas-docs] url = "https://docs.darvas.app/mcp" ``` Connect the data API, with your key. [MCP server](/mcp-server) has the same setup for Codex, Cursor, VS Code, Windsurf and Devin. ```bash theme={null} claude mcp add --transport http darvas https://api.darvas.app/mcp --header "X-API-KEY: $DARVAS_API_KEY" ``` Or give the agent the index and let it read on: ```text theme={null} Read https://docs.darvas.app/llms.txt, then the pages you need, and use the Darvas data API with the key in DARVAS_API_KEY. ``` # API Keys, Credits, Rate Limits & Error Codes Source: https://docs.darvas.app/authentication Authenticate with X-API-KEY or Bearer token, compare unified Darvas Pro, Max and Ultra call quotas, concurrency limits, Retry-After and error codes. ## API keys Send the key in the `X-API-KEY` header, or as a Bearer token: ```bash theme={null} curl "https://api.darvas.app/v1/filings?ticker=AAPL" -H "X-API-KEY: dvk_..." curl "https://api.darvas.app/v1/filings?ticker=AAPL" -H "Authorization: Bearer dvk_..." ``` The earlier base URL, `https://darvas.app/api/data/v1`, still answers every request with the same key, and its `next_page_url` links stay on that host. Create keys in Darvas under **Settings → Data API**. Live key limits follow your plan (`3` on Darvas Pro, `10` on Max, and `25` on Ultra); each key's secret is shown once, when it is made. Rename or revoke a key on the same page, and a revoked key stops working at once. Keep keys on servers. A key in browser code or a public repository can be read by anyone: revoke it and create a new one. A key Darvas issued to you by email keeps the limits agreed with it, and [support@darvas.app](mailto:support@darvas.app) revokes it. ## Plans and credits Darvas uses one unified 4-plan ladder covering the workspace, automation, webhooks, and the Data API (there is no separate Data API subscription). Every key you create shares your account's plan and monthly call quota. Pricing is strictly call-based: **1 credit = 1 successful call** (up to `1,000` rows per page, with no endpoint multipliers). Empty responses, `4xx` refusals, `5xx` errors, FINRA [`/short-volume`](/stocks/short-volume), MCP metadata (`tools/list`, `search_data_tools`, resources, prompts), and own-account MCP at `https://darvas.app/mcp` cost **0 credits**. | Plan | Price | Data API & MCP calls/mo | RPM | Concurrent | Live keys | Webhooks | Account MCP (`0` credits) | | - | - | - | - | - | - | - | - | | Darvas Free | `$0` | `0` | `0` | `0` | `0` | `0` | `15` RPM | | Darvas Pro | `$20/mo` or `$200/yr` (or Free via OKX affiliate) | `250,000` | `1,200` | `4` | `3` | `5` | `60` RPM | | Darvas Max | `$100/mo` or `$1,000/yr` | `2,000,000` | `3,600` | `10` | `10` | `25` | `180` RPM | | Darvas Ultra | `$200/mo` or `$2,000/yr` | `5,000,000` | `6,000` | `20` | `25` | `100` | `360` RPM (internal commercial rights) | **OKX affiliate full Pro parity:** Any OKX account opened or transferred through Darvas that generates any positive trading commission (`> $0`) in the trailing 180 days keeps 100% full Darvas Pro parity for free, including all `250,000` monthly Data API calls, `1,200` RPM, `4` concurrent requests, `3` keys, `5` webhooks, `50` never-expiring alerts, and `5` scheduled AI briefings. A KYC2 invitee with a new OKX account, or one claiming Pro through OKX for the first time, starts with Pro right away (Data API unlocks after a qualifying trade). Accounts inactive for 180 days automatically downgrade to Free and automatically restore full Pro parity when trading resumes. **Monthly resets and top-ups:** Monthly plan credits reset at `00:00 UTC` on the first day of each calendar month. Optional non-expiring top-up packs cost **`$10` per `100,000` calls** and spend automatically once your monthly plan allowance runs out. Apify Store Actors keep their own per-record pricing. ## Rate limits, concurrency and headers Every answer carries the account's per-minute limit in `X-RateLimit-Limit`. The per-minute limit and concurrent request limit cover all keys of an account, and each Data MCP message counts as one request. * Exceeding your per-minute rate limit answers HTTP `429` with `RATE_LIMITED` and `Retry-After` (seconds to wait). * Exceeding your in-flight concurrency limit (`4` on Pro, `10` on Max, `20` on Ultra) answers HTTP `429` with `CONCURRENCY_LIMIT` and `Retry-After: 1`. * Temporary platform-wide concurrency pressure answers HTTP `503` with `BUSY` and `Retry-After: 1`. Answers to API keys also carry quota headers: | Header | Meaning | | - | - | | `X-Quota-Unit` | Always `credits`. | | `X-Credits-Used` | The credits this answer cost: `1` for a successful non-empty call, `0` for an empty answer, an error, or FINRA `/short-volume`. | | `X-Quota-Limit` | Your monthly plan call allowance plus your non-expiring top-up credit balance when the request came in. | | `X-Quota-Remaining` | The credits left after this answer. | | `X-Quota-Reset` | When the monthly plan credits reset (first day of the next calendar month at `00:00 UTC`), in Unix seconds. | Once both your monthly allowance and top-up balance reach `0`, further billable calls answer HTTP `429` with `QUOTA_EXCEEDED` until the monthly reset or a top-up pack is added. ## Errors Errors are JSON with a stable `error` code and an English `message`. | Status | `error` | Meaning | | - | - | - | | 400 | `VALIDATION_ERROR` | A parameter is missing or malformed. The message names it. | | 400 | `FILING_COMPANY_MISMATCH` | The accession number belongs to another company. The message names the `ticker` or `cik` to retry with. | | 400 | `FILING_TYPE_MISMATCH` | The accession number is a different form from `filing_type`. The message names the form to retry with. | | 400 | `LIMIT_REACHED` | Every webhook destination or API key the plan allows is active. Delete or revoke one first. | | 401 | `UNAUTHORIZED` | The key is missing, unknown or revoked. | | 403 | `PLAN_REQUIRED` | The account is on Darvas Free (or an OKX KYC2 grace period awaiting a first qualifying trade) and has no active Data API plan. | | 404 | `NOT_FOUND` | No company has this ticker or CIK, or the filing or record does not exist. The message says which. | | 404 | `ITEMS_NOT_FOUND` | A requested item is not in the filing. The message lists the items the filing has. | | 429 | `RATE_LIMITED` | Too many requests this minute. Retry after `Retry-After`. | | 429 | `CONCURRENCY_LIMIT` | Too many in-flight requests for your plan's concurrency cap (`4` Pro, `10` Max, `20` Ultra). Retry after `Retry-After` (`1` second). | | 429 | `QUOTA_EXCEEDED` | Your monthly plan credits and top-up balance are used up. | | 500 | `INTERNAL_ERROR` | Darvas failed. The error is reported to the team. | | 503 | `BUSY` | Temporary upstream concurrency saturation. Retry after `Retry-After` (`1` second). | | 503 | `UNAVAILABLE` | The data store is down. Retry later. | ```json theme={null} { "error": "NOT_FOUND", "message": "No company has this ticker or CIK" } ``` # Company Dossier API: All-in-One Equity Brief Source: https://docs.darvas.app/companies/dossier openapi.yaml GET /company/dossier Fetch a US stock's SEC profile, latest price, technicals, TTM valuation, earnings, Form 4 trades, 13F holders and 8-K events in one API request by ticker. ## Overview This endpoint returns what Darvas holds about one US stock in a single `dossier` object: the SEC company profile, the latest share price, daily technical indicators, trailing twelve month (TTM) valuation and ratios, and the newest earnings, insider trades, 13F positions and 8-K events. Darvas reads the eight sections in parallel, so a research script or an AI agent gets a full first look at a company in one request instead of eight. | Coverage | Details | | - | - | | Companies | US stocks with an SEC profile, stored prices or stored financial metrics | | Identifier | `ticker`, in any case; a request without it returns `400` | | Sections | `profile`, `price`, `technicals`, `valuation`, `latest_earnings`, `recent_insider_trades`, `top_institutions`, `recent_events` | | Missing data | A section without data is `null` (objects) or `[]` (lists); `404` only when `profile`, `price`, `technicals` and `valuation` are all empty | | MCP tool | `get_company_dossier` on the [data API MCP server](/mcp-server) | ## Sections Each section carries the same fields as the endpoint it comes from, so code written for that endpoint reads the section unchanged. | Section | Contents | Full endpoint | | - | - | - | | `profile` | Name, CIK, SIC industry, exchange, fiscal year end and ticker history | [Company Facts](/companies/profile) | | `price` | Latest `price`, `day_change`, `day_change_percent` and trade `time` | [Stock Price Snapshot](/stocks/price-snapshot) | | `technicals` | Daily SMA 20/50/200, EMA 12/26, RSI-14, MACD, Bollinger Bands, ATR-14, 52-week range and returns | [Stock Technical Indicators](/stocks/technical-indicators) | | `valuation` | Newest TTM snapshot: market cap, P/E, EV/EBITDA, margins, returns on capital, growth and leverage | [Financial Metrics Snapshot](/financials/metrics-snapshot) | | `latest_earnings` | Up to 3 newest earnings filings, 8-K releases and 10-Q or 10-K reports | [Earnings](/earnings/releases) | | `recent_insider_trades` | Up to 5 newest Form 4 and Form 5 transactions | [Insider Trades](/ownership/insider-trading) | | `top_institutions` | Up to 5 largest positions by value from managers' newest Form 13F reports | [13F Institutional Holdings](/ownership/13f-institutional-holdings) | | `recent_events` | Up to 5 newest 8-K filings with their event types and item numbers | [8-K Events](/sec-edgar/8k-events) | ## When to use it Start with the dossier when a question names one company and you do not yet know which dataset answers it, such as "how does NVDA look right now?". Then call the full endpoint of a section for more rows: the dossier caps earnings at 3 and the insider, 13F and 8-K lists at 5, and its technicals are always daily. To compare several companies, use [Peer Comparison](/financials/peer-comparison); for the filing list itself, use [SEC Filings](/sec-edgar/filings). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/company/dossier", headers=headers, params={"ticker": "NVDA"}, ) answer.raise_for_status() dossier = answer.json()["dossier"] profile = dossier["profile"] or {} price = dossier["price"] or {} technicals = dossier["technicals"] or {} valuation = dossier["valuation"] or {} print(profile.get("name"), profile.get("sic_industry")) print("Price:", price.get("price"), "Day change %:", price.get("day_change_percent")) print("RSI-14:", technicals.get("rsi_14"), "SMA 200:", technicals.get("sma_200")) print("P/E:", valuation.get("price_to_earnings_ratio"), "Net margin:", valuation.get("net_margin")) for trade in dossier["recent_insider_trades"]: print(trade["transaction_date"], trade["name"], trade["transaction_type"], trade["transaction_shares"]) for event in dossier["recent_events"]: print(event["filing_date"], event["form_type"], event["events"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/company/dossier?ticker=AAPL" ``` # Federal Government Contracts API by Ticker Source: https://docs.darvas.app/companies/government-contracts openapi.yaml GET /government/contracts List a public company's US federal prime contract awards by ticker, largest first, with agency, amount, outlays, period of performance and industry codes. ## Overview This endpoint lists the US federal prime contract awards of a public company, largest first. The company's SEC name without its legal suffix finds the federal recipients of the same name, and their unique entity identifiers find the awards, those of subsidiaries filed under a parent included. `recipient` searches another name, such as RAYTHEON for RTX. Each award carries its agency and sub-agency, amount and outlays, period of performance, NAICS and product codes, and a link to its public award page. Awards with actions in the last 365 days by default; `start_date` reaches back to October 2007. | Coverage | Details | | - | - | | Coverage | US federal prime contract awards since fiscal 2008 | | Matching | `recipient_match` names the method, the search text and the recipients found | | Pages | Up to 100 awards a page with `next_page_url` | | MCP tool | `list_government_contracts` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/government/contracts", headers=headers, params={ "ticker": "LMT", "limit": 25, }, ).json() for award in answer["contracts"]: print(award["awarding_agency"], award["award_amount_usd"], award["start_date"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/government/contracts?ticker=LMT&limit=25" ``` # Company Profile & SEC Entity Facts API Source: https://docs.darvas.app/companies/profile openapi.yaml GET /company/facts Look up a company's SEC profile by ticker or CIK across about 994,000 filers: name, SIC industry, exchange, location and every ticker it traded under. ## Overview The profile SEC holds for a company, built from its submissions record. Query by `ticker` or `cik`; when both are sent, `cik` takes precedence. | Coverage | Details | | - | - | | Companies | Every SEC filer, about 994,000, delisted ones included | | Tickers | The current SEC list, plus tickers seen on Forms 3, 4 and 5 since 2006 | | Updated | Within about a minute of the company's next filing | | MCP tool | `get_company_facts` on the [data API MCP server](/mcp-server) | Delisted and acquired companies remain queryable by their CIK or historical ticker, which lets backtests resolve identifiers without survivorship bias. ## Parameters Send either `ticker` or `cik` to identify the issuer. | Parameter | Type | Description | | - | - | - | | `ticker` | string | Stock ticker symbol, case-insensitive. Share classes accept a dot or a dash, such as `BRK.B` or `BRK-B`. | | `cik` | string | SEC Central Index Key, with or without leading zeros. Takes precedence when both `ticker` and `cik` are provided. | ## Response fields The endpoint returns a `company_facts` object containing the current profile and ticker history. | Field | Description | | - | - | | `ticker`, `name`, `cik` | Resolved ticker, legal name SEC holds, and ten-digit zero-padded CIK. | | `exchange`, `is_active` | Exchange of the chosen ticker, and whether SEC listed one of the company's tickers in the last seven days. | | `industry`, `sic_code`, `sic_industry`, `sic_sector` | Industry name, four-digit SIC code, SEC description of the code, and SIC division. | | `sector`, `entity_type`, `category` | SEC review office, entity type, and filer status such as large accelerated filer. | | `fiscal_year_end`, `state_of_incorporation`, `ein`, `lei` | Fiscal year end in `MMDD` format, incorporation jurisdiction, Employer Identification Number, and Legal Entity Identifier. | | `location`, `addresses`, `phone`, `website_url`, `investor_website_url` | Business location, mailing and business addresses, phone number, and company URLs reported to SEC. | | `former_names`, `tickers` | Earlier legal names with date ranges, and every ticker observed for the company with `first_seen` and `last_seen` dates. | | `sec_filings_url`, `profile_updated_at` | Link to the issuer's EDGAR page and the UTC timestamp when Darvas first saw this version of the profile. | ## Examples Look up an active issuer by ticker or a delisted company by CIK. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/company/facts" apple = requests.get(url, headers=headers, params={"ticker": "AAPL"}).json()["company_facts"] print(apple["name"], apple["sic_industry"], apple["fiscal_year_end"]) # A CIK finds companies that no longer trade. lehman = requests.get(url, headers=headers, params={"cik": "806085"}).json()["company_facts"] print(lehman["name"], lehman["is_active"], [t["ticker"] for t in lehman["tickers"]]) ``` # Company Search API: Name, CUSIP, ISIN, FIGI Source: https://docs.darvas.app/companies/search openapi.yaml GET /companies/search Find companies by current or former name, ticker, CIK, CUSIP, ISIN, FIGI or LEI, with their tickers, securities and identifiers, best match first. ## Overview This endpoint finds companies by name or by one identifier. Send exactly one of `q` (a current or former name, or an exact ticker), `ticker`, `cik`, `cusip`, `isin`, `figi` or `lei`. US companies come with their CIK, tickers, SIC industry and securities with CUSIP, ISIN and FIGI identifiers; UK and French companies come with their LEI and ISINs. `match_score` is 1 for an identifier or ticker and lower for name matches, and results come best match first. | Coverage | Details | | - | - | | Companies | Every SEC filer, and UK and French issuers that file ESEF annual reports | | Identifiers | Ticker, CIK, CUSIP (8 or 9 characters), ISIN, FIGI and LEI | | Results | Up to 50, 10 by default | | MCP tool | `search_companies` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/companies/search", headers=headers, params={ "q": "nvidia", }, ).json() for company in answer["results"]: print(company["name"], company["ticker"], company["cik"], company["match_type"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/companies/search?q=nvidia" ``` # Aggregated Open Interest, Funding & CVD API Source: https://docs.darvas.app/crypto/aggregated-derivatives openapi.yaml GET /crypto/aggregated-derivatives Read one coin's open interest summed across OKX, Binance, Bybit and Hyperliquid, OI- and volume-weighted funding, and spot versus perpetual taker CVD. ## Overview This endpoint gives one coin's perpetuals across OKX, Binance, Bybit and Hyperliquid in one answer. Open interest is summed in dollars with each venue's and each contract's share. Funding is weighted by open interest, by 24-hour volume and as a simple mean, each on an 8-hour basis. `taker_flow` sums aggressor buy and sell volume from every recorded trade, split into spot and perpetuals, with a cumulative volume delta for each side and `divergence` saying whether spot and perpetual takers lean the same way. | Coverage | Details | | - | - | | Venues | `okx`, `binance`, `bybit` and `hyperliquid` perpetuals | | Taker flow | 15m, 1H, 4H or 1D bars over `lookback_hours`; 24 hours by default | | Divergence | `aligned_buying`, `aligned_selling`, `spot_buying_perp_selling`, `spot_selling_perp_buying` or `flat_or_mixed` | | MCP tool | `get_crypto_aggregated_derivatives` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/aggregated-derivatives", headers=headers, params={ "asset": "ETH", "interval": "1H", "lookback_hours": 48, }, ).json() print(answer["open_interest"]["total_usd"], answer["funding"]["oi_weighted"]["annualized_apr_pct"]) print(answer["taker_flow"]["divergence"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/aggregated-derivatives?asset=ETH&interval=1H&lookback_hours=48" ``` # Aggregated Multi-Exchange Crypto Volume API Source: https://docs.darvas.app/crypto/aggregated-volume openapi.yaml GET /crypto/volume/aggregated Sum rolling 24-hour crypto perpetual USD notional and base trading volume across OKX, Binance, Bybit and Hyperliquid with per-venue market shares. ## Overview This endpoint sums rolling 24-hour traded volume for a crypto perpetual contract across OKX, Binance, Bybit, and Hyperliquid in both US dollars (`notional_volume_usd_24h`) and base asset units (`base_volume_24h`). The `exchanges` array reports each venue's symbol, availability status, dollar and base turnover, and percentage share of total dollar volume. | Coverage | Details | | - | - | | Venues summed | `okx`, `binance`, `bybit` and `hyperliquid` perpetual swap contracts | | Ticker format | Canonical `BASE-QUOTE-SWAP` in any case (default `BTC-USDT-SWAP`); non-swap formats return `400` | | Totals | `notional_volume_usd_24h` and `base_volume_24h` sum only exchanges with `status: "ok"` | | Freshness | Live exchange tickers cached for 30 seconds per perpetual contract | | MCP tool | `get_crypto_aggregated_volume` on the [data API MCP server](/mcp-server) | ## Venue statuses and completeness Darvas maps the requested `BASE-QUOTE-SWAP` ticker to each venue's native contract symbol (`BTC-USDT-SWAP` on OKX, `BTCUSDT` on Binance and Bybit, and base coin `BTC` on Hyperliquid) and queries all four venues in parallel. * **Per-exchange status.** Each item in `exchanges` reports `status` as `"ok"`, `"not_found"` (the venue does not list the perpetual), or `"unavailable"` (the venue did not respond in time). Volume and `share_percent` fields are `null` unless `status` is `"ok"`. * **Completeness flag.** `complete` is `true` when zero venues returned `"unavailable"`, even if one venue does not list the contract (`"not_found"`). When `complete` is `false`, totals and `share_percent` reflect only the venues that answered. * **Error responses.** If no exchange lists the contract, the endpoint returns `404`. If no venue returned `"ok"` and at least one venue was `"unavailable"`, it returns `503`. * **Related endpoints.** For live funding and open interest per venue, see [`/crypto/derivatives/snapshot`](/crypto/derivatives-snapshot) and [`/crypto/context`](/crypto/market-context). For market-wide pair rankings by 24-hour volume, see [`/crypto/prices/snapshot/market`](/crypto/market-snapshot). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/volume/aggregated", headers=headers, params={"ticker": "ETH-USDT-SWAP"}, ).json() print(resp["ticker"], "24h USD:", round(resp["notional_volume_usd_24h"], 2), "complete:", resp["complete"]) for venue in resp["exchanges"]: print(" ", venue["exchange"], venue["status"], "share %:", venue["share_percent"], "USD:", venue["notional_volume_usd_24h"]) ``` ```bash theme={null} # Default BTC-USDT-SWAP 24-hour perpetual volume breakdown across all four exchanges curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/volume/aggregated" ``` # Crypto Basis & Futures Term Structure API Source: https://docs.darvas.app/crypto/basis openapi.yaml GET /crypto/basis Read a coin's perpetual and dated futures basis on every venue, annualized, with the term structure, a constant-maturity basis and a spot spread matrix. ## Overview This endpoint reads one coin's basis on every venue. Each perpetual's mark price is measured against its index and annualized by its funding interval. Each dated future's basis is annualized to expiry, listed nearest expiry first as the term structure, and interpolated into a constant-maturity basis at `tenor_days`. With `include_spot`, the answer adds the spot price of the coin on every exchange Darvas stores, turned into dollars at the venues' USDT and USDC rates, with a spread matrix between every two venues and how far apart they are. | Coverage | Details | | - | - | | Venues | `okx`, `binance`, `bybit` and `hyperliquid`; futures where the venue lists them | | Tenor | 7 to 365 days; 90 by default | | Units | `_bps` basis points, `_pct` percent, annualized fields are simple annual rates | | MCP tool | `get_crypto_basis` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/basis", headers=headers, params={ "asset": "BTC", "tenor_days": 90, }, ).json() for perp in answer["perpetuals"]: print(perp["venue"], perp["basis_bps"], perp["basis_annualized_pct"]) print(answer["futures"]["constant_maturity"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/basis?asset=BTC&tenor_days=90" ``` # Coinbase Premium Index API Source: https://docs.darvas.app/crypto/coinbase-premium openapi.yaml GET /crypto/coinbase-premium Track the Coinbase premium: Coinbase's USD price of a coin against Binance's USDT price in dollars, bar by bar, with adjusted and raw gaps and a z-score. ## Overview This endpoint measures how far Coinbase's USD price of a coin is above or below Binance's USDT price turned into dollars, bar by bar, oldest first. Binance's price becomes dollars at Coinbase's USDT-USD close of the same bar, so a USDT trading below a dollar does not read as a premium; each bar also carries the raw gap without that conversion. `summary` gives the mean, deviation, range and share of positive bars over the series, and where the newest bar stands as a z-score. | Coverage | Details | | - | - | | Coins | Any coin with a Coinbase USD and a Binance USDT spot pair, BTC by default | | Bars | minute, hour, day, week or month; 168 hourly bars by default, up to 2,000 | | Units | `premium_pct` in percent, gaps in US dollars | | MCP tool | `get_crypto_coinbase_premium` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/coinbase-premium", headers=headers, params={ "asset": "BTC", "interval": "hour", "limit": 168, }, ).json() print(answer["latest"]["premium_pct"], answer["summary"]["latest_zscore"]) for bar in answer["series"][-5:]: print(bar["time"], bar["premium_pct"], bar["adjusted_gap_usd"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/coinbase-premium?asset=BTC&interval=hour&limit=168" ``` # Crypto Funding Rate, Open Interest & Basis API Source: https://docs.darvas.app/crypto/derivatives openapi.yaml GET /crypto/derivatives Query historical crypto perpetual funding rates, open interest, basis, long-short ratios and taker volume across OKX, Binance, Bybit and Hyperliquid. ## Overview This endpoint returns perpetual and futures positioning time series across OKX, Binance USD-M, Bybit linear, and Hyperliquid perpetuals: funding rate history, open interest, stored contract open interest snapshots (`oi-snapshots`), futures-spot basis (`basis`), global long and short account ratios, top-trader positioning, and taker buy and sell volume. Observations return in `points`, newest first. | Coverage | Details | | - | - | | Exchanges | `okx` (default), `binance` (USD-M perpetuals), `bybit` (linear perpetuals), and `hyperliquid` (perpetuals) | | Metrics | `funding-history` (default), `oi-volume`, `long-short`, `top-trader`, `taker-volume`, `basis`, and `oi-snapshots` | | Default ticker | `BTC-USDT-SWAP` on OKX, `perpetual:BTCUSDT` on Binance and Bybit, `BTC-USDC-SWAP` on Hyperliquid | | Periods | `5m`, `15m`, `30m`, `1H` (default), `4H`, and `1D` | | Window and limit | `lookback_hours` from `1` to `720` (default `72`); `limit` from `1` to `500` (default `100`) | | MCP tool | `list_crypto_derivatives` on the [data API MCP server](/mcp-server) | ## Metric support and point fields Not every venue publishes every positioning series. Requesting an unsupported exchange and metric pair returns `400`. Every observation carries an ISO 8601 UTC `time` field alongside its metric fields. | `metric` | `okx` fields | `binance` fields | `bybit` fields | `hyperliquid` fields | | - | - | - | - | - | | `funding-history` | `instId`, `fundingRate`, `realizedRate`, `fundingTime` | `ts`, `funding_rate` | `ts`, `funding_rate` | `ts`, `funding_rate`, optional `premium` | | `oi-volume` | `ts`, `oi`, `vol` | `ts`, `open_interest`, `open_interest_usd` | `ts`, `open_interest` | Returns `400` | | `long-short` | `ts`, `longRatio`, `shortRatio`, `ratio` | `ts`, `long_short_ratio`, `long_share`, `short_share` | `ts`, `long_share`, `short_share` | Returns `400` | | `top-trader` | `ts`, `longRatio`, `shortRatio`, `ratio` | `ts`, `long_short_ratio`, `long_share`, `short_share` | Returns `400` | Returns `400` | | `taker-volume` | `ts`, `buyVol`, `sellVol` | `ts`, `buy_sell_ratio`, `buy_volume`, `sell_volume` | Returns `400` | Returns `400` | | `basis` | `ts`, `futures_price`, `index_price`, `basis`, `basis_bps` | Returns `400` | Returns `400` | Returns `400` | | `oi-snapshots` | `ts`, `open_interest_contracts`, `open_interest_base`, `open_interest_usd` | Returns `400` | Returns `400` | Returns `400` | * **Ticker formats.** Pass OKX contract IDs such as `BTC-USDT-SWAP` or `ETH-USDT-SWAP`. On Binance and Bybit, pass `perpetual:BTCUSDT`, bare `BTCUSDT`, or `BTC-USDT` (answers normalize to `perpetual:`, and spot tickers return `400`). On Hyperliquid, pass `BTC-USDC-SWAP`, bare `BTC`, or `kPEPE-USDC-SWAP` (answers normalize to `-USDC-SWAP`). * **Basis and stored OI snapshots.** On OKX, `metric=basis` returns historical contract versus index spread (`basis = futures_price - index_price`) and `basis_bps` (basis points relative to `index_price`, rounded to four decimal places). `metric=oi-snapshots` reads Darvas's stored per-contract open interest snapshots in contracts, base units, and USD over `lookback_hours`. * **Venue history and caps.** OKX positioning series roll up from 5-minute stored observations. Binance futures statistics keep 30 days of history. Bybit `oi-volume` and `funding-history` return at most 200 observations per call even when `limit` is higher. Hyperliquid returns hourly settled `funding-history` points. * **Related endpoints.** For a single-call live snapshot of current and predicted funding, settlement countdown, live open interest, mark price, index price, and basis across all four venues, see [`/crypto/derivatives/snapshot`](/crypto/derivatives-snapshot). For the full live Hyperliquid perpetual directory, see [`/crypto/hyperliquid/markets`](/crypto/hyperliquid-markets). For forced liquidations, see [`/crypto/liquidations`](/crypto/liquidations). For taker order flow and candles, see [`/crypto/order-flow`](/crypto/order-flow), [`/crypto/prices`](/crypto/prices), and [`/crypto/tickers`](/crypto/tickers). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/derivatives", headers=headers, params={ "exchange": "okx", "ticker": "BTC-USDT-SWAP", "metric": "basis", "period": "1H", "lookback_hours": 48, "limit": 24, }, ).json() print(resp["exchange"], resp["ticker"], resp["metric"]) for point in resp["points"][:5]: print(point["time"], "futures:", point["futures_price"], "index:", point["index_price"], "basis bps:", point["basis_bps"]) ``` ```bash theme={null} # Hyperliquid hourly BTC perpetual funding history over the last 72 hours curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/derivatives?exchange=hyperliquid&ticker=BTC-USDC-SWAP&metric=funding-history&lookback_hours=72&limit=72" ``` # Live Crypto Funding Rate & Open Interest API Source: https://docs.darvas.app/crypto/derivatives-snapshot openapi.yaml GET /crypto/derivatives/snapshot Read real-time perpetual funding rates, next funding countdown, open interest, mark price, spot index and basis across OKX, Binance, Bybit & HL. ## Overview This endpoint returns a live derivatives snapshot for one perpetual swap or dated futures contract across OKX, Binance USD-M, Bybit linear, and Hyperliquid. A single `snapshot` object carries current and predicted funding rates, funding settlement interval and countdown seconds, live open interest in contracts, base units, and USD, plus mark price, underlying spot or oracle index price, and mark-index basis. | Coverage | Details | | - | - | | Exchanges | `okx` (default), `binance`, `bybit` and `hyperliquid` | | Default ticker | `BTC-USDT-SWAP` on OKX, `perpetual:BTCUSDT` on Binance and Bybit, `BTC-USDC-SWAP` on Hyperliquid | | Market types | Perpetual swaps (`swap`) on all four venues, plus dated futures (`futures`) on OKX | | Basis math | `basis = mark_price - index_price` (6 decimals); `basis_bps = (basis / index_price) * 10000` (4 decimals) | | MCP tool | `get_crypto_derivatives_snapshot` on the [data API MCP server](/mcp-server) | ## Venue field availability and ticker formats Each exchange publishes slightly different live derivatives fields. Unavailable fields return `null` rather than failing the snapshot when other live fields succeed. | Exchange | Ticker format | `next_funding_rate` | `funding_interval_hours` | `open_interest_contracts` | `index_price` source | | - | - | - | - | - | - | | `okx` | `BTC-USDT-SWAP` or futures ID | Published for swaps | Derived from consecutive settlement times | Native contract count | Composite spot index | | `binance` | `perpetual:BTCUSDT`, `BTCUSDT` or `BTC-USDT` | `null` | Contract interval (default `8`) | `null` | Binance spot index price | | `bybit` | `perpetual:BTCUSDT`, `BTCUSDT` or `BTC-USDT` | `null` | Venue `fundingIntervalHour` | `null` | Bybit spot index price | | `hyperliquid` | `BTC-USDC-SWAP`, `BTC`, or `kPEPE-USDC-SWAP` | Predicted funding (30s cache) | `1` (hourly settlement) | `null` | Hyperliquid oracle price | * **OKX dated futures.** Dated OKX futures contracts (such as quarterly expiry contracts) carry no funding cycle, so `funding_rate`, `next_funding_rate`, `funding_interval_hours`, `next_funding_time`, and `funding_countdown_seconds` are `null`, while open interest, `mark_price`, `index_price`, `basis`, and `basis_bps` remain populated. Spot tickers return `400`. * **Countdown and timestamps.** `funding_countdown_seconds` equals non-negative seconds from `observed_at` until `next_funding_time`. Both timestamps also include `_milliseconds` Unix fields. * **Related endpoints.** For historical funding, open interest, basis, and long-short positioning time series, see [`/crypto/derivatives`](/crypto/derivatives). For all Hyperliquid perpetuals in one ranked list, see [`/crypto/hyperliquid/markets`](/crypto/hyperliquid-markets). For multi-venue context with price windows and macro events, see [`/crypto/context`](/crypto/market-context). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} for exchange, ticker in [ ("okx", "BTC-USDT-SWAP"), ("binance", "perpetual:BTCUSDT"), ("bybit", "perpetual:BTCUSDT"), ("hyperliquid", "BTC-USDC-SWAP"), ]: snap = requests.get( "https://api.darvas.app/v1/crypto/derivatives/snapshot", headers=headers, params={"exchange": exchange, "ticker": ticker}, ).json()["snapshot"] print( snap["exchange"], "funding:", snap["funding_rate"], "next:", snap["next_funding_rate"], "OI USD:", snap["open_interest_usd"], "basis bps:", snap["basis_bps"], ) ``` ```bash theme={null} # Live OKX ETH perpetual funding, countdown, open interest and basis snapshot curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/derivatives/snapshot?exchange=okx&ticker=ETH-USDT-SWAP" ``` # DVOL Index API: IV Rank & Realized Cone Source: https://docs.darvas.app/crypto/dvol-index openapi.yaml GET /crypto/derivatives/dvol Read Deribit's DVOL 30-day implied volatility index for BTC or ETH with IV rank and percentile, implied against realized volatility and a realized cone. ## Overview This endpoint returns Deribit's DVOL index, the 30-day implied volatility of BTC or ETH options. `iv_rank` gives the IV rank and percentile over 30, 90 and 365 days; `implied_vs_realized` puts DVOL against 30-day realized volatility as a premium in vol points and a ratio; `realized_vol_cone` gives the coin's realized volatility over 7 to 180 days on every day of the lookback, from OKX spot daily candles. `history` gives DVOL's daily or hourly bars, with the realized volatility of each day on daily bars. | Coverage | Details | | - | - | | Coins | `BTC` and `ETH` | | Resolution | `1D` (up to 1,000 days) or `1H` (up to 41 days) | | Units | Annualized percent; the premium in vol points | | MCP tool | `get_crypto_options_dvol` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/derivatives/dvol", headers=headers, params={ "underlying": "ETH", "days": 180, }, ).json() print(answer["current"]["dvol_annualized_pct"], answer["implied_vs_realized"]["vrp_vol_pts"]) for rank in answer["iv_rank"]: print(rank["window_days"], rank["iv_rank_pct"], rank["iv_percentile_pct"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/derivatives/dvol?underlying=ETH&days=180" ``` # Bitcoin, Ethereum & Solana Spot ETF Flows API Source: https://docs.darvas.app/crypto/etf-flows openapi.yaml GET /crypto/etf-flows Track daily US spot Bitcoin, Ethereum and Solana ETF net inflows and outflows by issuer (IBIT, FBTC, ETHA and more) for institutional flow models. ## Overview This endpoint returns daily, weekly, or monthly institutional net inflows and outflows in USD millions for US spot BTC, ETH, and SOL exchange-traded funds. Each response carries per-asset window `summaries` alongside aggregate and issuer-level `etf_flows` rows. | Coverage | Details | | - | - | | Assets | `ALL` (default, returns `BTC`, `ETH`, and `SOL`), `BTC`, `ETH`, or `SOL` | | Intervals | `interval` accepts `day` (default), `week` (UTC Monday-start weeks), or `month` (UTC calendar months) | | Date window | Trailing `days` from `1` to `365` (default `30`), or explicit inclusive UTC `start_date` and `end_date` (`YYYY-MM-DD`) | | Issuer detail | `include_providers=true` (default) includes per-issuer rows and `"Total"` rows; `false` returns asset totals only | | Unit | `USD millions`, rounded to two decimal places; positive values are net inflows and negative values are net outflows | | Sort order | `etf_flows` sorted newest `flow_date` first, then by `asset`, with `is_total: true` before issuer rows | | MCP tool | `list_crypto_etf_flows` on the [data API MCP server](/mcp-server) | ## Intervals, date bounds and pending days Every answer returns `unit` (always `"USD millions"`), `interval`, `summaries`, and `etf_flows`. * **Explicit ranges and rollups.** Pass `start_date` and `end_date` (`YYYY-MM-DD`) to query a fixed UTC date range, or set `interval=week` or `interval=month` to sum daily flows into weekly or monthly buckets. When `end_date` is omitted in a ranged or rolled-up query, it defaults to today UTC; when `start_date` is omitted, it defaults to `days - 1` calendar days before `end_date`. Sending `end_date` earlier than `start_date` returns `400`. * **Rolled-up bucket fields.** Ranged and rolled-up responses echo top-level `start_date` and `end_date`, and each row in `etf_flows` includes `bucket_end` (the exclusive UTC end date of that day, week, or month bucket) alongside `flow_date` (the bucket start date). Zero-net buckets are omitted. * **Per-asset summaries.** Each item in `summaries` reports `asset`, `latest_flow_date`, `latest_total_flow_usd_m`, `latest_pending`, `period_net_flow_usd_m`, `positive_days`, and `negative_days` (counting completed buckets with positive or negative net flow). * **Handling pending days.** US spot ETF issuers report daily flows at different times after market close. When `is_pending` is `true`, one or more issuers have not yet reported for a trading day in that bucket. `period_net_flow_usd_m`, `positive_days`, and `negative_days` count completed buckets only (`is_pending: false`), while `latest_total_flow_usd_m` and `latest_pending` still expose the newest bucket. * **Issuer rows and totals.** Each row in `etf_flows` includes `asset`, `flow_date`, `provider` (an issuer ticker such as `IBIT` or `"Total"` for the asset aggregate), `flow_usd_m`, `is_total`, and `is_pending`. Pass `include_providers=false` when you only need asset totals to keep payloads small. * **Related endpoints.** Combine spot ETF flows with [`/crypto/prices`](/crypto/prices), [`/crypto/derivatives`](/crypto/derivatives), [`/crypto/large-trades`](/crypto/large-trades), [`/cot`](/futures/commitment-of-traders), and SEC fund holdings at [`/index-funds`](/ownership/etf-fund-holdings). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/etf-flows", headers=headers, params={ "asset": "BTC", "interval": "week", "start_date": "2026-09-01", "end_date": "2026-11-27", "include_providers": "true", }, ).json() summary = resp["summaries"][0] print("BTC net ($M):", summary["period_net_flow_usd_m"], "positive/negative buckets:", summary["positive_days"], summary["negative_days"]) for row in resp["etf_flows"][:6]: print(row["flow_date"], "->", row.get("bucket_end"), row["provider"], row["flow_usd_m"], "pending:", row["is_pending"]) ``` ```bash theme={null} # Monthly total net flows across BTC, ETH, and SOL over a fixed date range curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/etf-flows?asset=ALL&interval=month&start_date=2026-06-01&end_date=2026-11-27&include_providers=false" ``` # Fixed-Range Crypto Volume Profile API Source: https://docs.darvas.app/crypto/fixed-range-volume-profile openapi.yaml GET /crypto/volume-profile/fixed-range Calculate a custom start-to-end fixed-range crypto volume profile with POC, value area bounds, quote volume per price row and coverage metrics. ## Overview This endpoint returns a volume profile of any time range of a crypto spot or perpetual swap market, or of a Darvas aggregated pair (`exchange=darvas`, the default). Darvas spreads each candle's quote volume evenly over its high to low range and sums it per price row, then marks the point of control and the value area. `quality` and `coverage_percent` say how many of the expected candles Darvas holds for the range. | Coverage | Details | | - | - | | Exchanges | `darvas` (default), `okx`, `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Markets | Spot and perpetual swap; futures and options return `400` | | Range | `start_time` and `end_time` are required, widened to whole minutes | | Source candles | `timeframe` `1m` to `1H` reads one-minute candles; `4H` and `1D` read hourly candles | | Candle caps | 100,000 source candles a range, or 20,000 for a Darvas pair or a Binance or Bybit market | | Rows and value area | `rows` from `12` to `200` (default `48`); `value_area_percent` from `50` to `95` (default `70`) | | MCP tool | `get_crypto_fixed_range_volume_profile` on the [data API MCP server](/mcp-server) | ## Range, timeframe and rows * **Range.** Send `start_time` and `end_time` as ISO 8601, a UTC date or Unix milliseconds. `start_time` rounds down and `end_time` rounds up to the minute, and `end_time` must be after `start_time`. * **Timeframe.** `timeframe` (default `15m`) is the chart timeframe the range is drawn on, and it picks the source candles. 100,000 one-minute candles cover about 69 days; with `timeframe=4H` or `1D`, hourly candles stretch the 20,000-candle cap of a Darvas pair to about 833 days. A range over its cap returns `400`. * **Rows.** `rows` asks for that many price rows across the range's high to low, and `bucket_size` is the height of each. `tick_size` (the market's price tick, such as `0.1`) makes every row a whole number of ticks tall. * **Levels.** `poc`, `value_area_high` and `value_area_low` are rows with `price` (the middle), `price_from`, `price_to` and `volume`; each is `null` without volume. `buckets` lists every row lowest first, with `in_value_area` and `is_poc`. * **Volume and quality.** `total_volume` and every `volume` are in the quote currency (`volume_unit: "quote"`), estimated as base volume times close where a candle has no quote volume. `quality` is `complete` when Darvas holds at least 98 percent of the expected candles, `partial` below that and `no_data` without any; `source_candles` and `expected_source_candles` give the counts. With `exchange=darvas`, `constituents` names every exchange the pair combines and `venues` the subset a `venues` filter kept (`null` when unfiltered); both are absent for a single exchange. For trade-built session profiles of OKX perpetuals with buy and sell split, see [`/crypto/volume-profile`](/crypto/volume-profile). For TPO structure, see [`/crypto/tpo`](/crypto/tpo-market-profile). For the candles behind the profile, see [`/crypto/prices`](/crypto/prices). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} profile = requests.get( "https://api.darvas.app/v1/crypto/volume-profile/fixed-range", headers=headers, params={ "ticker": "BTC-USDT-SWAP", "exchange": "darvas", "start_time": "2026-11-27T00:00:00Z", "end_time": "2026-11-28T00:00:00Z", "timeframe": "15m", "rows": 60, }, ).json() print("Constituents:", profile["constituents"], "Quality:", profile["quality"], profile["coverage_percent"]) print("POC:", profile["poc"]["price"], "VAL:", profile["value_area_low"]["price_from"], "VAH:", profile["value_area_high"]["price_to"]) value_area = [row for row in profile["buckets"] if row["in_value_area"]] print("Rows in value area:", len(value_area), "of", len(profile["buckets"])) ``` ```bash theme={null} # Coinbase BTC-USD spot over eight days, 96 rows on whole cents curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/volume-profile/fixed-range?ticker=BTC-USD&exchange=coinbase&start_time=2026-11-20&end_time=2026-11-28&timeframe=1H&rows=96&tick_size=0.01" ``` # Crypto Footprint Chart & Bid/Ask Cluster API Source: https://docs.darvas.app/crypto/footprint-charts openapi.yaml GET /crypto/footprint Access price-level crypto footprint bars with bid/ask volume, imbalances, point of control and delta per tick across OKX, Binance, Bybit and more. ## Overview This endpoint returns footprint chart data for crypto spot and perpetual swap markets: each bar's taker buy/sell volume, delta path and trade counts in `bars`, plus the price-by-price breakdown in `cells`. By default (`exchange=darvas`), Darvas sums trades across every trade-recorded exchange that lists the pair onto a single shared price grid. The newest bar may still be open. | Coverage | Details | | - | - | | Aggregated feed | `darvas` (default) sums OKX, Binance, Bybit and Hyperliquid trades for a canonical pair (`BTC-USDT-SWAP`, `BTC-ALLUSD`, `BTC-ALLUSD-SWAP`) on one price grid | | Single exchanges | `okx`, `binance`, `bybit` and `hyperliquid` (spot and perpetual swap markets; futures and options return `400`) | | Bar sizes | `1m`, `5m`, `15m` (default), `30m`, `1H`, `2H`, `4H`, `1D` and `1W` (weeks start Monday UTC) | | Bar limits | Default `30`; up to `120` bars with `cells=all`, up to `500` bars with `cells=none` | | Cell cap | Up to 60,000 cells per response; when capped, `limited` is `true` and only the newest whole bars that fit are returned | | MCP tool | `get_crypto_footprint` on the [data API MCP server](/mcp-server) | ## Price grid and row size Each exchange can trade on a different native tick size. For `exchange=darvas`, Darvas aligns every constituent exchange to the coarsest native tick among the active venues (`tick`) so finer-tick venues fold without empty rows. * **Row sizing.** Pass `row_size` in quote price units (for example `row_size=10` for 10-dollar rows on BTC) and Darvas rounds it to whole ticks. If you omit `row_size`, `row_ticks` (default `1`, up to `1,000,000`) sets ticks per row, rounded up to a multiple of the coarsest stored step. `row_size` overrides `row_ticks` when both are sent. * **Reading cells.** Each entry in `cells` gives `time_milliseconds` (matching its bar in `bars`), `price` (the row's low price, spanning `row_size` above it), `buy_volume`, `sell_volume`, `buy_trades` and `sell_trades`. Cells are sorted oldest bar first, then lowest price row first. * **Totals-only mode.** Pass `cells=none` when you only need bar totals (`buy_volume`, `sell_volume`, `delta`, `buy_trades`, `sell_trades`, `min_delta`, `max_delta`). That returns `cells: []` and raises the `limit` cap from `120` to `500` bars. * **Handling `limited: true`.** If a wide window or fine tick grid hits the 60,000-cell limit, increase `row_size` or `row_ticks`, request fewer bars with `limit`, or switch to `cells=none`. ## Venues, windows and related endpoints With `exchange=darvas`, pass comma-separated `venues` (such as `venues=binance,okx`) to combine only those exchanges; any non-`darvas` exchange refuses `venues` with `400`. Aggregated answers include `constituents` (every exchange feeding the pair) and `venues` (the filtered subset, or `null` when unfiltered). Both fields are absent for single-exchange requests. Pass `start_time` and `end_time` as ISO 8601 timestamps (`2026-11-25T14:00:00Z`) or Unix milliseconds. Without `end_time`, the window ends at the current open bar; without `start_time`, it spans `limit` bars before `end_time`. Bars with no trades are omitted, and `as_of` records the UTC time Darvas read the footprint. For paginated 13-month bar totals without cells, see [`/crypto/order-flow`](/crypto/order-flow). For raw trade ticks, see [`/crypto/trades`](/crypto/trades). For OHLCV candles and instruments, see [`/crypto/prices`](/crypto/prices) and [`/crypto/tickers`](/crypto/tickers). ## Examples ```python theme={null} import os from collections import defaultdict import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} fp = requests.get( "https://api.darvas.app/v1/crypto/footprint", headers=headers, params={ "ticker": "BTC-USDT-SWAP", "bar": "15m", "row_size": 10, "limit": 8, }, ).json() by_bar = defaultdict(list) for cell in fp["cells"]: by_bar[cell["time_milliseconds"]].append(cell) print("Constituents:", fp["constituents"], "Row size:", fp["row_size"], "Limited:", fp["limited"]) for bar in fp["bars"][-3:]: rows = by_bar[bar["time_milliseconds"]] poc = max(rows, key=lambda r: r["buy_volume"] + r["sell_volume"]) print(bar["time"], "delta:", bar["delta"], "POC price:", poc["price"], "buy/sell trades:", bar["buy_trades"], bar["sell_trades"]) ``` ```bash theme={null} # Bar totals only across Binance and OKX for aggregated BTC spot dollar markets curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/footprint?ticker=BTC-ALLUSD&exchange=darvas&venues=binance,okx&bar=1H&cells=none&limit=24" ``` # Crypto Funding Rate Arbitrage API Source: https://docs.darvas.app/crypto/funding-arbitrage openapi.yaml GET /crypto/funding-arbitrage Scan the widest perpetual funding spread of every coin across OKX, Binance, Bybit and Hyperliquid, normalized to 8 hours and annualized, with liquidity filters. ## Overview This endpoint finds the widest funding spread of every coin across the perpetuals of OKX, Binance, Bybit and Hyperliquid. Each venue's rate is put on an 8-hour basis and annualized from the contract's own settlement interval, since Hyperliquid settles every hour and Binance and Bybit every 1, 4 or 8 hours. The pair is the venue to hold long (the lowest rate) and the venue to hold short (the highest), with the price spread between the two in basis points. Both legs must pass `min_open_interest_usd` and `min_volume_24h_usd`, one million dollars each by default. `quote_mismatch` and `interval_mismatch` flag pairs whose legs settle differently. | Coverage | Details | | - | - | | Venues | `okx`, `binance`, `bybit` and `hyperliquid` | | Quotes | `USDT`, `USDC` and `USD` contracts | | Rates | Each leg's current-period rate, 8-hour rate and simple annual rate | | Results | Up to 200 coins, widest spread first | | MCP tool | `scan_crypto_funding_arbitrage` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/funding-arbitrage", headers=headers, params={ "min_open_interest_usd": 10000000, "limit": 20, }, ).json() for pair in answer["opportunities"]: print(pair["base"], pair["long"]["venue"], pair["short"]["venue"], pair["annualized_apr_spread_pct"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/funding-arbitrage?min_open_interest_usd=10000000&limit=20" ``` # Hyperliquid Perpetual Markets, Funding & OI Source: https://docs.darvas.app/crypto/hyperliquid-markets openapi.yaml GET /crypto/hyperliquid/markets Query live Hyperliquid perpetual markets with funding rates, open interest, mark prices, oracle spreads, 24h volume and full contract metadata. ## Overview This endpoint returns a live snapshot of perpetual contracts trading on Hyperliquid, with mark price, oracle index price, 24-hour change, hourly funding rate, open interest in base units and USD, rolling 24-hour notional volume, mark-oracle premium, and maximum leverage. | Coverage | Details | | - | - | | Exchange | `hyperliquid` (all active Hyperliquid perpetual contracts) | | Ticker filter | Optional `ticker` base symbol such as `BTC`, `ETH`, or `SOL` (case-insensitive exact match) | | Ranking | `sort` by `volume_24h` (default), `open_interest`, `funding_rate`, or `day_change_pct` | | Row limit | `limit` from `1` to `200` markets (default `50`) | | Freshness | Live exchange universe snapshot cached for 30 seconds | | MCP tool | `list_hyperliquid_markets` on the [data API MCP server](/mcp-server) | ## Sorting rules and market fields Use `sort` to scan the active perpetual universe in one request without fetching per-ticker endpoints. * **Absolute-magnitude sorting.** `volume_24h` and `open_interest` sort descending by `volume_24h_usd` and `open_interest_usd`. `funding_rate` and `day_change_pct` sort descending by absolute value, so deeply negative funding rates and sharp selloffs rank alongside positive extremes. * **Pricing and funding fields.** Each row in `markets` returns `ticker`, `mark_price`, `oracle_price`, `prev_day_price`, `day_change_pct` (percentage change from `prev_day_price` to `mark_price`), `funding_rate` (current hourly rate), `premium` (mark-to-oracle basis), and `max_leverage`. * **Open interest and volume.** `open_interest` is reported in base asset contracts, `open_interest_usd` equals `open_interest * mark_price` rounded to two decimal places, and `volume_24h_usd` reports rolling 24-hour USD notional turnover. * **Related endpoints.** For historical Hyperliquid candles, see [`/crypto/prices`](/crypto/prices) with `exchange=hyperliquid`. For Hyperliquid trade prints, order flow, and large executions, see [`/crypto/trades`](/crypto/trades), [`/crypto/order-flow`](/crypto/order-flow), and [`/crypto/large-trades`](/crypto/large-trades). For CEX perpetual positioning, see [`/crypto/derivatives`](/crypto/derivatives). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/hyperliquid/markets", headers=headers, params={"sort": "funding_rate", "limit": 10}, ).json() for m in resp["markets"]: print(m["ticker"], "mark:", m["mark_price"], "hourly funding:", m["funding_rate"], "OI USD:", m["open_interest_usd"]) ``` ```bash theme={null} # Top 20 Hyperliquid perpetuals ranked by USD open interest curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/hyperliquid/markets?sort=open_interest&limit=20" ``` # Composite Crypto Spot Index Historical API Source: https://docs.darvas.app/crypto/index-prices openapi.yaml GET /crypto/index/prices Query historical OHLC bars for composite crypto spot price indices such as BTC-USD and ETH-USD aggregated across major liquid spot exchanges. ## Overview This endpoint returns OHLC candles for a composite crypto spot index, such as `BTC-USD` or `ETH-USDT`. Each composite index blends spot quotes from several major exchanges into a single reference series that perpetual swaps and futures contracts mark against. Candles return oldest first in `prices`, including the candle still in progress. | Coverage | Details | | - | - | | Index format | `index` as `BASE-QUOTE` in any case (default `BTC-USD`); unknown index names return `404` | | Intervals | `1m`, `5m`, `15m`, `30m`, `1H` (default), `4H`, `1D` and `1W` | | Bucket alignment | Daily (`1D`) and weekly (`1W`) candles align to UTC boundaries (`00:00:00Z`) | | Row limit | `limit` from `1` to `100` newest candles (default `100`) | | MCP tool | `list_crypto_index_prices` on the [data API MCP server](/mcp-server) | ## Candle fields and usage Composite index candles carry price levels only (`open`, `high`, `low`, `close`) with no trade volume, because an index is a weighted spot composite rather than a single order book. * **Open versus closed bars.** Each candle includes `confirmed` (`true` once the bucket has closed, `false` while the newest bar is still forming), `time` (ISO 8601 UTC open timestamp), and `time_milliseconds`. * **Comparing against derivatives.** Pair index candles with perpetual swap candles at [`/crypto/prices`](/crypto/prices) or historical basis series at [`/crypto/derivatives`](/crypto/derivatives) (`metric=basis`) to measure contract premiums and discounts over time. * **Related endpoints.** For live spot index prices and 24-hour ranges across an entire quote currency, see [`/crypto/index/snapshot`](/crypto/index-snapshot). For live mark price, index price, and basis in basis points, see [`/crypto/derivatives/snapshot`](/crypto/derivatives-snapshot). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/index/prices", headers=headers, params={"index": "BTC-USD", "interval": "4H", "limit": 24}, ).json() print(resp["index"], resp["interval"], "bars:", len(resp["prices"])) for bar in resp["prices"][-3:]: print(bar["time"], "O/H/L/C:", bar["open"], bar["high"], bar["low"], bar["close"], "confirmed:", bar["confirmed"]) ``` ```bash theme={null} # Latest 30 daily UTC candles for the ETH-USD composite spot index curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/index/prices?index=ETH-USD&interval=1D&limit=30" ``` # Live Composite Crypto Spot Index Snapshot API Source: https://docs.darvas.app/crypto/index-snapshot openapi.yaml GET /crypto/index/snapshot Read real-time composite crypto spot index prices and component spreads for BTC-USD, ETH-USD and major digital assets in one low-latency call. ## Overview This endpoint returns the latest price, rolling 24-hour range, and percentage changes over both 24 hours and the current UTC day for one composite spot index or every index denominated in a quote currency. Results return sorted alphabetically by `index` in `indices`. | Coverage | Details | | - | - | | Single index | Pass `index` as `BASE-QUOTE` in any case, such as `BTC-USD` or `SOL-USDT`; unknown names return `404` | | Quote currency sweep | Pass `quote_currency` (`USD`, `USDT`, `USDC` or `BTC`) to fetch every composite index in that quote | | Default behavior | Omitting both `index` and `quote_currency` returns every `USD` composite spot index | | MCP tool | `get_crypto_index_snapshot` on the [data API MCP server](/mcp-server) | ## Snapshot fields and reference windows Each entry in `indices` provides two separate return windows from the same live quote: * **Rolling 24-hour window.** `open_24h`, `high_24h`, `low_24h`, and `change_24h_percent` measure performance against the index level 24 hours ago (rounded to two decimal places, or `null` if `open_24h` is zero). * **UTC calendar day window.** `open_utc_day` and `change_utc_day_percent` measure performance since `00:00:00Z` UTC so you can align index moves with UTC daily candles. * **Timestamps and echoed filters.** Each row includes `time` (ISO 8601 UTC) and `time_milliseconds`. Top-level `index` and `quote_currency` echo the active filter (`null` when not applied). * **Related endpoints.** For historical composite index OHLC candles, see [`/crypto/index/prices`](/crypto/index-prices). For trade-volume-ranked exchange pairs, see [`/crypto/prices/snapshot/market`](/crypto/market-snapshot). For live contract mark price versus spot index basis, see [`/crypto/derivatives/snapshot`](/crypto/derivatives-snapshot). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/index/snapshot", headers=headers, params={"quote_currency": "USD"}, ).json() movers = sorted(resp["indices"], key=lambda row: row["change_24h_percent"] or 0, reverse=True)[:10] for row in movers: print(row["index"], "price:", row["price"], "24h %:", row["change_24h_percent"], "UTC day %:", row["change_utc_day_percent"]) ``` ```bash theme={null} # Latest composite spot index snapshot for BTC-USD curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/index/snapshot?index=BTC-USD" ``` # Crypto Whale & Large Trades Tape API Source: https://docs.darvas.app/crypto/large-trades openapi.yaml GET /crypto/large-trades Stream high-notional crypto whale executions filtered by minimum USD size, side and lookback hours across major crypto spot and perpetual venues. ## Overview This endpoint returns high-notional aggressive crypto executions that meet or exceed `min_notional_usd` across OKX, Binance, Bybit, and Hyperliquid spot and perpetual markets. Results arrive in `large_trades`, newest first. | Coverage | Details | | - | - | | Exchanges | `okx` (default), `binance`, `bybit`, and `hyperliquid` | | Default ticker | `BTC-USDT-SWAP` on OKX, `perpetual:BTCUSDT` on Binance and Bybit, `BTC-USDC-SWAP` on Hyperliquid | | Supported quotes | USD, USDT, and USDC; non-dollar quote markets return `400` | | Notional floor | `min_notional_usd` default `100000` (\$100,000 USD), minimum `0`, truncated to whole dollars | | Window and limit | `lookback_hours` from `1` to `168` hours (default `24`, above `168` returns `400`); `limit` from `1` to `100` (default `50`) | | History | Full stored archive on OKX swaps; OKX spot, Hyperliquid perpetuals, and Binance and Bybit since 23 November 2026 | | MCP tool | `list_crypto_large_trades` on the [data API MCP server](/mcp-server) | ## Execution aggregation and ticker formats How each execution is measured depends on the venue and market type. * **OKX contracts.** On OKX perpetual swaps and futures, fills that share a millisecond timestamp, taker side, and execution price are summed back into the originating taker order before applying `min_notional_usd`. * **OKX spot, Binance, Bybit, and Hyperliquid.** Each row is an individual tape trade whose `price * size_base` is at least `min_notional_usd`, deduplicated by `(time, id)`. * **Instrument IDs.** Pass `BTC-USDT-SWAP` or `BTC-USDT` on OKX, `BTC-USDC-SWAP` on Hyperliquid, and `perpetual:BTCUSDT` or `spot:BTCUSDT` on Binance and Bybit. Bare Binance or Bybit symbols such as `BTCUSDT` also work with `market_type` (`spot`, `swap`, `futures`, or `option`). * **Response fields.** Each entry in `large_trades` returns `id`, `ticker`, `base_currency`, `side` (taker aggressor `buy` or `sell`), `price`, `size_base`, `notional_usd` (rounded to two decimal places), and `time` (UTC ISO 8601). * **Related endpoints.** For complete tick-by-tick trade prints, see [`/crypto/trades`](/crypto/trades). For aggregated taker delta and price-level clusters, see [`/crypto/order-flow`](/crypto/order-flow) and [`/crypto/footprint`](/crypto/footprint-charts). For forced unwinds, see [`/crypto/liquidations`](/crypto/liquidations). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/large-trades", headers=headers, params={ "exchange": "binance", "ticker": "perpetual:BTCUSDT", "min_notional_usd": 250000, "lookback_hours": 24, "limit": 50, }, ).json() buy_usd = sum(t["notional_usd"] for t in resp["large_trades"] if t["side"] == "buy") sell_usd = sum(t["notional_usd"] for t in resp["large_trades"] if t["side"] == "sell") print(resp["exchange"], resp["ticker"], "count:", len(resp["large_trades"]), "buy USD:", round(buy_usd, 2), "sell USD:", round(sell_usd, 2)) ``` ```bash theme={null} # OKX BTC perpetual executions of $500,000 or more over the last 48 hours curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/large-trades?exchange=okx&ticker=BTC-USDT-SWAP&min_notional_usd=500000&lookback_hours=48&limit=25" ``` # Bitcoin & Crypto Liquidation Heatmap Data API Source: https://docs.darvas.app/crypto/liquidation-heatmap openapi.yaml GET /crypto/liquidations/heatmap Estimate concentrated crypto perpetual liquidation price levels and leverage clusters to map liquidation cascades across BTC, ETH and altcoins. ## Overview This endpoint estimates where leveraged positions of an OKX perpetual swap would be liquidated. For each bar of the lookback, Darvas takes the open interest the bar added, its long/short and top-trader ratios, taker volume and funding, spreads that exposure over the usual leverage levels, decays it with time and sweeps it when price trades through. The liquidations OKX reported calibrate the estimate. The answer is a model of positioning, not orders resting in the book. | Coverage | Details | | - | - | | Markets | OKX perpetual swaps such as `BTC-USDT-SWAP` (default) and `ETH-USDT-SWAP` | | Bar sizes | `interval`: `5m`, `15m`, `30m`, `1H` (default), `4H` and `1D` | | Lookback | `lookback_bars` from `30` to `500` of the newest bars (default `180`) | | Bands | `price_bucket_percent` from `0.02` to `2` percent of the last price (default `0.25`) | | Filters | `threshold` from `0` to `100` (default `15`); `leverage_sensitivity` from `0.25` to `3` (default `1`) | | Cell cap | 20,000 cells, newest kept; `limited` is `true` when capped | | MCP tool | `get_crypto_liquidation_heatmap` on the [data API MCP server](/mcp-server) | ## Reading the estimate * **Coverage.** `coverage` says what backs the estimate: `calibrated` with reported liquidations, `estimated` with open interest, `fallback` with candles alone. `inputs` counts the points of each series used (`open_interest_points`, `long_short_points`, `top_trader_points`, `taker_volume_points`, `funding_points`) and the `liquidation_events` reported in the window. A series Darvas cannot read counts `0`, and the estimate continues without it. * **Bands.** Every band carries `price_low`, `price_high`, `long_usd` and `short_usd` (estimated positions liquidated there), `event_usd` (reported liquidations that calibrate it) and `total_usd`, the three together. `score` is `total_usd` against the heatmap's largest band on a log scale from 0 to 1, and `confidence` (`low`, `medium`, `high`) says how well reported liquidations back it. * **Threshold.** `threshold` is in percent of `score`: `threshold=25` keeps bands with a `score` of at least 0.25, and values above 95 act as 95. `leverage_sensitivity` above `1` weights the higher leverage levels, whose liquidations sit closer to price. * **Nearest levels.** `levels` lists up to 25 bands of the newest bar, the most `total_usd` first, with `side` (`below_price`, where long liquidations wait, or `above_price`, where short ones do) and `distance_percent`, the band's middle against `last_price`. * **Cells.** `cells` holds every bar's bands that pass `threshold`, oldest bar first, with `time`, `time_milliseconds` and `end_time_milliseconds`. `bucket_size` is each band's height in price and `max_usd` the largest band's total. When Darvas holds no candles of the perpetual, the answer is `404`; other tickers, such as spot pairs, return `400`. For the liquidation fills OKX reported, see [`/crypto/liquidations`](/crypto/liquidations). For open interest and funding history, see [`/crypto/derivatives`](/crypto/derivatives). For resting book liquidity, see [`/crypto/order-book/heatmap`](/crypto/order-book-heatmap). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} heat = requests.get( "https://api.darvas.app/v1/crypto/liquidations/heatmap", headers=headers, params={"ticker": "BTC-USDT-SWAP", "interval": "1H", "lookback_bars": 240}, ).json() print("Coverage:", heat["coverage"], "Last price:", heat["last_price"], "Inputs:", heat["inputs"]) below = [lv for lv in heat["levels"] if lv["side"] == "below_price"] above = [lv for lv in heat["levels"] if lv["side"] == "above_price"] nearest_long = max(below, key=lambda lv: lv["distance_percent"], default=None) nearest_short = min(above, key=lambda lv: lv["distance_percent"], default=None) print("Nearest long cluster:", nearest_long) print("Nearest short cluster:", nearest_short) ``` ```bash theme={null} # ETH perpetual on 4-hour bars, 0.1 percent bands, strong cells only curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/liquidations/heatmap?ticker=ETH-USDT-SWAP&interval=4H&lookback_bars=240&price_bucket_percent=0.1&threshold=25" ``` # Crypto Liquidations Feed API (BTC, ETH, Alts) Source: https://docs.darvas.app/crypto/liquidations openapi.yaml GET /crypto/liquidations Query forced crypto perpetual and futures liquidation events filtered by symbol, side, minimum USD size and lookback hours across major venues. ## Overview This endpoint returns forced long and short liquidation fills for perpetual and futures contracts, sorted newest first. Query one contract with `ticker`, or omit `ticker` to read the market-wide liquidation tape across every contract on the selected `exchange`, with optional `side` and `min_notional_usd` filters. | Coverage | Details | | - | - | | Exchanges | `exchange` accepts `okx` (default), `binance`, `bybit`, or `hyperliquid` | | Scope | Pass `ticker` (such as `BTC-USDT-SWAP`) for one contract, or omit `ticker` for market-wide liquidations (`ticker: null` in response) | | Filters | Optional `side` (`long` or `short`) and `min_notional_usd` (non-negative USD notional floor) | | Lookback window | `lookback_hours` from `1` to `168` hours (default `24`) | | Row limit | `limit` from `1` to `500` events per response (default `100`), newest first | | MCP tool | `list_crypto_liquidations` on the [data API MCP server](/mcp-server) | ## Parameters and liquidation fields Top-level fields echo the active query filters: `ticker` (`null` for market-wide scans), `exchange`, `side` (`null` when unfiltered), and `min_notional_usd` (`null` when unfiltered). Requesting `lookback_hours` above `168` (seven days), `limit` above `500`, or a negative `min_notional_usd` returns `400`. * **Single contract versus market-wide.** When `ticker` is provided, input is normalized to uppercase and filters to that instrument. When `ticker` is omitted, `liquidations` returns fills across all contracts on `exchange`, and each row's `ticker` names the liquidated instrument. * **Liquidated side.** `side` identifies the position that was forcibly closed: `long` means a leveraged long was liquidated, and `short` means a leveraged short was squeezed out. * **Size, notional and floor.** `price` is the liquidation execution price, `size_base` is the liquidated quantity in base asset units, and `notional_usd` is the USD value rounded to two decimal places. `min_notional_usd` filters deduplicated fills whose `notional_usd` meets or exceeds the threshold. * **Deduplication and provenance.** Events sharing `(ticker, time, side, price)` keep the latest ingested size and notional. `source_quality` records the feed tag, such as `okx_ws`. * **Related endpoints.** Pair liquidation clusters with [`/crypto/derivatives`](/crypto/derivatives) and [`/crypto/derivatives/snapshot`](/crypto/derivatives-snapshot) for open interest and funding shifts, [`/crypto/large-trades`](/crypto/large-trades) for whale sweeps, [`/crypto/order-flow`](/crypto/order-flow) and [`/crypto/footprint`](/crypto/footprint-charts) for taker delta, and [`/crypto/tickers`](/crypto/tickers) for contract symbols. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/liquidations", headers=headers, params={ "exchange": "okx", "side": "short", "min_notional_usd": 50000, "lookback_hours": 24, "limit": 100, }, ).json() total_usd = sum(ev["notional_usd"] for ev in resp["liquidations"]) print("Exchange:", resp["exchange"], "market-wide short liqs >= $50k:", len(resp["liquidations"]), "total USD:", round(total_usd, 2)) for ev in resp["liquidations"][:5]: print(" ", ev["time"], ev["ticker"], ev["side"], ev["price"], f'${ev["notional_usd"]}') ``` ```bash theme={null} # Latest 50 ETH perpetual liquidations of at least $25,000 over the last 12 hours curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/liquidations?exchange=okx&ticker=ETH-USDT-SWAP&min_notional_usd=25000&lookback_hours=12&limit=50" ``` # Crypto Market Context API: Price, Flow & Macro Source: https://docs.darvas.app/crypto/market-context openapi.yaml GET /crypto/context Get a single-call crypto trading brief with last price, 1H/4H/24H ranges, hourly bars, cross-venue funding and open interest deltas plus macro events. ## Overview This endpoint bundles one crypto instrument's recent price action, perpetual positioning across venues, and nearby high-impact macro releases into a single JSON response. It reads 24 hours of 5-minute candles on a Darvas aggregated pair (by default) or a single exchange, then assembles trailing price windows, hourly OHLCV bars, per-venue funding and open interest changes, and economic calendar releases. | Coverage | Details | | - | - | | Aggregated feed | `darvas` (default) aggregates candles across constituent exchanges and pulls derivatives positioning from every derivative venue in the pair | | Single exchanges | `okx`, `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Price windows | Trailing `last_1h`, `last_4h`, and `last_24h` changes, highs, lows, and timestamps built from 288 five-minute candles | | Derivatives venues | Live funding rate and USD open interest with 1h, 4h, and 24h changes on `okx`, `binance`, `bybit`, and `hyperliquid` (perpetual swaps only) | | Macro window | High-impact releases from 24 hours before to 48 hours after `observed_at` (up to 15 past and 15 upcoming) | | Optional flags | `include_hourly_bars` (`true` default, or `false`) and `include_macro` (`true` default, or `false`) | | MCP tool | `get_crypto_market_context` on the [data API MCP server](/mcp-server) | ## Response sections and partial degradation Each section fails independently so a single slow feed does not block the full market brief. * **`price` and `windows`.** `price` reports the latest 5-minute candle close (`last`), open timestamp (`time`, `time_milliseconds`), `bar_interval` (`"5m"`), and `last_bar_closed`. `windows` returns `last_1h`, `last_4h`, and `last_24h`, each with `from`, `to`, `bars`, `change_percent`, `high`, `high_time`, `low`, and `low_time`. * **`hourly_bars`.** Up to 25 UTC hourly OHLCV bars rolled up from the 5-minute series, oldest first. Pass `include_hourly_bars=false` to return `null` and shrink the payload. * **`derivatives`.** Populated when `market_type` is `swap`, and `null` for spot, futures, or options. Contains `total_open_interest_usd` (sum of venues that answered) and a `venues` array with `funding_rate`, `next_funding_rate`, `next_funding_time`, `funding_interval_hours`, `open_interest_usd`, `open_interest_time`, and `open_interest_change_pct_1h`, `_4h`, and `_24h`. On `hyperliquid`, open interest history is not published so the three OI change fields are `null`. On `exchange=darvas`, passing `venues` filters both the candles and the `derivatives.venues` list; sending `venues` with a single exchange returns `400`. * **`macro`.** High-impact releases from the economic calendar with `event_name`, `currency`, `country_name`, `importance`, `release_at`, `released`, `actual`, `forecast`, and `previous`. Returns `null` when `include_macro=false` or when the calendar store is unavailable. * **Related endpoints.** For deeper structure analysis, see [`/crypto/market-structure`](/crypto/market-structure). For single-venue live mark price and basis, see [`/crypto/derivatives/snapshot`](/crypto/derivatives-snapshot). For the full calendar filter set, see [`/macro/economic-calendar`](/macro/economic-calendar). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} ctx = requests.get( "https://api.darvas.app/v1/crypto/context", headers=headers, params={"ticker": "BTC-USDT-SWAP", "exchange": "darvas"}, ).json() print("Last:", ctx["price"]["last"], "24h %:", ctx["windows"]["last_24h"]["change_percent"]) print("Total OI USD:", ctx["derivatives"]["total_open_interest_usd"]) for v in ctx["derivatives"]["venues"]: print(" ", v["exchange"], "funding:", v["funding_rate"], "OI 24h %:", v["open_interest_change_pct_24h"]) print("Upcoming high-impact events:", len([r for r in ctx["macro"]["releases"] if not r["released"]])) ``` ```bash theme={null} # Compact ETH perpetual context without hourly bars or macro events, limited to Binance and OKX curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/context?ticker=ETH-USDT-SWAP&exchange=darvas&venues=binance,okx&include_hourly_bars=false&include_macro=false" ``` # Crypto Market Snapshot API Across All Pairs Source: https://docs.darvas.app/crypto/market-snapshot openapi.yaml GET /crypto/prices/snapshot/market Fetch latest prices, 24h returns, quote volumes and market breadth across supported crypto spot and perpetual pairs in one structured request. ## Overview This endpoint returns the latest price, 24-hour percentage change, and 24-hour quote-currency traded volume for every active pair on one exchange or across Darvas aggregated pairs (`exchange=darvas`, the default). Data is served from a warm snapshot refreshed every 15 seconds, holding up to the 2,000 busiest pairs per exchange. | Coverage | Details | | - | - | | Aggregated feed | `darvas` (default) returns Darvas aggregated spot, perpetual swap and `ALLUSD` pairs, each with its `constituents` list | | Single exchanges | `okx`, `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Filters | Optional `market_type` (`spot`, `swap` or `futures`) and `quote` (currency such as `USDT`, `USD`, `USDC`, or `ALLUSD` on `darvas`) | | Ranking | `sort` by `volume_24h` (default), `change_24h`, or `price`; `order` is `desc` (default) or `asc` | | Row limit | `limit` from `1` to `2000` pairs (default `100`) | | MCP tool | `get_crypto_market_snapshot` on the [data API MCP server](/mcp-server) | ## Filtering, sorting and volume units Filters apply before sorting and slicing to `limit`, with alphabetical `ticker` tie-breaking. * **Quote-currency volume.** `quote_volume_24h` is reported in each pair's own `quote` currency. Pass `quote=USDT`, `quote=USD`, or `quote=ALLUSD` when sorting by `volume_24h` so every ranked pair shares a common dollar unit. * **Snapshot fields.** Each row in `snapshots` returns `ticker`, `base`, `quote`, `market_type`, `price`, `change_24h_percent` (rounded to four decimal places), `quote_volume_24h`, `time` (ISO 8601 UTC minute timestamp), and `time_milliseconds`. Aggregated rows on `exchange=darvas` also include `constituents`; single-exchange rows omit it. * **Related endpoints.** For one pair's full UTC day OHLCV candle, see [`/crypto/prices/snapshot`](/crypto/price-snapshot). For the full instrument catalog with tick and lot sizes, see [`/crypto/tickers`](/crypto/tickers). For single-pair cross-venue perpetual volume breakdown, see [`/crypto/volume/aggregated`](/crypto/aggregated-volume). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/prices/snapshot/market", headers=headers, params={ "exchange": "darvas", "market_type": "swap", "quote": "USDT", "sort": "change_24h", "order": "desc", "limit": 15, }, ).json() for row in resp["snapshots"]: print(row["ticker"], "price:", row["price"], "24h %:", row["change_24h_percent"], "vol:", row["quote_volume_24h"]) ``` ```bash theme={null} # Top 25 ALLUSD spot pairs on Darvas ranked by 24-hour dollar volume curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/prices/snapshot/market?exchange=darvas&market_type=spot"e=ALLUSD&sort=volume_24h&order=desc&limit=25" ``` # Crypto Market Structure, FVG & SMC Levels API Source: https://docs.darvas.app/crypto/market-structure openapi.yaml GET /crypto/market-structure Detect swing highs/lows, Break of Structure (BOS), Change of Character (CHoCH), Fair Value Gaps (FVG) and liquidity pools on crypto charts via API. ## Overview This endpoint runs Darvas market structure engines over the newest candles of a Darvas aggregated pair (by default) or a single exchange instrument. Each requested engine returns its own top-level object (`smc`, `order_blocks`, `fvg_sessions`, `swings`, `volume_zones`, or `monte_carlo`) alongside candle window metadata (`bars`, `from`, `to`, and `price`). | Coverage | Details | | - | - | | Aggregated feed | `darvas` (default) reads Darvas aggregated candles across every primary exchange listing the pair, including `ALLUSD` pairs (`BTC-ALLUSD`, `BTC-ALLUSD-SWAP`) | | Single exchanges | `okx`, `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Formulas | Inverses, ratios, spreads and arithmetic over listed crypto instruments, typed (`USDTBTC`, `BTCUSDT*USDTETH`, `BTCUSDT/NVDAUSDT`, `COINBASE:BTCUSD - BINANCE:BTCUSDT`) or canonical (`1 / [okx:BTC-USDT-SWAP]`), on `exchange=formula` | | Timeframes | `1m`, `5m`, `15m`, `30m`, `1H` (default), `4H`, `1D` and `1W` | | Modules | Comma-separated `smc`, `order_blocks`, `fvg_sessions`, `swings`, `volume_zones` and `monte_carlo`; defaults to `smc,swings` | | Lookback window | `lookback` from `50` to `500` newest candles (default `300`) | | MCP tool | `get_crypto_market_structure` on the [data API MCP server](/mcp-server) | ## Structure engines Request only the engines you need with `modules`. Unrequested engine keys are omitted from the response. | Module | What it returns | Notes and caps | | - | - | - | | `smc` | `structures` (`BOS` and `CHoCH`), `order_blocks`, `fair_value_gaps`, `equal_levels` (`EQH`, `EQL`), `zones` (`premium`, `equilibrium`, `discount`), `strong_weak_levels`, `swing_points` | Up to 20 newest structures; up to 10 order blocks, fair value gaps, equal levels and swing pivots; default pivot length `50` | | `order_blocks` | Active swing `order_blocks` (with `overlapping_blocks`) and broken `breaker_blocks` (with `break_time`) | Sorted nearest to `price` by `distance_pct` (negative below price); default pivot length `5` | | `fvg_sessions` | `current_session` UTC range and up to 10 newest session opening `gaps` with `mitigated` and `mitigation_time` | Marks UTC sessions; sending `timeframe` coarser than `1H` returns `400` | | `swings` | `deviation_pct`, trend `regime` (`uptrend`, `downtrend`, `range`, `transition`, `indeterminate`), `last_bos`, `last_choch`, and up to 50 newest zigzag `points` (`HH`, `HL`, `LH`, `LL`) | Default `deviation_pct` adapts to `timeframe`: `0.4` (`1m`, `5m`), `0.7` (`15m`, `30m`), `1` (`1H`), `2` (`4H`), `5` (`1D`), `8` (`1W`) | | `volume_zones` | Up to 20 high-volume support and resistance `zones` nearest `price`, with `volume_delta`, `broken`, `break_time` and `distance_pct` | Sorted nearest to `price` first | | `monte_carlo` | 100 shuffled paths forward over the last 50 candle bodies, with `start_price`, `end_price`, `highest_price`, `lowest_price`, `standard_deviation` and 50-bar `envelope` | Returns `null` if too few candles are available | ## Tuning parameters and related endpoints * **Pivot and swing overrides.** Pass `swing_length` (`5` to `100`) to override the pivot window for both `smc` and `order_blocks`. Pass `deviation_pct` (`0.1` to `20`) to override the minimum percentage move for `swings`. * **Venue filtering.** With `exchange=darvas`, pass comma-separated `venues` (such as `venues=binance,bybit,okx`) to restrict aggregation; sending `venues` with any single exchange returns `400`. Aggregated answers return `constituents` and `venues` (`null` when unfiltered); single-exchange answers omit both. * **Formulas.** A formula `ticker` such as `USDTBTC`, `BTCUSDT*USDTETH`, `BTCUSDT/NVDAUSDT` or `1 / [okx:BTC-USDT-SWAP]` runs every engine over the formula's candles, joined from its legs' candles at the times all of them hold one. The answer carries `exchange` `formula`, `market_type` `synthetic`, the canonical `ticker`, a `display_symbol` and the `legs`. Volume-weighted engines (`volume_zones`) see volume `0` on a multi-leg formula. The [prices page](/crypto/prices#inverse-ratio-and-spread-formulas) explains the syntax and the crypto-only rule. * **Related endpoints.** Combine structure levels with precomputed moving averages and momentum at [`/crypto/indicators`](/crypto/technical-indicators), full OHLCV history at [`/crypto/prices`](/crypto/prices), price-level order flow at [`/crypto/footprint`](/crypto/footprint-charts), and single-call positioning context at [`/crypto/context`](/crypto/market-context). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/market-structure", headers=headers, params={ "ticker": "BTC-USDT-SWAP", "timeframe": "1H", "modules": "smc,order_blocks,swings,volume_zones", "lookback": 300, }, ).json() print("Price:", resp["price"], "Regime:", resp["swings"]["regime"]) print("Latest SMC break:", resp["smc"]["structures"][0] if resp["smc"]["structures"] else None) nearest_ob = resp["order_blocks"]["order_blocks"][:2] for ob in nearest_ob: print("Order block:", ob["bias"], ob["bottom"], ob["top"], "dist %:", ob["distance_pct"]) ``` ```bash theme={null} # Smart Money Concepts and swings of the BTC to NVDA ratio on hourly candles curl -H "X-API-KEY: $DARVAS_API_KEY" -G "https://api.darvas.app/v1/crypto/market-structure" \ --data-urlencode "ticker=BTCUSDT/NVDAUSDT" \ --data-urlencode "modules=smc,swings" # Run session fair value gaps and Monte Carlo projection on 15-minute aggregated ETH perpetual candles curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/market-structure?ticker=ETH-USDT-SWAP&exchange=darvas&venues=binance,bybit,okx&timeframe=15m&modules=fvg_sessions,monte_carlo&lookback=250" ``` # Crypto Open Interest Scanner & Surge API Source: https://docs.darvas.app/crypto/open-interest-scanner openapi.yaml POST /crypto/derivatives/oi-scan Rank OKX perpetual and futures contracts by open interest percent change from 5m to 1D bars with minimum OI, 24h volume and momentum filters. ## Overview This endpoint ranks OKX perpetual swap or futures contracts by how much their open interest built up or decayed over the chosen bar window. Send the filters as a JSON body by `POST`; each row returns the contract's open interest in USD, its change in USD and percent, 24-hour volume, last price and a `direction` label. | Coverage | Details | | - | - | | Markets | `market_type`: `swap` (default) or `futures` | | Window | `timeframe`: `5m`, `15m`, `1H` (default), `4H` or `1D`, the bar over which open interest change is measured | | Filters | `min_oi_usd`, `min_vol_usd_24h` and `min_abs_oi_delta_pct`, all optional | | Sort | `sort_by`: `oi_delta_pct` (default), `oi_usd`, `oi_delta_usd`, `vol_usd_24h` or `last`; `sort_order`: `desc` (default) or `asc` | | Results | `limit` from `1` to `100` (default `25`) | | MCP tool | `scan_crypto_oi_change` on the [data API MCP server](/mcp-server) | ## Filters and fields * **Filters.** `min_oi_usd` and `min_vol_usd_24h` drop contracts below that open interest or 24-hour volume in USD. `min_abs_oi_delta_pct` keeps moves of at least that size either way, in percent: `1.5` means 1.5 percent. A field the schema does not list returns `400`. * **Ranking.** `sort_order: "desc"` on `oi_delta_pct` puts the strongest buildup first; `asc` puts the strongest decay first. * **Rows.** Each result has `ticker` (such as `BTC-USDT-SWAP`), `oi_usd`, `oi_delta_usd` and `oi_delta_pct` (in percent, rounded to four places), `vol_usd_24h` and `last`. * **Direction.** `direction` is `accumulation` when `oi_delta_pct` is above zero, `distribution` below zero and `flat` at zero. * **Freshness.** `as_of` is when Darvas produced the answer; identical scans may be served from a cache for up to a minute. A filter the exchange rejects returns `400`, and an outage returns `503`. For one contract's open interest, funding and long/short history, see [`/crypto/derivatives`](/crypto/derivatives). To combine open interest with technical conditions, see [`/crypto/screener`](/crypto/screener). For estimated liquidation levels of a contract, see [`/crypto/liquidations/heatmap`](/crypto/liquidation-heatmap). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.post( "https://api.darvas.app/v1/crypto/derivatives/oi-scan", headers=headers, json={ "market_type": "swap", "timeframe": "1H", "min_oi_usd": 10_000_000, "min_vol_usd_24h": 25_000_000, "min_abs_oi_delta_pct": 1.5, "sort_by": "oi_delta_pct", "sort_order": "desc", "limit": 25, }, ) resp.raise_for_status() scan = resp.json() print("As of:", scan["as_of"]) for row in scan["results"]: print(row["ticker"], row["direction"], f'{row["oi_delta_pct"]}%', "OI USD:", row["oi_usd"], "last:", row["last"]) ``` ```bash theme={null} # Strongest 4-hour open interest decay among perpetuals with at least 50M USD of open interest curl -X POST "https://api.darvas.app/v1/crypto/derivatives/oi-scan" \ -H "X-API-KEY: $DARVAS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"market_type":"swap","timeframe":"4H","min_oi_usd":50000000,"sort_by":"oi_delta_pct","sort_order":"asc","limit":10}' ``` # Crypto Options Max Pain, GEX & IV Surface API Source: https://docs.darvas.app/crypto/options-analytics openapi.yaml GET /crypto/derivatives/options-analytics Merge Deribit, OKX and Bybit option chains of a coin into max pain, dealer gamma exposure with flip and walls, put/call ratios, skew and an IV surface by delta. ## Overview This endpoint merges the Deribit, OKX and Bybit option chains of one coin. `summary` gives open interest and put/call ratios with dealer gamma exposure per 1% move, the gamma flip price, the call and put walls, and vanna and charm exposure. `max_pain` gives the focus expiry's max pain strike with its payout curve, `expiries` the same per expiry with delta skew, and `gex_by_strike` gamma exposure by strike. `term_structure` gives each expiry's ATM implied volatility with its slope from 7 to 90 days, and `vol_surface` a constant-maturity surface at 7, 14, 30, 60, 90 and 180 days by delta (10 and 25 delta puts and calls and ATM). | Coverage | Details | | - | - | | Venues | `deribit`, `okx` and `bybit` | | Coins | BTC, ETH and any coin a venue lists options on | | Strikes | `gex_by_strike` within `strike_range_pct` of spot; 30 by default | | Units | GEX in US dollars per 1% move, IV in annualized percent, skew in vol points | | MCP tool | `get_crypto_options_analytics` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/derivatives/options-analytics", headers=headers, params={ "underlying": "BTC", "strike_range_pct": 20, }, ).json() summary = answer["summary"] print(summary["net_gex_usd_per_1pct_move"], summary["gamma_flip_price_usd"], summary["put_call_oi_ratio"]) print(answer["max_pain"]["max_pain_strike_usd"], answer["term_structure"]["regime"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/derivatives/options-analytics?underlying=BTC&strike_range_pct=20" ``` # Live Crypto Options Chain & Greeks API (OKX) Source: https://docs.darvas.app/crypto/options-chain openapi.yaml GET /crypto/derivatives/option-chain Query live BTC-USD, ETH-USD and SOL-USD options chains on OKX with bid, ask, mark, open interest, 24h volume, implied volatility and full Greeks. ## Overview This endpoint returns the live options chain of a coin-margined USD option family on OKX, such as `BTC-USD`, `ETH-USD` or `SOL-USD`. Each contract joins its specification (expiry, strike, contract value, lot and tick size), best bid, ask and last premium, 24-hour volume, open interest and, by default, its Greeks, implied volatilities and forward price. Contracts that are not live, such as suspended ones, are left out. | Coverage | Details | | - | - | | Exchange | OKX options (`exchange: "okx"`) | | Underlyings | `underlying`: a USD option family such as `BTC-USD` (default), `ETH-USD` or `SOL-USD` | | Filters | `expiry` (`YYMMDD`, such as `261225`), `option_type` (`call` or `put`), `min_strike` and `max_strike` in USD | | Greeks | `include_greeks=true` (default) adds delta, gamma, vega, theta, mark, bid and ask IV, and forward price | | Results | `limit` from `1` to `500` contracts (default `200`), sorted by expiry, then strike, then call before put | | MCP tool | `list_crypto_options_chain` on the [data API MCP server](/mcp-server) | ## Chain and contract fields * **Expiries and counts.** `expiries` lists every expiry code the family has, whatever the filters, so one call without `expiry` discovers them. `total_matched` counts the contracts that pass the filters before `limit` cuts the list, and `as_of` is the newest quote or Greeks timestamp. * **Contract.** `ticker` (such as `BTC-USD-261225-100000-C`), `expiry`, `expiry_time` (the settlement time in UTC), `strike` in USD and `option_type`. * **Quotes.** `last`, `bid_price` and `ask_price` are premiums in the underlying coin (BTC for `BTC-USD`), not USD. `bid_size`, `ask_size`, `volume_24h` and `open_interest` are in contracts, and `contract_value` is the underlying amount one contract covers. * **Greeks.** `delta`, `gamma`, `vega` and `theta` (daily decay), `mark_iv`, `bid_iv` and `ask_iv` as annualized decimals (`0.54` is 54 percent) and `forward_price`, the implied forward of the underlying at that expiry. With `include_greeks=false`, these fields are left out of each contract. * **Errors.** A family with no listed contracts returns `404`, and a `min_strike` above `max_strike` returns `400`. For skew, term structure and implied against realized volatility per expiry, see [`/crypto/derivatives/iv-skew`](/crypto/options-iv-skew). For perpetual funding and open interest, see [`/crypto/derivatives`](/crypto/derivatives). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/crypto/derivatives/option-chain" expiries = requests.get(url, headers=headers, params={"underlying": "BTC-USD", "limit": 1}).json()["expiries"] expiry = expiries[1] if len(expiries) > 1 else expiries[0] chain = requests.get( url, headers=headers, params={"underlying": "BTC-USD", "expiry": expiry, "min_strike": 80000, "max_strike": 120000}, ).json() print("Expiry:", expiry, "Contracts:", chain["total_matched"], "As of:", chain["as_of"]) for c in chain["contracts"]: print(c["ticker"], c["bid_price"], c["ask_price"], "delta:", c["delta"], "IV:", c["mark_iv"], "OI:", c["open_interest"]) ``` ```bash theme={null} # ETH-USD puts of one expiry, quotes and specs only curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/derivatives/option-chain?underlying=ETH-USD&expiry=261225&option_type=put&include_greeks=false" ``` # Crypto Options IV Skew & Term Structure API Source: https://docs.darvas.app/crypto/options-iv-skew openapi.yaml GET /crypto/derivatives/iv-skew Measure BTC, ETH and SOL options ATM implied volatility, 25-delta risk reversal, butterfly, term structure regime and IV minus realized vol spreads. ## Overview This endpoint computes the volatility surface summary of a coin-margined USD option family on OKX, such as `BTC-USD`, `ETH-USD` or `SOL-USD`. For each expiry it returns the at-the-money implied volatility, the 25-delta call and put IV, the 25-delta risk reversal (`rr25`) and butterfly (`bf25`). It adds the ATM term structure with its slope and regime, and the 7, 30 and 90-day realized volatility of the spot market with the implied minus realized spread. Every volatility is an annualized decimal (`vol_unit: "annualized_decimal"`, so `0.54` is 54 percent). | Coverage | Details | | - | - | | Exchange | OKX options (`exchange: "okx"`) | | Underlyings | `underlying`: a USD option family such as `BTC-USD` (default), `ETH-USD` or `SOL-USD` | | Per expiry | `atm_iv`, `atm_strike`, `call_25d_iv`, `put_25d_iv`, `rr25`, `bf25`, `forward_price`, `days_to_expiry`, `contract_count` | | Term structure | Front and back ATM IV, `slope` and `regime` (`contango`, `backwardation` or `flat`) | | Realized volatility | `include_realized_vol=true` (default) adds 7, 30 and 90-day realized volatility and IV minus RV spreads | | MCP tool | `get_crypto_options_iv_skew` on the [data API MCP server](/mcp-server) | ## How the values are computed * **ATM IV.** For each expiry, Darvas takes the call and the put whose delta is closest to 0.5 and averages their mark IV (one side's IV when only one exists); `atm_strike` is the strike of that call, or of the put when no call exists. * **25-delta wings.** `call_25d_iv` and `put_25d_iv` are the mark IV of the call and put whose absolute delta is closest to 0.25, within 0.10 of it, else `null`. `rr25` is `call_25d_iv` minus `put_25d_iv`, so a negative value means puts are priced richer; `bf25` is the average of the two wings minus `atm_iv`. Both are `null` without both wings. * **Expiry rows.** `expiries` is sorted nearest first, with `expiry` (`YYMMDD`), `expiry_date`, `days_to_expiry` (calendar days to 08:00 UTC on the expiry date) and `contract_count`, the valid contracts behind the row. * **Term structure.** `front_expiry` and `back_expiry` are the nearest and farthest expiries in `expiries`, and `slope` is `back_atm_iv` minus `front_atm_iv`. `regime` is `contango` above 0.005, `backwardation` below minus 0.005 and `flat` between; `slope` and `regime` are `null` with fewer than two expiries. `points` lists every expiry's ATM IV in order. * **Realized volatility.** `rv_7d`, `rv_30d` and `rv_90d` are close-to-close realized volatility of the OKX spot market `spot_ticker` (such as `BTC-USDT`) from daily candles, annualized with the square root of 365, and `null` when too few candles exist. The spreads use the `reference_expiry`, the expiry closest to 30 days out: `iv_rv_spread_30d` is `reference_atm_iv` minus `rv_30d`, and so on. With `include_realized_vol=false`, `realized_vol` is `null`. A family without options data returns `404`. For the contracts and Greeks behind these numbers, see [`/crypto/derivatives/option-chain`](/crypto/options-chain). For spot candles, see [`/crypto/prices`](/crypto/prices). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} skew = requests.get( "https://api.darvas.app/v1/crypto/derivatives/iv-skew", headers=headers, params={"underlying": "BTC-USD"}, ).json() term = skew["term_structure"] print("Regime:", term["regime"], "Slope:", term["slope"], "As of:", skew["as_of"]) for row in skew["expiries"]: print(row["expiry_date"], "DTE:", row["days_to_expiry"], "ATM IV:", row["atm_iv"], "RR25:", row["rr25"], "BF25:", row["bf25"]) rv = skew["realized_vol"] if rv is not None: print("Reference:", rv["reference_expiry"], "IV:", rv["reference_atm_iv"], "RV 30d:", rv["rv_30d"], "IV-RV 30d:", rv["iv_rv_spread_30d"]) ``` ```bash theme={null} # ETH-USD skew and term structure without realized volatility curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/derivatives/iv-skew?underlying=ETH-USD&include_realized_vol=false" ``` # Live L2 Crypto Order Book Depth & Spread API Source: https://docs.darvas.app/crypto/order-book openapi.yaml GET /crypto/order-book Query live Level 2 crypto order book bids, asks, spread and depth imbalance from a single exchange or merged across multiple top crypto venues. ## Overview Query the live Level 2 order book of any supported crypto spot or perpetual swap market. By default (`exchange=darvas`), Darvas reads every constituent exchange of a Darvas pair simultaneously and merges resting bids and asks price level by price level. Every quantity is normalized to the base asset, including OKX perpetual contracts converted from contract counts into coins. | Coverage | Details | | - | - | | Aggregated book | `darvas` (default) merges live OKX, Binance, Bybit and Hyperliquid books for a Darvas pair such as `BTC-USDT-SWAP` or `BTC-ALLUSD` | | Single exchanges | `okx`, `binance`, `bybit` and `hyperliquid` (Hyperliquid perpetuals only, capped at 20 levels per side) | | Market types | Spot and perpetual swap; dated futures and options return HTTP `400` | | Depth range | `depth` from `1` to `400` levels per side (default `50`), read from each constituent venue | | Computed summary | Best bid and ask, mid price, spread, four percentage depth bands and the five largest bid and ask walls | | MCP tool | `get_crypto_order_book` on the [data API MCP server](/mcp-server) | ## Parameters Pass `ticker` for every call and refine aggregation, depth, price grouping or payload size with optional query parameters. | Parameter | Type | Default | Description | | - | - | - | - | | `ticker` | string | required | Darvas pair (such as `BTC-USDT-SWAP`) or exchange-native symbol (such as `perpetual:BTCUSDT`). | | `exchange` | string | `darvas` | Venue selector: `darvas` for merged cross-venue depth, or one of `okx`, `binance`, `bybit`, `hyperliquid`. | | `market_type` | string | inferred | Optional `spot` or `swap` disambiguator when a ticker string is ambiguous. | | `venues` | string | `null` | Comma-separated subset of exchanges to merge when `exchange=darvas`; rejected with `400` for single-exchange calls. | | `depth` | integer | `50` | Number of bid and ask levels to read per exchange and include in the response (`1` to `400`). | | `grouping` | number | `null` | Coarse price increment for bucketing levels, such as `10` for 10-dollar ticks on BTC. | | `include_levels` | string | `true` | Set `false` to omit raw `bids` and `asks` arrays while keeping all summary metrics and `sources`. | ## Response fields ### Top-of-book and spread Top-of-book fields summarize execution cost at the touch across the chosen venue or merged book: * `best_bid` and `best_ask`: highest bid price and lowest ask price in the active book. * `mid_price`: arithmetic midpoint between `best_bid` and `best_ask`. * `spread` and `spread_percent`: `best_ask - best_bid` and the spread as a percentage of `mid_price`. On a merged `darvas` book, `spread` can turn negative when one exchange's best bid sits above another exchange's best ask. ### Depth bands and liquidity walls Depth summaries measure resting liquidity away from the mid price without scanning raw level arrays on the client: 1. **Percentage depth bands (`depth`).** Four buckets covering `0.25%`, `0.5%`, `1%` and `2%` from `mid_price`. Each bucket reports `bid_size` and `ask_size` in base coins, `bid_notional` and `ask_notional` in quote currency and `bid_share` (`null` if both sides are empty). Raise the `depth` query parameter when wide bands need deeper exchange coverage. 2. **Resting liquidity walls (`bid_walls`, `ask_walls`).** Lists up to the five largest price levels on each side with `price` and `size`, sorted by resting size so large support and resistance clusters stand out immediately. ### Price level grouping and summary mode * **Price bucketing (`grouping`).** Bids round down and asks round up onto the requested step so grouped levels never cross each other. When omitted, native exchange ticks remain intact and the payload echoes `grouping: null`. * **Lightweight polling (`include_levels=false`).** Returns empty `bids: []` and `asks: []` arrays while preserving `best_bid`, `best_ask`, `depth`, `bid_walls`, `ask_walls`, `bid_levels`, `ask_levels` and `sources`. | Field | Description | | - | - | | `ticker`, `exchange`, `market_type`, `size_unit` | Resolved instrument, venue mode, market type (`spot` or `swap`) and `base` size unit. | | `constituents`, `venues` | Present for `exchange=darvas`: all constituent venues of the pair and the applied `venues` filter (`null` when unfiltered). | | `as_of`, `grouping` | UTC timestamp of the newest venue book read, plus the active price grouping increment or `null`. | | `bids`, `asks` | Ordered level arrays (best price first), each item containing `price`, `size` and `notional`. | | `bid_levels`, `ask_levels` | Total bid and ask levels present in the built book before any `include_levels=false` trimming. | | `sources` | Per-exchange diagnostics carrying `exchange`, `ticker`, `status`, `as_of`, best prices and level counts. | ## Exchange sources and error handling ### Source status codes Every element in `sources` reports how each constituent exchange contributed to the response: * `ok`: Darvas read the live exchange order book and merged its levels into the output. * `unavailable`: the exchange request failed at query time, so the merged book excludes that venue without failing the entire call. * `unsupported`: the instrument trades on that exchange, but Darvas does not collect live L2 books from that venue. ### HTTP status responses 1. `400 Bad Request`: invalid ticker, unsupported market type (such as dated futures or options), a `venues` filter on a non-`darvas` exchange, or a Darvas pair whose venues have no readable order books. 2. `404 Not Found`: a single-exchange book returned an empty bid or ask side at the moment of the request. 3. `503 Service Unavailable`: the requested single exchange failed, or every readable constituent exchange of a merged `darvas` pair failed simultaneously. ### Related order-flow endpoints * Historical resting liquidity over time: [`/crypto/order-book/heatmap`](/crypto/order-book-heatmap) * Price-level aggressive volume and delta: [`/crypto/footprint`](/crypto/footprint-charts) and [`/crypto/order-flow`](/crypto/order-flow) * Instrument discovery and Darvas pair definitions: [`/crypto/tickers`](/crypto/tickers) ## Examples ### Merged book with price grouping Read a 200-level aggregated `BTC-USDT-SWAP` book grouped onto 10-dollar ticks and inspect depth imbalance, venue status and resting walls. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} book = requests.get( "https://api.darvas.app/v1/crypto/order-book", headers=headers, params={"ticker": "BTC-USDT-SWAP", "depth": 200, "grouping": 10}, ).json() print("Mid:", book["mid_price"], "Spread %:", book["spread_percent"]) for band in book["depth"]: print(f'{band["percent"]}% band: bid {band["bid_size"]} / ask {band["ask_size"]}, bid share {band["bid_share"]}') for source in book["sources"]: print(source["exchange"], source["status"], source["bid_levels"], source["ask_levels"]) print("Largest bid wall:", book["bid_walls"][0], "Largest ask wall:", book["ask_walls"][0]) ``` ### Single-exchange summary without raw levels Poll spread, depth bands and top walls across 400 levels of Binance `BTCUSDT` perpetual while omitting the raw level lists for minimal payload size. ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/order-book?ticker=perpetual:BTCUSDT&exchange=binance&depth=400&include_levels=false" ``` # Crypto Order Book Liquidity Heatmap Data API Source: https://docs.darvas.app/crypto/order-book-heatmap openapi.yaml GET /crypto/order-book/heatmap Retrieve historical resting limit-order liquidity per price level and time bar to detect spoofing, resting walls and liquidity sweeps on crypto pairs. ## Overview This endpoint returns the order book over time for one exchange's spot or perpetual swap market. For each bar and price row, `bid_size` and `ask_size` are the time-weighted average size resting on the bid and the ask, and `bid_max` and `ask_max` are the largest size a single sample of the bar saw. The values come from the one-second samples of the OKX, Binance and Bybit books Darvas records. | Coverage | Details | | - | - | | Exchanges | `okx` (default), `binance` and `bybit`, one exchange per request | | Markets | Spot and perpetual swap; other market types return `400` | | Bar sizes | `interval`: `1m`, `5m`, `15m` (default), `30m`, `1H`, `2H`, `4H`, `1D` and `1W` | | Window | `120` bars ending at the open bar by default; at most `600` bars | | Price rows | At most `400` rows; at least the stored band of 1 basis point for `1m` and `5m`, 5 for `15m` and `30m`, 10 above | | Cell cap | 120,000 cells; when capped, `limited` is `true` and the newest whole bars are kept | | MCP tool | `get_crypto_order_book_heatmap` on the [data API MCP server](/mcp-server) | ## Window, price range and rows * **Time window.** Pass `start_time` and `end_time` as ISO 8601 timestamps (`2026-11-27T00:00:00Z`), UTC dates (`2026-11-27`) or Unix milliseconds. Without `end_time`, the window ends at the end of the open bar; without `start_time`, it starts 120 bars before `end_time`. A window over 600 bars, or an `end_time` that is not after `start_time`, returns `400`. * **Price range.** `low` and `high` bound the rows. Without them, the range is the window's lowest candle low less half a percent and its highest candle high plus half a percent; send one and the other comes from the candles. `low` must be below `high`, and a window without candles returns `404` unless both are sent. * **Row height.** `row_size` sets the smallest row height in price, such as `row_size=25` for 25-dollar rows on BTC. Rows still grow until the range fits 400 of them, and the answer's `row_size` is the height used (`0` when the window holds no book). * **Cells.** Each entry in `cells` gives `time` and `time_milliseconds` (the bar's start), `price` (the row's low price, spanning `row_size` above it), `bid_size`, `ask_size`, `bid_max` and `ask_max`. Cells are sorted newest bar first, then lowest row first. * **Persistent walls.** `bid_walls` and `ask_walls` rank the five rows with the most size on average across every bar of the window (`price`, `average_size`). They show liquidity that stayed rather than one bar's spike. For the live book at this moment, see [`/crypto/order-book`](/crypto/order-book). For estimated liquidation clusters, see [`/crypto/liquidations/heatmap`](/crypto/liquidation-heatmap). For taker volume per price, see [`/crypto/footprint`](/crypto/footprint-charts). ## Examples ```python theme={null} import os from collections import defaultdict import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} heatmap = requests.get( "https://api.darvas.app/v1/crypto/order-book/heatmap", headers=headers, params={ "ticker": "BTC-USDT-SWAP", "exchange": "okx", "interval": "1H", "start_time": "2026-11-27T00:00:00Z", "end_time": "2026-11-28T00:00:00Z", "row_size": 25, }, ).json() print("Row size:", heatmap["row_size"], "Limited:", heatmap["limited"]) for wall in heatmap["bid_walls"]: print("Persistent bid wall:", wall["price"], "average size:", wall["average_size"]) bid_by_bar = defaultdict(float) for cell in heatmap["cells"]: bid_by_bar[cell["time"]] += cell["bid_size"] for time, size in sorted(bid_by_bar.items())[-5:]: print(time, "resting bid size in range:", round(size, 2)) ``` ```bash theme={null} # Bybit spot BTCUSDT, 5-minute bars, last 120 bars between 95,000 and 100,000 curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/order-book/heatmap?ticker=spot:BTCUSDT&exchange=bybit&interval=5m&low=95000&high=100000" ``` # Order Book Imbalance & Slippage History API Source: https://docs.darvas.app/crypto/order-book-imbalance openapi.yaml GET /crypto/order-book/imbalance-history Get per-bar bid and ask depth around the mid, order book imbalance and market order slippage from books recorded every second on OKX, Binance and Bybit. ## Overview This endpoint returns, per bar, the resting bid and ask depth within each range of the book's mid, its imbalance from -1 to 1, and the slippage a market order of each dollar size would have paid. It reads the books Darvas records every second on OKX, Binance and Bybit spot and perpetual markets, oldest bar first. A range is `complete` only where the stored book reached it on both sides; `summary` gives each range's mean and newest imbalance over the complete bars. | Coverage | Details | | - | - | | Venues | `okx` (default), `binance` and `bybit`, spot and perpetual swaps | | Bars | 1m, 5m, 15m, 30m, 1H, 2H, 4H, 1D or 1W; 168 bars by default, 1,000 at most | | Ranges | Up to 6 ranges from 0.05% to 10%; 0.5, 1, 2 and 5 by default | | Order sizes | Up to 4 sizes in US dollars; 100,000 and 1,000,000 by default | | MCP tool | `get_crypto_order_book_imbalance_history` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/order-book/imbalance-history", headers=headers, params={ "ticker": "BTC-USDT-SWAP", "exchange": "okx", "interval": "1H", }, ).json() for bar in answer["bars"][-3:]: depth = bar["depth"][1] print(bar["time"], depth["range_pct"], depth["imbalance_decimal"], bar["slippage"][0]["buy_slippage_bps"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/order-book/imbalance-history?ticker=BTC-USDT-SWAP&exchange=okx&interval=1H" ``` # Crypto Order Flow, CVD & Delta Bars API Source: https://docs.darvas.app/crypto/order-flow openapi.yaml GET /crypto/order-flow Fetch bar-by-bar crypto buy volume, sell volume, bar delta and cumulative volume delta (CVD) across single exchanges or the Darvas composite feed. ## Overview Darvas splits every recorded trade by taker side to compute `buy_volume`, `sell_volume`, `delta` (`buy_volume` minus `sell_volume`), `buy_trades`, `sell_trades`, and the intrabar `min_delta` and `max_delta`. Order flow is stored across three retention tiers so coarser frames keep deeper history without losing intrabar delta extremes: multi-bar rollups (`5m` from `1m`, `30m` from `15m`, and `4H` from `1H`) add each sub-bar's extreme to the cumulative delta of prior sub-bars inside the bucket. | Coverage | Details | | - | - | | Aggregated feed | `darvas` sums order flow across every trade-recorded exchange (OKX, Binance, Bybit, Hyperliquid) that lists the pair, including `ALLUSD` pairs (`BTC-ALLUSD`, `BTC-ALLUSD-SWAP`) | | Single exchanges | `okx` (default), `binance`, `bybit` and `hyperliquid` | | Retention tiers | `1m` and `5m`: 13 months; `15m` and `30m`: 37 months; `1H`, `4H` and `1D`: permanent retention (Binance and Bybit history begins 23 November 2026) | | Frames | `minute` x 1 (default), 5, 15, 30; `hour` x 1, 4; `day` x 1, in UTC | | Page size | 500 bars; pages walk back in time from `end_date`, `limit` up to 50,000 (default 5,000) | | MCP tool | `list_crypto_order_flow` on the [data API MCP server](/mcp-server) | ## Retention tiers, aggregated flow and venue filtering Choosing a coarser frame extends lookback depth while keeping exact cumulative delta and intrabar delta extremes: * **Tiered history.** `minute` x 1 and `minute` x 5 read from 1-minute stored bars retained for 13 months. `minute` x 15 and `minute` x 30 read from 15-minute stored bars retained for 37 months. `hour` x 1, `hour` x 4, and `day` x 1 read from hourly and daily stored bars retained permanently. * **Aggregated order flow.** Pass `exchange=darvas` to sum base-unit buy and sell volumes and trade counts across all recorded venues for a pair, and optionally pass `venues=binance,okx` to narrow aggregation to specific venues. Sending `venues` with a single exchange returns `400`. * **Scope fields and pagination.** Responses for `exchange=darvas` include `constituents` (all exchanges the pair combines) and `venues` (the filtered subset, or `null` when all constituents are included). Both fields are omitted for single-exchange requests. Each page lists its bars oldest first; follow `next_page_url` to page backward to `start_date`. * **Related endpoints.** Need volume and trade counts broken down at every price level inside each bar? Use [`/crypto/footprint`](/crypto/footprint-charts). For raw executions, see [`/crypto/trades`](/crypto/trades). For high-notional whale sweeps, see [`/crypto/large-trades`](/crypto/large-trades). ## Examples ```bash theme={null} # Aggregated 15-minute order flow for BTC perpetuals across Binance, Bybit and OKX curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/order-flow?ticker=BTC-USDT-SWAP&exchange=darvas&venues=binance,bybit,okx&interval=minute&interval_multiplier=15&start_date=2026-11-25" ``` ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/order-flow", headers=headers, params={ "ticker": "BTC-ALLUSD-SWAP", "exchange": "darvas", "interval": "hour", "interval_multiplier": 1, "start_date": "2026-11-24", }, ).json() for bar in resp["order_flow"][-3:]: print(bar["time"], bar["delta"], bar["buy_trades"], bar["sell_trades"], bar["min_delta"], bar["max_delta"]) ``` # Live Crypto Price Snapshot API (Multi-Venue) Source: https://docs.darvas.app/crypto/price-snapshot openapi.yaml GET /crypto/prices/snapshot Get the latest spot or perpetual contract price, 24h change, high, low and volume for any supported crypto symbol on a single or composite venue. ## Overview This endpoint returns the latest minute close of a crypto instrument or Darvas aggregated pair, the current UTC day's OHLCV candle so far, and the change since the UTC day opened. | Coverage | Details | | - | - | | Aggregated feed | `darvas` combines every primary exchange listing the pair, including `ALLUSD` pairs (`BTC-ALLUSD`, `BTC-ALLUSD-SWAP`), with optional `venues` filtering | | Single exchanges | `okx` (default), `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Formulas | Inverses, ratios, spreads and arithmetic over listed crypto instruments, typed (`USDTBTC`, `BTCUSDT*USDTETH`, `BTCUSDT/NVDAUSDT`, `COINBASE:BTCUSD - BINANCE:BTCUSDT`) or canonical (`1 / [okx:BTC-USDT-SWAP]`), on `exchange=formula` | | Price basis | `price` is the close of the newest minute, open minute included; `day_change` and `day_change_percent` compare it with the current UTC day's open | | MCP tool | `get_crypto_price_snapshot` on the [data API MCP server](/mcp-server) | With `exchange=darvas`, the `snapshot` object includes `constituents` (every exchange the pair combines) and `venues` (the comma-separated subset requested, or `null` when all constituents are combined). Sending `venues` with a single exchange returns `400`. A formula `ticker` such as `USDTBTC`, `BTCUSDT*USDTETH`, `BTCUSDT/NVDAUSDT` or `1 / [okx:BTC-USDT-SWAP]` answers on `exchange` `formula` with `market_type` `synthetic`, the canonical formula as `ticker`, a `display_symbol` and its `legs`. `price` is the formula of the newest minute every leg holds, and the day's candle is the formula of the legs' UTC day candles. Every leg is a listed crypto instrument; a CFD or partner broker leg returns `400`. [`/crypto/prices`](/crypto/prices#inverse-ratio-and-spread-formulas) explains the formula syntax. Use [`/crypto/tickers`](/crypto/tickers) to find valid IDs, [`/crypto/prices`](/crypto/prices) for historical candles and [`/crypto/indicators`](/crypto/technical-indicators) for technicals. ## Examples ```bash theme={null} # How much BTC one USDT buys: the inverse of BTC/USDT curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/prices/snapshot?ticker=USDTBTC&exchange=formula" # Aggregated BTC spot price across all USD, USDT and USDC exchanges curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/prices/snapshot?ticker=BTC-ALLUSD&exchange=darvas" # Aggregated BTC perpetual snapshot limited to Binance, Bybit and OKX curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/prices/snapshot?ticker=BTC-USDT-SWAP&exchange=darvas&venues=binance,bybit,okx" ``` ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} snap = requests.get( "https://api.darvas.app/v1/crypto/prices/snapshot", headers=headers, params={"ticker": "BTC-USD", "exchange": "coinbase"}, ).json()["snapshot"] print(snap["price"], snap["day_change_percent"], snap["volume"]) ``` # Crypto Historical OHLCV Prices & Formula API Source: https://docs.darvas.app/crypto/prices openapi.yaml GET /crypto/prices Query crypto spot and perpetual OHLCV bars across 9 exchanges, Darvas composite feeds and custom spread formulas with cursor pagination up to 500. ## Overview This endpoint returns historical and live OHLCV candles from one minute to one month for Darvas aggregated pairs (`exchange=darvas`) and for single instruments across nine primary crypto exchanges. The open candle in progress arrives on the newest page. | Coverage | Details | | - | - | | Aggregated feed | `darvas` combines every primary exchange that lists a spot or perpetual swap pair, plus `ALLUSD` pairs (`BTC-ALLUSD`, `BTC-ALLUSD-SWAP`) that merge USD, USDT and USDC markets | | Single exchanges | `okx` (default), `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Formulas | Inverses, ratios, spreads and arithmetic over listed crypto instruments, typed (`USDTBTC`, `BTCUSDT*USDTETH`, `BTCUSDT/NVDAUSDT`, `COINBASE:BTCUSD - BINANCE:BTCUSDT`) or canonical (`1 / [okx:BTC-USDT-SWAP]`), on `exchange=formula` | | Frames | `minute` x 1, 5, 15, 30; `hour` x 1, 2, 4, 6, 12; `day` (default), `week`, `month` x 1, in UTC | | Updated | Live: the newest minute updates as trades arrive | | Page size | 500 candles; `limit` counts across pages, default 5,000, up to 50,000 | | MCP tool | `list_crypto_prices` on the [data API MCP server](/mcp-server) | ## Aggregated feeds and venues Pass `exchange=darvas` to combine every exchange that lists a canonical pair: `BASE-QUOTE` for spot (`BTC-USDT`, `BTC-ALLUSD`) or `BASE-QUOTE-SWAP` for perpetuals (`BTC-USDT-SWAP`, `BTC-ALLUSD-SWAP`). * **Price and volume math.** Each aggregated candle takes the median open and close across reporting exchanges, drops closes more than 25% off the median and wicks more than 5% past the median high or low when three or more exchanges report, and sums base `volume` and `quote_volume`. * **ALLUSD stablecoin guard.** On `ALLUSD` pairs, if USDT or USDC strays more than 0.5% from fiat USD in a candle, Darvas drops that stablecoin from the bucket so a depeg cannot pull the series. * **Venue filtering.** Pass a comma-separated `venues` list (up to 16 exchanges, such as `venues=binance,coinbase,okx`) with `exchange=darvas` to aggregate only those exchanges. Sending `venues` with any single exchange returns `400`. * **Response scope.** Answers for `exchange=darvas` include `constituents` (every exchange the pair combines) and `venues` (the filtered subset, or `null` when all constituents are combined). Both fields are absent for single-exchange requests. ## Inverse, ratio and spread formulas `ticker` also takes a formula over listed crypto instruments, written as in the chart's pair search or in the canonical form an answer names it by: | Formula | Typed | Canonical form | | - | - | - | | Inverse | `USDTBTC`, `1/BTCUSDT` | `1 / [okx:BTC-USDT-SWAP]` | | Ratio | `BTCUSDT/NVDAUSDT`, `BTC/NVDA`, `BTCNVDA`, `BTCUSDT*USDTETH` | `[okx:BTC-USDT-SWAP] / [okx:NVDA-USDT-SWAP]` | | Spread | `COINBASE:BTCUSD - BINANCE:BTCUSDT` | `[coinbase:BTC-USD] - [binance:perpetual:BTCUSDT]` | | Arithmetic | `(BTCUSDT + ETHUSDT) / 2` | `([okx:BTC-USDT-SWAP] + [okx:ETH-USDT-SWAP]) / 2` | * **Exchange.** Send `exchange=formula` to read `ticker` as a formula. Without it, a ticker no exchange lists is read as a formula before it is refused, and a symbol without an `EXCHANGE:` prefix is looked up on the `exchange` sent first. `market_type` picks the market a symbol is read in first. * **Resolution.** A typed symbol resolves as the chart's pair search resolves it: Darvas aggregated pairs first, then OKX, Binance, Bybit and the other exchanges, perpetuals before spot. `USDTBTC` with no `exchange` answers as `1 / [darvas:BTC-USDT-SWAP]` while Darvas lists that pair. The canonical form names every leg's exchange and id, so it always reads the same legs. * **Answer.** A formula answers with `exchange` `formula`, `market_type` `synthetic`, the canonical formula as `ticker`, the name Darvas shows as `display_symbol` (such as `USDTBTC` or `BTC/NVDA`) and its `legs`, each a listed instrument with `exchange`, `ticker` and `market_type`. * **Candles.** A formula's candle is the formula of its legs' candles at every time all legs hold one: open from the legs' opens, close from their closes, and high and low the highest and lowest of the formula at the legs' opens, highs, lows and closes. A one-leg formula such as an inverse keeps its leg's volume; any other formula has volume `0`. * **Crypto only.** Every leg is a listed instrument on a crypto exchange. A formula naming a CFD or partner broker symbol (such as `1 / [ctrader:EURUSD]`) returns `400`, one with a leg no exchange lists returns `404`, and `venues` with a formula returns `400`. [`/crypto/tickers`](/crypto/tickers) resolves a formula `query` to the same canonical `ticker`. ## Instrument IDs and pagination Single-exchange IDs follow each venue: `BTC-USDT` or `BTC-USDT-SWAP` on OKX, `ETH-USDC-SWAP` on Hyperliquid, `BTC-USD` on Coinbase, and `spot:BTCUSDT` or `perpetual:BTCUSDT` on Binance and Bybit. A bare Binance or Bybit symbol such as `BTCUSDT` also works with `market_type` (`spot` or `swap`, defaulting to `spot`). Use [`/crypto/tickers`](/crypto/tickers) to list every instrument and aggregated pair with its `constituents`. Pages walk back in time: the first page ends at `end_date` (today by default), each `next_page_url` continues before it, and the last page reaches `start_date`. Every page lists its candles oldest first. A formula's pages work the same way, and each page reads its legs again, so every leg stays a listed crypto instrument. For the latest price alone, see [`/crypto/prices/snapshot`](/crypto/price-snapshot). For precomputed moving averages, RSI, MACD, Bollinger Bands and ATR on these candles, see [`/crypto/indicators`](/crypto/technical-indicators). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/crypto/prices" # Aggregated BTC across USD, USDT and USDC spot markets on selected exchanges agg = requests.get( url, headers=headers, params={ "ticker": "BTC-ALLUSD", "exchange": "darvas", "venues": "binance,coinbase,kraken,okx", "interval": "hour", "interval_multiplier": 4, "start_date": "2026-11-01", }, ).json() print("Constituents:", agg["constituents"], "Filtered:", agg["venues"]) for candle in agg["prices"][-3:]: print(candle["time"], candle["close"], candle["volume"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/prices?ticker=BTC-USDT-SWAP&exchange=okx&interval=day&start_date=2026-11-01" # Daily candles of BTC priced in NVDA, from the two OKX perpetuals curl -H "X-API-KEY: $DARVAS_API_KEY" -G "https://api.darvas.app/v1/crypto/prices" \ --data-urlencode "ticker=OKX:BTC-USDT-SWAP / OKX:NVDA-USDT-SWAP" \ --data-urlencode "exchange=formula" \ --data-urlencode "start_date=2026-11-01" ``` # Crypto Screener API: 77 Technical & Flow Metrics Source: https://docs.darvas.app/crypto/screener openapi.yaml POST /crypto/screener Screen OKX crypto spot, perpetual and futures markets over POST with AND/OR conditions across 77 technical rating, RSI, MACD, volume and OI metrics. ## Overview This endpoint screens live snapshots of OKX USDT markets with a JSON body sent by `POST`. Each condition compares one of 77 metrics, from composite technical ratings, RSI, MACD and moving averages to open interest and funding, with a number, a range or another metric. A condition can also detect a crossover or read its own timeframe, and the matches come back sorted with the metrics the screen used. Call [`/crypto/screener/metrics`](/crypto/screener-metrics) first to read every valid metric ID. | Coverage | Details | | - | - | | Markets | `market_type`: `spot`, `swap` (default) or `futures`, OKX USDT instruments | | Timeframes | `timeframe`: `5m`, `15m`, `1H` (default), `4H` or `1D`, the bars technical metrics are computed on; a condition can set its own | | Universe | `universe`: `all` (default) or `altcoins`, which leaves out BTC-base pairs; `tickers` narrows it to a list of up to 200 instruments | | Conditions | Up to 12, joined by `combine`: `AND` (default) or `OR` | | Results | `limit` from `1` to `200` (default `50`), ordered by `sort` (default `volume24h`, descending) | | MCP tool | `screen_crypto_markets` on the [data API MCP server](/mcp-server) | ## Request body * **Comparisons.** Each entry in `conditions` has a `metric`, an `operator` and exactly one right-hand side: `value`, a number, or `right_metric`, another metric ID. `lt`, `lte`, `gt`, `gte` and `eq` compare the newest values. `right_multiplier` scales `right_metric`, so `{"metric": "price", "operator": "gt", "right_metric": "ema200", "right_multiplier": 1.05}` keeps markets trading more than 5% above their 200 EMA. * **Ranges.** `between` keeps values from `value` to `upper_value`, both included, and `outside` keeps values below `value` or above `upper_value`, as in `{"metric": "rsi14", "operator": "between", "value": 40, "upper_value": 60}`. * **Crossovers.** `crosses_above` matches when the metric was at or below the right-hand side on the previous bar and is above it on the newest bar; `crosses_below` is the mirror. A MACD bullish cross is `{"metric": "macd.macd", "operator": "crosses_above", "right_metric": "macd.signal"}`. Crossovers need the previous bar, so they work on price, volume and indicator metrics, not on 24-hour ticker, performance or derivatives metrics. * **Timeframe per condition.** A condition with `timeframe` reads its metrics on that bar, such as a daily RSI inside a `1H` screen: `{"metric": "rsi14", "operator": "gt", "value": 50, "timeframe": "1D"}`. Its values come back in `mtf_metrics`. * **Ratings.** `technicalRating`, `oscillatorRating` and `trendRating` run from `-1` to `1`. A technical rating of `0.5` or more reads as a strong buy, `0.1` or more as a buy, `-0.1` or less as a sell and `-0.5` or less as a strong sell. * **Watchlists.** `tickers` takes up to 200 OKX instrument IDs, such as `BTC-USDT-SWAP`, and the screen evaluates only those. * **Validation.** A condition with both or neither of `value` and `right_metric`, a range without an `upper_value` of at least `value`, an `upper_value` on any other operator, or a `right_multiplier` without `right_metric` returns `400`, as does any field the schema does not list. * **Empty screens.** Without `conditions`, the answer lists every active instrument of the universe in `sort` order. * **Sort.** `sort.metric` is any metric ID, read on the request `timeframe`, and `sort.direction` is `desc` (default) or `asc`; instruments missing that metric always sort last. * **Metric IDs.** Multi-output indicators use dotted IDs, such as `macd.histogram`, `bollinger.width`, `adx14.plusDI` or `supertrend.direction`. Derivatives metrics such as `openInterestUsd`, `fundingRate` and `takerBuyRatio1h` have values only for swaps and futures. ## Response * **Counts.** `total_scanned` is the instruments evaluated in the universe, `matched` those that pass, and `returned` the rows in `results`. Darvas evaluates every condition on every instrument of the universe, so `matched` is exact and `complete` is `true`. * **Rows.** Each result carries `ticker` (such as `BTC-USDT-SWAP`), `price`, `candle_time` (the start of the newest evaluated bar), `updated_at` (when its snapshot refreshed) and `metrics`, keyed by metric ID. `metrics` holds `price`, the sort metric and every metric the conditions name on the request timeframe. `mtf_metrics` holds, per timeframe, the values that conditions with their own `timeframe` read, for price and the metrics the screener keeps on every timeframe, such as the ratings, `rsi14`, `relativeVolume` and `distEma200Pct`. A metric without a value is left out. * **Freshness.** `as_of` is the newest snapshot update among the returned rows, in UTC. When the screener service cannot answer, the request returns `503`. For open interest buildup and decay ranked by contract, see [`/crypto/derivatives/oi-scan`](/crypto/open-interest-scanner). For indicator history of one market, see [`/crypto/indicators`](/crypto/technical-indicators). For candles and instruments, see [`/crypto/prices`](/crypto/prices) and [`/crypto/tickers`](/crypto/tickers). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.post( "https://api.darvas.app/v1/crypto/screener", headers=headers, json={ "market_type": "swap", "timeframe": "1H", "universe": "altcoins", "combine": "AND", "conditions": [ {"metric": "technicalRating", "operator": "gte", "value": 0.5}, {"metric": "rsi14", "operator": "between", "value": 50, "upper_value": 70}, {"metric": "macd.macd", "operator": "crosses_above", "right_metric": "macd.signal"}, {"metric": "price", "operator": "gt", "right_metric": "ema200", "right_multiplier": 1.02}, {"metric": "distEma200Pct", "operator": "gt", "value": 0, "timeframe": "4H"}, {"metric": "fundingRate", "operator": "lt", "value": 0.01}, ], "sort": {"metric": "relativeVolume", "direction": "desc"}, "limit": 25, }, ) resp.raise_for_status() screen = resp.json() print("Scanned:", screen["total_scanned"], "Matched:", screen["matched"]) for row in screen["results"]: m = row["metrics"] h4 = row.get("mtf_metrics", {}).get("4H", {}) print(row["ticker"], row["price"], "Rating:", m.get("technicalRating"), "RSI:", m.get("rsi14"), "4H above EMA200 %:", h4.get("distEma200Pct")) ``` ```bash theme={null} # Watchlist screen: daily RSI below 35 or price more than 3% below its 50 SMA curl -X POST "https://api.darvas.app/v1/crypto/screener" \ -H "X-API-KEY: $DARVAS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"market_type":"spot","timeframe":"4H","combine":"OR","tickers":["BTC-USDT","ETH-USDT","SOL-USDT","DOGE-USDT"],"conditions":[{"metric":"rsi14","operator":"lt","value":35,"timeframe":"1D"},{"metric":"price","operator":"lt","right_metric":"sma50","right_multiplier":0.97}],"sort":{"metric":"technicalRating","direction":"asc"},"limit":10}' ``` # Crypto Fear & Greed and Altcoin Season API Source: https://docs.darvas.app/crypto/sentiment-index openapi.yaml GET /crypto/sentiment Read the Darvas Crypto Sentiment index from 0 fear to 100 greed, with every component, input, formula and weight, and the Altcoin Season index. ## Overview This endpoint returns two indices computed only from market data Darvas reads itself. The Darvas Crypto Sentiment index runs from 0 (extreme fear) to 100 (extreme greed) and weighs Bitcoin's trend against its 125-day average, its 30-day volatility against the past year's, perpetual funding weighted by open interest, the share of the busiest pairs that rose in 24 hours, and the Coinbase premium. Every component shows its input, formula and weight; one that cannot be read is named and the others' weights are scaled to sum to one. The Altcoin Season index is the share of the 50 busiest coins whose 90-day return beat Bitcoin's: 75 or more is altcoin season, 25 or less Bitcoin season. Both refresh every five minutes. | Coverage | Details | | - | - | | Sentiment bands | `extreme_fear`, `fear`, `neutral`, `greed`, `extreme_greed` | | Altcoin season | 50 busiest spot coins, stablecoins and wrapped tokens left out | | Refresh | Every five minutes | | MCP tool | `get_crypto_sentiment` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/sentiment", headers=headers, ).json() print(answer["sentiment"]["score"], answer["sentiment"]["label"]) for component in answer["sentiment"]["components"]: print(component["name"], component["score"], component["effective_weight"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/sentiment" ``` # Crypto Technical Indicators API: RSI, MACD Source: https://docs.darvas.app/crypto/technical-indicators openapi.yaml GET /crypto/indicators Compute server-side RSI-14, MACD, EMA, SMA, Bollinger Bands, ATR-14, relative volume and returns on multi-exchange crypto bars across timeframes. ## Overview This endpoint computes technical indicators server-side over the newest candles of a Darvas aggregated pair (by default) or a single exchange instrument, across any stored frame from one minute to one month. Agents and scripts get moving averages, RSI, MACD, Bollinger Bands, ATR, relative volume, range extremes and trailing returns in one call without downloading raw candles. The newest candle may still be open, matching a live chart. | Coverage | Details | | - | - | | Aggregated feed | `darvas` (default) reads Darvas aggregated candles across every primary exchange listing the pair, including `ALLUSD` pairs (`BTC-ALLUSD`, `BTC-ALLUSD-SWAP`) | | Single exchanges | `okx`, `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Formulas | Inverses, ratios, spreads and arithmetic over listed crypto instruments, typed (`USDTBTC`, `BTCUSDT*USDTETH`, `BTCUSDT/NVDAUSDT`, `COINBASE:BTCUSD - BINANCE:BTCUSDT`) or canonical (`1 / [okx:BTC-USDT-SWAP]`), on `exchange=formula` | | Frames | `minute` x 1, 5, 15, 30; `hour` x 1, 2, 4, 6, 12; `day`, `week`, `month` x 1, in UTC | | Default frame | `interval=hour` with `interval_multiplier=4` (4-hour candles); any other `interval` defaults `interval_multiplier` to `1` | | Lookback window | `limit` from `30` to `500` candles, default `250` | | MCP tool | `get_crypto_indicators` on the [data API MCP server](/mcp-server) | ## Indicators returned Every indicator is computed in bars of the requested frame over the `bars_analyzed` newest candles. | Group | Fields | Definition | | - | - | - | | Snapshot | `latest_time`, `latest_close`, `bars_analyzed` | Start UTC timestamp and close of the newest candle, plus count of candles analyzed | | Moving averages | `sma_20`, `sma_50`, `sma_200`, `ema_12`, `ema_26` | 20-, 50- and 200-bar simple moving averages; 12- and 26-bar exponential moving averages | | Momentum | `rsi_14`, `macd`, `macd_signal`, `macd_histogram` | 14-bar Wilder RSI (0 to 100); `ema_12 - ema_26`, its 9-bar EMA signal line, and `macd - macd_signal` | | Volatility | `bollinger_upper`, `bollinger_middle`, `bollinger_lower`, `atr_14` | 20-bar SMA with +/- 2 standard deviation bands; 14-bar Wilder Average True Range | | Volume | `avg_volume_20`, `relative_volume` | Mean volume of the last 20 candles, and the newest candle's volume divided by that mean | | Range and returns | `period_high`, `period_low`, `pct_from_period_high`, `return_1_bar_pct`, `return_5_bar_pct`, `return_20_bar_pct` | High, low and percent distance from the high across `bars_analyzed`; close-to-close percent returns over 1, 5 and 20 bars | Price-denominated values and `avg_volume_20` keep eight significant digits so both six-figure bitcoin prices and sub-cent tokens keep precision. Percentage returns and `pct_from_period_high` round to two decimal places, and `relative_volume` rounds to four. Any indicator whose lookback exceeds `bars_analyzed` (such as `sma_200` when `limit=100` or on a newly listed token) is `null`. ## Venues and related endpoints Because `exchange` defaults to `darvas`, requests for canonical pairs such as `BTC-USDT-SWAP` or `BTC-ALLUSD` aggregate across all constituent exchanges. Pass comma-separated `venues` (such as `venues=binance,coinbase,kraken`) with `exchange=darvas` to restrict aggregation to specific venues; any single exchange refuses `venues` with `400`. Aggregated answers return `constituents` and `venues` (`null` when unfiltered); single-exchange answers omit both. A formula `ticker` such as `USDTBTC`, `BTCUSDT*USDTETH`, `BTCUSDT/NVDAUSDT` or `[okx:BTC-USDT-SWAP] / [okx:NVDA-USDT-SWAP]` computes every indicator over the formula's candles, joined from its legs' candles at the times all of them hold one; the answer carries `exchange` `formula`, `market_type` `synthetic`, the canonical `ticker`, a `display_symbol` and the `legs`. A multi-leg formula has volume `0`, so its `avg_volume_20` is `0` and `relative_volume` is `null`. The [prices page](/crypto/prices#inverse-ratio-and-spread-formulas) explains the syntax and the crypto-only rule. Use [`/crypto/prices`](/crypto/prices) for raw OHLCV candles, [`/crypto/prices/snapshot`](/crypto/price-snapshot) for the latest minute close, [`/crypto/footprint`](/crypto/footprint-charts) for price-level order flow and [`/crypto/tickers`](/crypto/tickers) to list canonical IDs and constituents. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/crypto/indicators", headers=headers, params={"ticker": "BTC-ALLUSD", "interval": "hour", "interval_multiplier": 4}, ).json() ind = resp["indicators"] print("Constituents:", resp["constituents"]) print("Close:", ind["latest_close"], "RSI-14:", ind["rsi_14"], "MACD hist:", ind["macd_histogram"], "ATR-14:", ind["atr_14"]) ``` ```bash theme={null} # 4-hour RSI and MACD of ETH priced in BTC, from the ETH and BTC USDT pairs curl -H "X-API-KEY: $DARVAS_API_KEY" -G "https://api.darvas.app/v1/crypto/indicators" \ --data-urlencode "ticker=ETHUSDT/BTCUSDT" # Daily ETH perpetual indicators across Binance, Bybit and OKX curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/indicators?ticker=ETH-USDT-SWAP&exchange=darvas&venues=binance,bybit,okx&interval=day&limit=250" ``` # Crypto TPO & Market Profile Distribution API Source: https://docs.darvas.app/crypto/tpo-market-profile openapi.yaml GET /crypto/tpo Build Time Price Opportunity (TPO) Market Profile distributions with Initial Balance, single prints, poor highs/lows and TPO POC for crypto sessions. ## Overview This endpoint returns TPO (time price opportunity, or market profile) sessions of a crypto market or a Darvas aggregated pair (`exchange=darvas`, the default), computed by the same engine the Darvas TPO chart draws with. Each price row counts the blocks that traded there and the volume they carried. Each session adds its point of control, value area, volume point of control, initial balance, tails, poor highs and lows, single prints and nodes, and `current` places the last price against the newest session. | Coverage | Details | | - | - | | Exchanges | `darvas` (default), `okx`, `binance`, `bybit`, `hyperliquid`, `coinbase`, `kraken`, `bitstamp`, `deribit` and `bitfinex` | | Default timing | `timeframe` (default `30m`) up to `1H`: daily sessions of 30-minute blocks; up to `1D`: weekly sessions of 4-hour blocks; `1W`: monthly sessions of daily blocks | | Overrides | `session_period` (`daily`, `weekly`, `monthly`) and `block_size` (`5m`, `15m`, `30m`, `1H`, `2H`, `4H`, `1D`) | | Sessions | `profiles` from `1` to `12` (default `5`), oldest first | | Rows and value area | `rows_target` from `20` to `400` (default `60`); `value_area_percent` from `50` to `95` (default `70`) | | Time zone | `timezone`: the IANA zone whose midnight starts each session (default `UTC`) | | MCP tool | `get_crypto_tpo` on the [data API MCP server](/mcp-server) | ## Session fields * **Session and range.** `session` is the session's key, such as `D:2026-11-28`, with `start_time`, `end_time`, `open`, `high`, `low` and `close` (the close so far for the open session). * **Value.** `poc_price` is the row with the most TPOs, `value_area_high` and `value_area_low` bound the value area, and `volume_poc_price` is the row with the most volume (`null` without volume). `row_size`, `tpo_count` and `blocks` (blocks so far) describe the grid. * **Opening range.** `initial_balance` holds the `high` and `low` of the session's first two blocks. * **Tails and poor extremes.** `high_tail_rows` and `low_tail_rows` count the single-TPO rows at the session's top and bottom; `poor_high` and `poor_low` are `true` when that end has no tail. * **Single prints and nodes.** `single_prints` lists up to five runs of single-TPO rows inside the session, tails excluded, as `low` and `high` prices. `high_volume_nodes` are the three rows after the point of control with the most TPOs, and `low_volume_nodes` the three value area rows with the fewest; both rank by `tpo_count`. * **Rows.** `rows` lists the session lowest first with `price`, `tpo_count`, `volume` (base asset), `buy_volume` (volume of up blocks), `sell_volume` (volume of down blocks) and `in_value_area`. ## Current position and candle limits `current` compares `last_price`, the newest candle's close, with the newest session. `value_area_position` is `above_value_area`, `inside_value_area` or `below_value_area`; `poc_change` is the point of control's move from the session before; `value_area_overlap_percent` is how much of the narrower of the two value areas overlaps the other. The last two are `null` with one session, and `current` is `null` without sessions. Darvas builds the sessions from candles of `block_size`, at most 5,000 per request, so short blocks with long sessions return fewer sessions than asked: 5-minute blocks fill 5,000 candles in about 17 days. A `timezone` that is not an IANA name, such as `Europe/London`, returns `400`. For trade-built volume at price, see [`/crypto/volume-profile`](/crypto/volume-profile) and [`/crypto/volume-profile/fixed-range`](/crypto/fixed-range-volume-profile). For the candles themselves, see [`/crypto/prices`](/crypto/prices). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} tpo = requests.get( "https://api.darvas.app/v1/crypto/tpo", headers=headers, params={"ticker": "BTC-USDT-SWAP", "timeframe": "30m", "profiles": 3}, ).json() current = tpo["current"] or {} print("Last price:", tpo["last_price"], "Position:", current.get("value_area_position"), "POC move:", current.get("poc_change")) for session in tpo["sessions"]: ib = session["initial_balance"] or {} print( session["session"], "POC:", session["poc_price"], "VA:", session["value_area_low"], session["value_area_high"], "IB:", ib.get("low"), ib.get("high"), "poor high:", session["poor_high"], "single prints:", session["single_prints"], ) ``` ```bash theme={null} # Three daily ETH-USDT spot sessions on OKX starting at New York midnight curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/tpo?ticker=ETH-USDT&exchange=okx&session_period=daily&block_size=30m&timezone=America/New_York&profiles=3" ``` # Crypto Tick Trades & Tape Executions API Source: https://docs.darvas.app/crypto/trades openapi.yaml GET /crypto/trades Query recorded tick-level crypto trade executions with aggressor side, exact price, size and USD notional across supported exchanges with cursors. ## Overview Darvas records public trades for every listed OKX, Binance, Bybit and Hyperliquid instrument and keeps 90 days of execution history. | Coverage | Details | | - | - | | Exchanges | `okx` (default), `binance`, `bybit` and `hyperliquid` | | History | 90 days for OKX swaps; since 23 November 2026 for OKX spot, Hyperliquid perpetuals, and Binance and Bybit spot and perpetuals; since September 2026 for the 100 busiest Hyperliquid spot pairs | | Window | At most 24 hours per request; defaults to the last hour without `start_time` and `end_time` | | Page size | 1,000 trades per page, newest trade first; `limit` counts across pages up to 100,000 (default 1,000) | | MCP tool | `list_crypto_trades` on the [data API MCP server](/mcp-server) | Raw executions belong to individual exchanges, so `exchange=darvas` returns `400`. For cross-exchange aggregated taker flow, query [`/crypto/order-flow`](/crypto/order-flow) or [`/crypto/footprint`](/crypto/footprint-charts) with `exchange=darvas`. Each trade carries `time`, `time_milliseconds`, `price`, `size` (in base currency, or contracts where the venue counts contracts), `side` (the taker's side, `buy` or `sell`), `trade_id` and `notional_usd`. `notional_usd` uses OKX's contract value for OKX swaps, equals `price * size` for markets quoted in USD, USDT or USDC, and is `null` for other quotes. ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} trades = requests.get( "https://api.darvas.app/v1/crypto/trades", headers=headers, params={ "ticker": "BTC-USDT-SWAP", "exchange": "okx", "start_time": "2026-11-25T14:00:00Z", "end_time": "2026-11-25T14:05:00Z", "limit": 5000, }, ).json() large = [t for t in trades["trades"] if (t["notional_usd"] or 0) >= 100_000] print(len(trades["trades"]), len(large)) ``` # Crypto Volatility Cone & Correlation API Source: https://docs.darvas.app/crypto/volatility-correlation openapi.yaml GET /crypto/analytics Get a crypto instrument's realized volatility cone over 7, 30 and 90 days, its correlation and beta to SPY, QQQ, gold and coins, and returns by hour. ## Overview This endpoint analyses one crypto instrument, Binance spot BTC without a ticker. `realized_volatility` gives the 7, 30 and 90-day realized volatility with where each stands in its past year. `correlation` gives the correlation and beta of daily returns against US stocks and funds (SPY, QQQ and GLD by default) and other coins. `seasonality` gives the average return by UTC hour, by weekday and by trading session (Asia, Europe, US, late US). A stock's session close is paired with the coin's UTC daily close of the same date. | Coverage | Details | | - | - | | Instruments | Every crypto instrument the candle endpoints serve, on any stored exchange | | Benchmarks | Up to 8: US stock and fund tickers, or BTC, ETH, SOL, BNB and XRP | | Windows | `correlation_days` 20 to 365 and `seasonality_days` 7 to 365; 90 each by default | | MCP tool | `get_crypto_analytics` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/crypto/analytics", headers=headers, params={ "ticker": "spot:ETHUSDT", "exchange": "binance", "benchmarks": "SPY,GLD,BTC", }, ).json() for window in answer["realized_volatility"]["windows"]: print(window["window_days"], window["realized_vol_pct"]) for benchmark in answer["correlation"]["benchmarks"]: print(benchmark["benchmark"], benchmark["correlation"], benchmark["beta"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/analytics?ticker=spot:ETHUSDT&exchange=binance&benchmarks=SPY,GLD,BTC" ``` # Crypto Volume Profile, POC & Value Area API Source: https://docs.darvas.app/crypto/volume-profile openapi.yaml GET /crypto/volume-profile Compute session and rolling crypto volume profiles with Point of Control (POC), Value Area High/Low (VAH/VAL) and buy/sell volume per price bin. ## Overview This endpoint returns session volume profiles of an OKX perpetual swap, built from every trade Darvas records. For each UTC day, week or calendar month, it gives the taker buy and sell notional, delta and trade count of each price bucket, the session totals, the point of control and the 70 percent value area. By default the open session also includes its newest trades that the stored buckets do not hold yet. | Coverage | Details | | - | - | | Markets | OKX perpetual swaps such as `BTC-USDT-SWAP` (default) and `ETH-USDT-SWAP`; other tickers return `400` | | Sessions | `period`: `1D` (default, a UTC day), `1W` (a week from Monday) or `1M` (a calendar month) | | Bucket size | `resolution`: `fine`, `medium` (default) or `coarse`, scaled to the market's volatility | | History | `periods` from `1` to `30` sessions (default `1`), ending with the session that holds `period_start` | | Value area | 70 percent of each session's notional | | MCP tool | `get_crypto_volume_profile` on the [data API MCP server](/mcp-server) | ## Sessions, buckets and value area * **Choosing sessions.** `period_start` is any moment of the newest session to return, as ISO 8601, a UTC date (`2026-11-24`) or Unix milliseconds; without it, the newest session is the current one. `period=1D&periods=7` returns the seven days ending with that day. * **Session totals.** Each entry in `profiles` (oldest first) carries `period_start`, `period_end`, `bucket_size`, `buy_notional_usd`, `sell_notional_usd`, `total_notional_usd`, `delta_notional_usd` (bought less sold) and `trade_count`. * **Point of control and value area.** `poc_price` is the middle of the bucket with the most notional. The value area starts at that bucket and adds the larger neighbour above or below until 70 percent of the session's notional is inside; `value_area_high` is the top of its highest bucket and `value_area_low` the bottom of its lowest. All three are `null` for a session without trades. * **Buckets.** `buckets` lists the session's price buckets lowest first, each with `price_from`, `price_to`, the four notional fields in USD and `trade_count`. * **Live tail.** `include_live_tail=false` returns only what the stored buckets hold, which keeps the open session stable between calls. For a profile of any time range on other exchanges or a Darvas aggregated pair, see [`/crypto/volume-profile/fixed-range`](/crypto/fixed-range-volume-profile). For time-based market profile structure, see [`/crypto/tpo`](/crypto/tpo-market-profile). The same fine buckets rank the busiest zones in [`/crypto/large-trades/zones`](/crypto/whale-trade-zones), and per-bar taker volume by price is in [`/crypto/footprint`](/crypto/footprint-charts). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} vp = requests.get( "https://api.darvas.app/v1/crypto/volume-profile", headers=headers, params={"ticker": "BTC-USDT-SWAP", "period": "1D", "periods": 5, "resolution": "fine"}, ).json() for profile in vp["profiles"]: print( profile["period_start"][:10], "POC:", profile["poc_price"], "VAL:", profile["value_area_low"], "VAH:", profile["value_area_high"], "delta USD:", profile["delta_notional_usd"], ) today = vp["profiles"][-1] busiest = sorted(today["buckets"], key=lambda b: b["total_notional_usd"], reverse=True)[:3] for bucket in busiest: print(bucket["price_from"], bucket["price_to"], bucket["total_notional_usd"], bucket["trade_count"]) ``` ```bash theme={null} # Four weekly ETH perpetual profiles ending with the week of 24 November 2026, stored buckets only curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/volume-profile?ticker=ETH-USDT-SWAP&period=1W&periods=4&period_start=2026-11-24&resolution=coarse&include_live_tail=false" ``` # Crypto Whale Trade Clusters & Price Zones API Source: https://docs.darvas.app/crypto/whale-trade-zones openapi.yaml GET /crypto/large-trades/zones Identify key price clusters where the largest institutional crypto whale notional traded over recent hours to map absorption and breakout zones. ## Overview This endpoint ranks the price zones of an OKX perpetual swap where the most notional traded over the last day, week or month. Each zone gives the taker buy and sell notional in USD, the delta, the trade count, the newest trade and whether buyers or sellers pressed it. Zones are the fine buckets of the [session volume profile](/crypto/volume-profile), sized to the market's volatility, with the newest trades the stored buckets do not hold yet added. | Coverage | Details | | - | - | | Markets | OKX perpetual swaps (`exchange=okx`, the only value) such as `BTC-USDT-SWAP` (default) | | Windows | `window`: `1D` (default), `1W` (7 days) or `1M` (30 days), counted back from now | | Zones | `limit` from `1` to `100` (default `20`), the most notional first | | Pressure | `buy_pressure` or `sell_pressure` when the delta is at least 8 percent of the zone's notional, else `balanced` | | MCP tool | `list_crypto_large_trade_zones` on the [data API MCP server](/mcp-server) | ## Zone fields * **Price band.** `price_from`, `price_to` and `mid_price` bound each zone; `bucket_size` at the top level is every zone's height in price, and `since` is the window's start in UTC. * **Notional.** `buy_notional_usd`, `sell_notional_usd`, `total_notional_usd` and `delta_notional_usd` (bought less sold) sum every taker trade Darvas recorded in the zone during the window, with `trade_count` trades. A zone ranks by all of its trades, not only large ones. * **Recency and pressure.** `last_trade_time` is the zone's newest trade (`null` when unknown), and `pressure` marks one-sided flow by the 8 percent rule above. For the individual whale executions above a USD size, see [`/crypto/large-trades`](/crypto/large-trades). For per-session buckets with value areas, see [`/crypto/volume-profile`](/crypto/volume-profile). For estimated liquidation clusters near those zones, see [`/crypto/liquidations/heatmap`](/crypto/liquidation-heatmap). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} zones = requests.get( "https://api.darvas.app/v1/crypto/large-trades/zones", headers=headers, params={"ticker": "BTC-USDT-SWAP", "window": "1W", "limit": 10}, ).json() print("Since:", zones["since"], "Zone height:", zones["bucket_size"]) for zone in zones["zones"]: print( zone["price_from"], zone["price_to"], "total USD:", round(zone["total_notional_usd"]), "delta USD:", round(zone["delta_notional_usd"]), zone["pressure"], ) ``` ```bash theme={null} # Top five ETH perpetual zones over the last 30 days curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/crypto/large-trades/zones?ticker=ETH-USDT-SWAP&window=1M&limit=5" ``` # On-Chain DEX Tokens, Liquidity & Volume API Source: https://docs.darvas.app/defi/dex-tokens openapi.yaml GET /defi/dex-tokens Query on-chain DEX token prices, liquidity depth, 24h swap volumes and pair statistics across decentralized exchanges for DeFi screening and routing. ## Overview This endpoint serves live decentralized exchange liquidity across Solana, Ethereum, Base, Arbitrum, BSC, and other chains in two modes: pass `query` to search active DEX pairs by ticker, pair name, or token contract address, or omit `query` to list top trending on-chain tokens. | Coverage | Details | | - | - | | Modes | Pair search when `query` is provided (trimmed to 60 characters); top trending on-chain tokens when `query` is omitted | | Chain filter | Optional `chain` slug matched case-insensitively, such as `solana`, `ethereum`, `base`, `arbitrum`, or `bsc` | | Row limit | `limit` from `1` to `100` rows (default `30`) | | Freshness | Cached for 30 seconds per `(query, chain)` combination | | MCP tool | `list_dex_tokens` on the [data API MCP server](/mcp-server) | ## Two response shapes: pair search and trending tokens The fields inside each `dex_tokens` object depend on whether you send `query`. * **With `query` (pair search).** Each row represents a live DEX pool and returns `chain`, `dex` (such as `raydium` or `uniswap`), `pair_address`, `base_symbol`, `base_address`, `quote_symbol`, `price_usd`, `liquidity_usd`, `volume_24h_usd`, `price_change_24h_pct`, `fdv_usd`, and `market_cap_usd`. Numeric fields are `null` when unavailable. * **Without `query` (trending tokens).** Each row represents a trending on-chain token and returns `chain`, `token_address`, `description`, and `total_amount`. To retrieve pool prices and USD liquidity for a trending token, pass its `token_address` back to this endpoint as `query`. * **Related endpoints.** For protocol-level TVL rankings, see [`/defi/protocols`](/defi/protocols-tvl). For AMM pool yields, see [`/defi/yields`](/defi/yields). For centralized and Hyperliquid candles, see [`/crypto/prices`](/crypto/prices). For Coinbase stock tokens on Base, see [`/tokenized-stocks/prices/snapshot`](/tokenized-stocks/snapshot). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/defi/dex-tokens", headers=headers, params={"query": "SOL", "chain": "solana", "limit": 10}, ).json() for pair in resp["dex_tokens"]: print(pair["dex"], f'{pair["base_symbol"]}/{pair["quote_symbol"]}', "price:", pair["price_usd"], "liq USD:", pair["liquidity_usd"], "24h vol:", pair["volume_24h_usd"]) ``` ```bash theme={null} # List top 15 trending on-chain tokens on Base (no query parameter) curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/defi/dex-tokens?chain=base&limit=15" ``` # DEX Volume API: Spot, Aggregators & Options Source: https://docs.darvas.app/defi/dex-volumes openapi.yaml GET /defi/dex-volumes Rank DEXs, DEX aggregators, perpetual aggregators and on-chain options by 24-hour to all-time volume, with each protocol's changes and market share. ## Overview This endpoint ranks protocols by trading volume in one market: spot DEXs, DEX aggregators, perpetuals routed through aggregators, or on-chain options by notional or premium. Each protocol carries its 24-hour, 7-day, 30-day, one-year and all-time volume, the changes over 1, 7 and 30 days, and its share of the market's 24-hour volume. `totals` sums the whole market. Filter by chain or category, or search by name. | Coverage | Details | | - | - | | Markets | `spot`, `aggregators`, `perps_aggregators`, `options_notional`, `options_premium` | | Windows | 24 hours, 7 days, 30 days, 1 year and all time | | Results | Up to 500 protocols; 50 by default | | MCP tool | `list_defi_dex_volumes` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/defi/dex-volumes", headers=headers, params={ "market": "spot", "chain": "Solana", "limit": 20, }, ).json() print(answer["totals"]) for protocol in answer["protocols"]: print(protocol["name"], protocol["volume_24h_usd"], protocol["share_24h_pct"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/defi/dex-volumes?market=spot&chain=Solana&limit=20" ``` # DeFi Protocol Fees & Revenue API Source: https://docs.darvas.app/defi/fees-revenue openapi.yaml GET /defi/fees Rank DeFi protocols by fees users paid, revenue kept and revenue paid to token holders over 24 hours to a year, with annualized revenue and price-to-sales. ## Overview This endpoint ranks DeFi protocols by the fees users paid, the revenue the protocol kept and the revenue paid to token holders, over 24 hours, 7 and 30 days, a year and all time. Each protocol also carries annualized fees and revenue (the trailing 30 days × 365 / 30), its TVL and its price-to-fees and price-to-sales multiples. A `chain` filter ranks the fees earned on that chain. Filter by category or search by name, and sort by any amount, or by `mcap_to_annualized_revenue`, cheapest first. | Coverage | Details | | - | - | | Protocols | Every protocol with reported fees, across chains | | Windows | 24 hours, 7 days, 30 days, 1 year and all time | | Results | Up to 500 protocols; 50 by default | | MCP tool | `list_defi_fees` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/defi/fees", headers=headers, params={ "sort": "revenue_30d_usd", "limit": 25, }, ).json() for protocol in answer["protocols"]: print(protocol["name"], protocol["fees_24h_usd"], protocol["revenue_30d_usd"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/defi/fees?sort=revenue_30d_usd&limit=25" ``` # DeFi Protocol Profile & TVL History API Source: https://docs.darvas.app/defi/protocol-profile openapi.yaml GET /defi/protocols/{slug} Get one DeFi protocol's profile, TVL by chain with each chain's share, borrowed and staked TVL, fees and revenue, and its TVL history by day, week or month. ## Overview This endpoint returns one DeFi protocol by its slug, as [`/defi/protocols`](/defi/protocols-tvl) lists it: its profile, its current TVL on each chain with each chain's share, borrowed and staked TVL, its fees and revenue, and its TVL history overall or on one chain. The history is sampled at the last point of each day, week or month, over the last 90 days unless dates are given. | Coverage | Details | | - | - | | Protocols | Every protocol `/defi/protocols` lists | | History | `day`, `week` or `month` samples between `start_date` and `end_date` | | Chains | Chain keys such as `ethereum`, `solana`, `base` and `arbitrum` | | MCP tool | `get_defi_protocol` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/defi/protocols/aave-v3", headers=headers, params={ "interval": "week", }, ).json() print(answer["protocol"]["name"], answer["protocol"]["category"]) for chain in answer["chain_tvls"]: print(chain) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/defi/protocols/aave-v3?interval=week" ``` # DeFi Protocols TVL & Multi-Chain Metrics API Source: https://docs.darvas.app/defi/protocols-tvl openapi.yaml GET /defi/protocols Query DeFi protocol TVL, per-chain chain_tvl_usd breakdowns, categories and 1h/1d/7d changes across chains with alias normalization and CEX exclusion. ## Overview This endpoint returns multi-chain decentralized finance protocols ranked by total value locked (`chain_tvl_usd`, which equals total `tvl_usd` when unfiltered and the protocol's TVL on the requested chain when `chain` is set), along with per-chain TVL breakdowns, 1-hour, 1-day and 7-day TVL changes, category labels, and governance token market capitalization. Centralized exchanges (`category: "CEX"`) are excluded by default. | Coverage | Details | | - | - | | Universe | Up to 6,000 active multi-chain DeFi protocols with positive TVL across Ethereum, Solana, Base, Arbitrum, BSC, Polygon, Avalanche and other networks | | Filters | `chain` (canonicalized with chain aliases), `category`, `query` (name or slug search), `min_tvl` (USD floor applied to `chain_tvl_usd`, default `0`) and `include_cex` (`false` by default unless `category=cex`) | | Ordering and limit | `sort` by `tvl_usd` (default, using `chain_tvl_usd`), `change_1d_pct`, `change_7d_pct` or `mcap_usd`; `limit` from `1` to `500` protocols (default `50`) | | Freshness | Snapshot refreshed every 5 minutes | | MCP tool | `list_defi_protocols` on the [data API MCP server](/mcp-server) | ## Filtering and response fields All query filters are optional and combine with logical AND. Top-level fields return `protocols`, `total_matched` and `chain` (canonical chain key or `null`). * **Chain aliases and per-chain TVL.** `chain` normalizes common aliases case-insensitively to canonical lowercase keys: `BSC`, `Binance`, `BNB`, `BNB Chain` and `BNB Smart Chain` resolve to `bsc`; `ETH` and `Mainnet` resolve to `ethereum`; `AVAX` resolves to `avalanche`; `MATIC` and `polygon_pos` resolve to `polygon`; `OP` and `OP Mainnet` resolve to `optimism`; `xDai` and `GnosisChain` resolve to `gnosis`; `Arbitrum One` resolves to `arbitrum`; `zkSync Era` and `era` resolve to `zksync`; `FTM` resolves to `fantom`; `Hyperliquid L1` and `HyperEVM` resolve to `hyperliquid`. When `chain` is set, `chain_tvl_usd` reports the protocol's TVL on that chain (and `min_tvl` and `sort=tvl_usd` operate on `chain_tvl_usd`), while `tvl_usd` keeps total protocol TVL across all chains. * **CEX exclusion default.** Centralized exchange entries (`category: "CEX"`) are excluded by default so DeFi rankings stay on-chain. Pass `include_cex=true` (or `category=cex`) to include centralized exchanges. * **Category and name search.** `category` matches substrings case-insensitively (for example `Lending`, `Dexs`, `Liquid Staking` or `Bridge`). `query` matches substrings case-insensitively against `name` and `slug`. * **Protocol fields.** Each row in `protocols` carries `slug`, `name`, `symbol` (governance token ticker or `null`), `category`, `chain` (primary canonical chain key or `null`), `chains` (canonical chain keys), `tvl_usd`, `chain_tvl_usd`, `chain_tvls` (per-chain `{ chain, tvl_usd }` array sorted largest first), `borrowed_usd`, `staking_usd`, `pool2_usd`, `change_1h_pct`, `change_1d_pct`, `change_7d_pct`, `mcap_usd`, `parent_protocol` and `url`. * **Related endpoints.** Drill into pool-level APYs with [`/defi/yields`](/defi/yields), inspect stablecoin issuance at [`/defi/stablecoins`](/defi/stablecoins), check live DEX pair liquidity at [`/defi/dex-tokens`](/defi/dex-tokens), or pull governance token price history from [`/crypto/prices`](/crypto/prices). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/defi/protocols", headers=headers, params={ "chain": "BNB", # alias normalized to canonical "bsc" "category": "Lending", "min_tvl": 100_000_000, "limit": 10, }, ).json() print("Chain:", resp["chain"], "Total matched:", resp["total_matched"]) for proto in resp["protocols"]: print(proto["name"], proto["symbol"], "Chain TVL:", proto["chain_tvl_usd"], "Total TVL:", proto["tvl_usd"], "7d %:", proto["change_7d_pct"]) ``` ```bash theme={null} # Search protocols matching "aave" across all chains (CEX excluded by default) curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/defi/protocols?query=aave&limit=10" ``` # Stablecoin Supply, Market Cap & Peg Data API Source: https://docs.darvas.app/defi/stablecoins openapi.yaml GET /defi/stablecoins Track circulating supply, chain distribution, mint/burn flows and peg prices across USDT, USDC, USDe, DAI and other major crypto stablecoins via API. ## Overview This endpoint returns global circulating supply across fiat-backed, crypto-backed, and algorithmic stablecoins ranked descending by `circulating_usd`. Each entry includes prior-day and prior-week supply snapshots, current USD price, peg denomination, collateral mechanism, and active issuing blockchains. | Coverage | Details | | - | - | | Universe | Global circulating stablecoins across USD, EUR, and other currency pegs | | Filters | Optional `symbol` (exact case-insensitive ticker such as `USDT` or `USDC`) and `peg_type` (exact case-insensitive match such as `peggedUSD` or `peggedEUR`) | | Ordering and limit | Sorted descending by `circulating_usd`; `limit` from `1` to `200` stablecoins (default `50`) | | Freshness | Snapshot refreshed every 5 minutes | | MCP tool | `list_stablecoin_supply` on the [data API MCP server](/mcp-server) | ## Supply deltas and peg fields Use prior-period circulation fields to measure net minting and redemptions without fetching separate historical series. * **Net issuance math.** Subtract `circulating_prev_day_usd` or `circulating_prev_week_usd` from `circulating_usd` to compute 24-hour and 7-day net supply expansion or contraction. Either prior field is `null` if unreported for a newer stablecoin. * **Peg health and mechanism.** `price` gives the current USD market price for peg-deviation monitoring. `peg_type` names the reference peg (for example `peggedUSD` or `peggedEUR`), and `peg_mechanism` describes the backing model (`fiat-backed`, `crypto-backed`, or `algorithmic`). * **Chain footprint.** `chains` lists every blockchain where the stablecoin circulates, such as `Ethereum`, `Tron`, `Arbitrum`, and `Solana`. * **Related endpoints.** Combine stablecoin supply trends with [`/defi/protocols`](/defi/protocols-tvl) for protocol TVL, [`/defi/yields`](/defi/yields) with `stablecoin_only=true` for stablecoin lending rates, [`/crypto/etf-flows`](/crypto/etf-flows) for spot ETF inflows, and [`/crypto/prices`](/crypto/prices) for `ALLUSD` spot and swap candles. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/defi/stablecoins", headers=headers, params={"peg_type": "peggedUSD", "limit": 10}, ).json() for sc in resp["stablecoins"]: prev_week = sc["circulating_prev_week_usd"] delta_7d = sc["circulating_usd"] - prev_week if prev_week is not None else None print(sc["symbol"], "price:", sc["price"], "supply USD:", sc["circulating_usd"], "7d delta USD:", delta_7d) ``` ```bash theme={null} # Inspect Tether (USDT) circulating supply and issuing chains curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/defi/stablecoins?symbol=USDT" ``` # DeFi Yield Pools, Base APY & Reward APY API Source: https://docs.darvas.app/defi/yields openapi.yaml GET /defi/yields Compare DeFi lending, staking and liquidity pool TVL, base APY and reward token APY across chains and protocols to evaluate sustainable yields. ## Overview This endpoint returns active on-chain lending markets, liquid staking pools, and AMM liquidity pools sorted descending by `tvl_usd`. Each pool breaks total `apy` into organic `apy_base` and incentive `apy_reward`, alongside `stablecoin` and impermanent loss (`il_risk`) classifications. | Coverage | Details | | - | - | | Pool universe | Up to 3,000 active pools with at least \$100,000 TVL across major EVM and non-EVM chains | | Filters | `chain` (exact match), `project` and `symbol` (case-insensitive substrings), `stablecoin_only` (`true` or `false`), `min_tvl` (default `1000000`), and `min_apy` (default `0`) | | Ordering and limit | Sorted descending by `tvl_usd`; `limit` from `1` to `200` pools (default `50`) | | Freshness | Snapshot refreshed every 5 minutes | | MCP tool | `list_defi_yields` on the [data API MCP server](/mcp-server) | ## Yield composition and filtering rules Use the base-yield split and TVL floor together to filter out illiquid pools and temporary token emissions. * **Organic and incentive APY.** `apy` is total annualized percentage yield. `apy_base` measures organic borrow interest, staking rewards, or swap fees, and `apy_reward` measures token incentive emissions. Either component can be `null` when unreported. * **TVL floor.** The indexed pool snapshot retains pools with at least $100,000 TVL, and `min_tvl` defaults to `1000000` ($1 million USD) so low-liquidity outliers stay excluded by default. Pass `min_tvl=100000` to include smaller pools, or raise it for institutional sizing. * **Risk tags.** `stablecoin` is `true` for pools holding stablecoins only. `il_risk` classifies impermanent loss exposure (`"yes"`, `"no"`, or `null`). * **Related endpoints.** Compare DeFi stablecoin carry against US Treasury yields on [`/macro/yield-curve`](/macro/treasury-yield-curve) and central bank policy rates on [`/macro/interest-rates`](/macro/interest-rates). Inspect protocol-level TVL at [`/defi/protocols`](/defi/protocols-tvl) and stablecoin supply at [`/defi/stablecoins`](/defi/stablecoins). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/defi/yields", headers=headers, params={ "chain": "Ethereum", "stablecoin_only": "true", "min_tvl": 10_000_000, "min_apy": 4, "limit": 15, }, ).json() for pool in resp["pools"]: print(pool["project"], pool["symbol"], "TVL:", pool["tvl_usd"], "APY:", pool["apy"], "base:", pool["apy_base"], "reward:", pool["apy_reward"]) ``` ```bash theme={null} # Arbitrum USDC pools on Aave with at least $5M TVL curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/defi/yields?chain=Arbitrum&project=aave&symbol=USDC&min_tvl=5000000&limit=10" ``` # Management Earnings Guidance & Outlook API Source: https://docs.darvas.app/earnings/guidance openapi.yaml GET /kpi/guidance Revenue, EPS, EBITDA, margin, capex and free cash flow guidance from earnings releases, as ranges or point estimates for a quarter or year, with revisions. ## Overview Guidance for revenue, EPS and adjusted EPS, adjusted EBITDA, margins, operating income, capital expenditures and free cash flow, for the period the release names: `Q3 2026` or `FY 2026`. A range gives `low` and `high`, with their midpoint as `value`; a single figure gives `point_estimate`, and `plus or minus 2%` gives the range around it. A revision (`raised ... from $480 million–$495 million to $525 million–$540 million`) gives the new range, the old midpoint as `prior_value` and `change_direction`. **MCP tool:** `list_kpi_guidance` on the [data API MCP server](/mcp-server). Darvas reads guidance by rules from the sentences that expect a metric for a period and from tables with low and high ends. A percent guided for an amount is its growth: `revenue_growth`, `eps_growth`. `raw_text` is the sentence or table line. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.get( "https://api.darvas.app/v1/kpi/guidance", headers=headers, params={"ticker": "NVDA", "limit": 4}, ).json() for guide in body["kpi_guidance"]: print(guide["period"], guide["metric_name"], guide.get("low"), guide.get("high"), guide.get("change_direction")) ``` # Sector Operating KPIs API from Earnings Releases Source: https://docs.darvas.app/earnings/kpis openapi.yaml GET /kpi/metrics Sector KPIs read from 8-K earnings releases, such as load factor, CET1 ratio, net interest margin, same-store sales and FFO per share, each with its text. ## Overview The operating figures a company reports beside its financial statements, read from the press release furnished with each 8-K under Item 2.02. Each value carries the sentence or table line it was read from, and `source_url` opens the exhibit on sec.gov with that text highlighted. **MCP tool:** `list_kpi_metrics` on the [data API MCP server](/mcp-server). | Sector | KPIs | | - | - | | Airlines | `load_factor`, `available_seat_miles`, `revenue_passenger_miles` | | Banks | `cet1_ratio`, `net_interest_margin`, `efficiency_ratio`, `return_on_average_equity`, `return_on_average_assets`, `tangible_book_value_per_share` | | REITs | `ffo_per_share`, `affo_per_share`, `occupancy` | | Retail | `same_store_sales` | | Hotels | `revpar`, `average_daily_rate` | | Industrials | `book_to_bill`, `backlog` | | Software | `net_revenue_retention`, `annual_recurring_revenue` | | Telecom and media | `arpu`, `subscribers` | ## How values are read Darvas reads them by rules, not with a language model: a KPI's name followed within a few words by a number in its unit, or a percent right before it, as in `14.39% CET1 capital ratio`. A number outside the range the KPI can take is left out. Values come only from releases whose earnings figures agreed with the company's XBRL, so the release was read right; the period is that release's. `yoy_value` is the earlier figure a sentence compares with, and `yoy_change_pct` the change against it as a decimal. `limit` counts releases across pages, 4 by default and at most 50; each page holds up to 10 records. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.get( "https://api.darvas.app/v1/kpi/metrics", headers=headers, params={"ticker": "ASB", "metric_name": "net_interest_margin", "limit": 8}, ).json() for kpi in body["kpi_metrics"]: print(kpi["period"], kpi["value"], kpi["unit"], kpi["source_url"]) ``` # Non-GAAP Earnings & Adjusted Metrics API Source: https://docs.darvas.app/earnings/non-gaap openapi.yaml GET /kpi/non-gaap Query adjusted EBITDA, adjusted net income, non-GAAP EPS and other adjusted lines from earnings release reconciliation tables, each with its GAAP line. ## Overview The adjusted lines of the reconciliation tables in each earnings release: each with the GAAP line the table starts from, such as `Net income`, and the lines between as `key_adjustments`. Values are the release's quarter, scaled as the table states; ratios and margins are left out. **MCP tool:** `list_kpi_non_gaap` on the [data API MCP server](/mcp-server). ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.get( "https://api.darvas.app/v1/kpi/non-gaap", headers=headers, params={"ticker": "HLT", "metric_name": "adjusted_ebitda", "limit": 4}, ).json() for line in body["kpi_non_gaap"]: print(line["period"], line["value"], line["gaap_equivalent"], "|", line["key_adjustments"]) ``` # Corporate Earnings Releases API: EPS & Revenue Source: https://docs.darvas.app/earnings/releases openapi.yaml GET /earnings Query revenue, EPS, margins and cash flow per period from 8-K earnings releases and the 10-Q or 10-K that follows, with period changes, by ticker or CIK. ## Overview Each entry is one filing that reports a period: the 8-K earnings release first, as soon as SEC accepts it, then the 10-Q or 10-K. Entries come newest period first and, within a period, earliest filing first. `quarterly` holds the quarter's figures and `annual` the year's, when the filing reports the year. | Coverage | Details | | - | - | | 10-Q and 10-K entries | Every company with XBRL statements, since 2009 | | 8-K entries | About half of earnings releases since January 2023; see below | | Updated | Within about a minute of SEC acceptance | | Page size | 10 filings; `limit` counts periods across pages, up to 40 | | MCP tool | `list_earnings` on the [data API MCP server](/mcp-server) | Changes are decimals: `revenue_chg` against the quarter before in `quarterly` and against the year before in `annual`, `revenue_yoy_chg` against the same quarter a year before. Margins are decimals of revenue, and their changes come in basis points (`gross_margin_chg_bps`) and as decimals of the earlier margin (`_chg_pct`). A change that cannot be computed is absent. `signals` notes year-over-year moves: revenue up or down 10% (strong at 20%), net income and EPS 15% (30%), and margins that move 100 bps. Growth against a loss raises none. `filing_window` is the market session SEC accepted the filing in, in Eastern Time: `PRE_MARKET` weekdays 04:00 to 09:30, `DURING_MARKET` 09:30 to 16:00, `AFTER_HOURS` the rest of a weekday, `WEEKEND` Saturday and Sunday. ## How release figures are read Darvas reads the statements of the press release furnished with each 8-K under Item 2.02: the income statement, balance sheet and cash flow statement, mapped to the fields by their labels. A release prints the same period a year before beside the new one, and the company's 10-Q or 10-K has given that year in XBRL. Darvas keeps a release only when that column agrees with the XBRL; the same check gives the scale of a table that states none. A release whose year before the company has not filed keeps its figures when the totals it prints agree. A cash flow statement counts only for the period its columns cover, so a quarter's release with a year-to-date cash flow statement has no quarterly cash flow. Releases that give their figures only in prose, without statements, have no 8-K entry; their 10-Q or 10-K entry follows. Read against the 10-Qs that followed 160 releases of July and August 2026, the releases Darvas kept agreed on revenue 70 of 70 times, on EPS 27 of 27 and on net income 66 of 75: a release may print a net income other than the parent's. ## Feed Without `ticker` or `cik`, the answer is the newest earnings filings of every company, newest first: each company's period appears once, with its 10-Q or 10-K once filed and its release until then. `limit` is 10 by default and at most 100. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/earnings" body = requests.get(url, headers=headers, params={"ticker": "AAPL", "limit": 4}).json() for entry in body["earnings"]: quarter = entry.get("quarterly", {}) print(entry["report_period"], entry["source_type"], quarter.get("revenue"), quarter.get("revenue_yoy_chg")) feed = requests.get(url, headers=headers, params={"limit": 20}).json() for entry in feed["earnings"]: print(entry["filing_datetime"], entry["ticker"], entry["fiscal_period"], entry["filing_window"]) ``` # All Financial Statements API in One Request Source: https://docs.darvas.app/financials/all-statements openapi.yaml GET /financials Retrieve standardized income statements, balance sheets and cash flow statements together in one call for DCF modeling and fundamental analysis. ## Overview Fetch a company's standardized income statement, balance sheet and cash flow statement together in one HTTP round trip. The response groups the three statements under `financials.income_statements`, `financials.balance_sheets` and `financials.cash_flow_statements`, ordered from the newest `report_period` backward. Using the combined endpoint eliminates synchronization bugs that appear when separate statement requests paginate or update mid-flight during earnings releases. Valuation models, leverage screens and working-capital checks receive matched period boundaries from the same snapshot. | Coverage | Details | | - | - | | Scope | Standardized US GAAP and IFRS filers submitting XBRL to SEC, plus UK and French annual ESEF and UKSEF reports | | Statements returned | Income statement, balance sheet and cash flow statement bundled in one payload | | Period modes | `annual`, `quarterly` and `ttm` for SEC filers; `annual` only for UK and French issuers | | Page size | 10 matched periods per page; `limit` spans cursor pages up to 400 periods | | MCP tool | `list_financials` on the [data API MCP server](/mcp-server) | ## Parameters Identify the company with `ticker`, `cik` or `isin`, then narrow the horizon by cadence, period end date or SEC acceptance date. | Parameter | Type | Description | | - | - | - | | `ticker` | string | Exchange ticker symbol. Pair with `market` when querying London (`UK`) or Paris (`FR`) equities. | | `cik` | string | SEC Central Index Key, useful for delisted issuers or tickers that changed after a merger. | | `isin` | string | Twelve-character ISIN for European annual reports; replaces `ticker` and `market`. | | `market` | string | Optional market selector (`UK` or `FR`) for European annual statements; `exchange=LSE` remains a deprecated alias for `UK`. | | `period` | string | Reporting cadence: `annual`, `quarterly` or `ttm`. | | `limit` | integer | Maximum periods to return across paginated requests, up to 400. | | `report_period`, `report_period_gte`, `report_period_lte`, `report_period_gt`, `report_period_lt` | string | Filter rows by fiscal period end date in `YYYY-MM-DD` format. | | `filing_date`, `filing_date_gte`, `filing_date_lte`, `filing_date_gt`, `filing_date_lt` | string | Filter rows by SEC filing acceptance date for point-in-time historical queries. | | `cursor` | string | Opaque token from the previous response used to read the next page of matched periods. | ## Normalization and restatement handling Every line item uses one canonical schema regardless of whether the underlying filing reports under US GAAP or IFRS. Detailed tag-mapping rules live in [how the statements are built](/financials/income-statements#how-the-statements-are-built), and single-statement views remain available at [Balance sheets](/financials/balance-sheets) and [Cash flow statements](/financials/cash-flow-statements). 1. **Canonical sign conventions.** Cash outflows such as `capital_expenditure`, share buybacks and dividend payments carry negative signs so `free_cash_flow` equals operating cash flow plus capital expenditure without ad-hoc sign flips. 2. **Derived totals and null safety.** Missing fields stay `null` instead of being coerced to zero. Cross-statement identities, including balance sheet equality and cash-flow reconciliation, run before a filing enters the response. 3. **Restatement resolution.** By default, each `report_period` reflects the newest accepted filing that restated or updated that period. Adding `filing_date_lte` restricts selection to filings publicly available on or before that cutoff date, preventing look-ahead bias in quantitative backtests. ## Fiscal period alignment across the three statements Index the three arrays by `report_period` rather than assuming positional equality alone, because rare early filings or amended standalone disclosures can omit one statement for a historical period. * **Quarterly isolation.** When a 10-Q reports six-month or nine-month cumulative cash flows, Darvas subtracts the prior year-to-date filing so the quarterly income and cash flow rows describe the exact same three-month span while the balance sheet captures the ending date. * **Fourth-quarter derivation.** Standalone Q4 flow figures equal the audited full-year 10-K minus the first nine months, paired with the fiscal year-end balance sheet. * **Trailing twelve months (`ttm`).** Flow metrics sum four consecutive quarters ending on `report_period`, whereas balance sheet lines and share counts come from the final quarter of that rolling window. * **Currency integrity.** All three statements report in the issuer's filed `currency`, so foreign private issuers filing 20-F reports in EUR, JPY or GBP keep consistent denominations across ratios without mixing FX rates. ## Practical query patterns ### Build a multi-year DCF input table Pull annual statements in one call and join the three arrays on `report_period` to compute operating margin, net debt and free cash flow conversion together. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.get( "https://api.darvas.app/v1/financials", headers=headers, params={"ticker": "AAPL", "period": "annual", "limit": 5}, ).json() balance_by_period = {row["report_period"]: row for row in body["financials"]["balance_sheets"]} cash_by_period = {row["report_period"]: row for row in body["financials"]["cash_flow_statements"]} for income in body["financials"]["income_statements"]: period = income["report_period"] balance = balance_by_period.get(period, {}) cash = cash_by_period.get(period, {}) net_debt = (balance.get("total_debt") or 0) - (balance.get("cash_and_equivalents") or 0) print(income["fiscal_period"], income["revenue"], cash.get("free_cash_flow"), net_debt) ``` ### Run a point-in-time historical snapshot Combine `period=ttm` with `filing_date_lte` to reconstruct the exact trailing fundamentals an analyst could observe before a past rebalance date. ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financials?ticker=MSFT&period=ttm&filing_date_lte=2025-12-31&limit=4" ``` # All As-Reported SEC XBRL Statements API Source: https://docs.darvas.app/financials/as-reported-statements openapi.yaml GET /financials/as-reported Retrieve raw as-reported SEC XBRL income statement, balance sheet and cash flow line items together in one JSON response for audit workflows. ## Overview One request returns the three statements of each period; a statement the filing does not include is null. **MCP tool:** `list_as_reported_financials` on the [data API MCP server](/mcp-server). Line items come in the filing's own order and hierarchy, with the company's labels: `label` is what the filing shows, `full_label` the standard label of the XBRL `concept`, and `children` the lines under a heading. Section headers have no `value`. Values are the filing's own period: the balance at its end, the year or quarter of the income statement, and the cash flow statement as presented, which a 10-Q gives year to date. `annual` reads 10-K, 20-F and 40-F filings, `quarterly` 10-Q filings; a period a later filing restated answers with the newest filing. Darvas reads each filing's own XBRL, newest filings first back to June 2009. IFRS filers present profit or loss in a statement of comprehensive income, which then serves as the income statement. A company that presents a statement with dimensions, such as Berkshire Hathaway's revenues by business group, has those lines without a value. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.get( "https://api.darvas.app/v1/financials/as-reported", headers=headers, params={"ticker": "AAPL", "period": "annual", "limit": 2}, ).json() def show(lines, depth=0): for line in lines: print(" " * depth + line["label"], line["value"]) show(line["children"], depth + 1) for period in body["financials"]: if period["balance_sheet"] is not None: show(period["balance_sheet"]["line_items"]) ``` # Balance Sheet API: Assets, Debt & Equity Data Source: https://docs.darvas.app/financials/balance-sheets openapi.yaml GET /financials/balance-sheets Fetch standardized annual and quarterly balance sheets of SEC filers and UK and French companies, with cash, inventory, debt, goodwill and equity lines. ## Overview Standardized balance sheets at the end of each period. `annual` gives fiscal year ends, `quarterly` every quarter end, and `ttm` the balance sheet of the quarter that closes the twelve months. `total_debt` adds current and non-current debt; `investments` adds current and non-current investments. Coverage, restatements and the checks are as for [income statements](/financials/income-statements#how-the-statements-are-built). **MCP tool:** `list_balance_sheets` on the [data API MCP server](/mcp-server). ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} sheets = requests.get( "https://api.darvas.app/v1/financials/balance-sheets", headers=headers, params={"ticker": "JPM", "period": "quarterly", "limit": 4}, ).json() for row in sheets["balance_sheets"]: print(row["report_period"], row["total_assets"], row["deposit_liabilities"], row["shareholders_equity"]) ``` # Cash Flow Statement API: OCF, CapEx & FCF Source: https://docs.darvas.app/financials/cash-flow-statements openapi.yaml GET /financials/cash-flow-statements Access standardized annual, quarterly and TTM cash flow statements including operating cash flow, capital expenditure, free cash flow and buybacks. ## Overview Standardized cash flow statements. Outflows are negative, as on the statement: `capital_expenditure`, repurchases in `issuance_or_purchase_of_equity_shares` and `dividends_and_other_cash_distributions`. `free_cash_flow` is operating cash flow plus capital expenditure, and null when either is unknown. Most 10-Qs report cash flows only year to date; their quarters are the difference of two filings. Coverage, restatements and the checks are as for [income statements](/financials/income-statements#how-the-statements-are-built). **MCP tool:** `list_cash_flow_statements` on the [data API MCP server](/mcp-server). ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} flows = requests.get( "https://api.darvas.app/v1/financials/cash-flow-statements", headers=headers, params={"ticker": "MSFT", "period": "ttm", "limit": 8}, ).json() for row in flows["cash_flow_statements"]: print(row["report_period"], row["net_cash_flow_from_operations"], row["capital_expenditure"], row["free_cash_flow"]) ``` # DCF Valuation API with Reverse DCF Source: https://docs.darvas.app/financials/dcf-valuation openapi.yaml GET /valuation/dcf Value a US company with a two-stage FCFF DCF from its trailing year: named assumptions, projection, a WACC and growth grid, and the growth price implies. ## Overview This endpoint values a US company with a two-stage unlevered free cash flow DCF built from its trailing twelve months. Every assumption comes with its value, where it came from (`derived`, `default` or `caller`) and why: the 10-year Treasury yield as the risk-free rate, beta from five years of monthly returns, the cost of debt and tax rate from the statements. Free cash flow grows at `fcf_growth_pct` in year one and fades to `terminal_growth_pct`. The answer gives the yearly projection, terminal value, enterprise and equity value, intrinsic value per share against today's price, a grid over WACC and terminal growth, and a reverse DCF that solves for the year-one growth today's price implies. Any assumption can be set in the query. | Coverage | Details | | - | - | | Companies | US companies with a trailing twelve months of statements, by ticker or CIK | | Overrides | `wacc_pct`, `terminal_growth_pct`, `fcf_growth_pct`, `equity_risk_premium_pct`, `risk_free_rate_pct`, `beta`, `cost_of_debt_pct`, `tax_rate_pct`, `projection_years` | | Grid | WACC ±2 points by terminal growth ±1 point, per share | | Blocked model | `null_reason` names what stops it, such as a negative free cash flow | | MCP tool | `get_dcf_valuation` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/valuation/dcf", headers=headers, params={ "ticker": "MSFT", "terminal_growth_pct": 2.5, }, ).json() dcf = answer["dcf"] print(dcf["intrinsic_value_per_share_usd"], dcf["current_price_usd"], dcf["upside_pct"]) print(dcf["assumptions"]["wacc_pct"], dcf["reverse_dcf"]["implied_fcf_growth_pct"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/valuation/dcf?ticker=MSFT&terminal_growth_pct=2.5" ``` # Corporate Debt Maturity Schedule API (SEC) Source: https://docs.darvas.app/financials/debt-schedule openapi.yaml GET /financials/debt-schedule Build a five-year plus thereafter corporate debt maturity ladder from SEC XBRL disclosures, with debt balances, weighted-average maturity and source tags. ## Overview This endpoint builds a standardized five-year plus thereafter principal debt maturity schedule directly from SEC `us-gaap` and `ifrs-full` XBRL disclosures. Each filing entry in `debt_schedules` pairs maturity buckets (`year_1` through `year_5` and `thereafter`) with balance-sheet short-term, long-term, and total debt, percentage shares by bucket, estimated weighted-average maturity, and the exact XBRL tags used for every figure. | Coverage | Details | | - | - | | Company lookup | `ticker` (any case; ignored when `cik` is sent) or `cik` (with or without leading zeros); includes linked predecessor CIKs | | Filing cadence | `period` accepts `latest` (default), `annual` (`10-K`, `20-F`, `40-F` and amendments), or `quarterly` (`10-Q` and `10-Q/A`) | | Row limit | `limit` from `1` to `20` filings (default `4`), newest `report_date` first | | Currency | Primary 3-letter ISO currency reported in each filing (ties break to `USD`) | | MCP tool | `get_debt_schedule` on the [data API MCP server](/mcp-server) | ## Maturity ladder math and auditability Companies report principal repayments and carrying debt under several XBRL concept names. Darvas normalizes them per filing while keeping full tag provenance in `source_tags`. * **`period=latest` selection.** Annual reports usually carry the full five-year maturity footnote while interim `10-Q` filings often report balance-sheet debt only. With `period=latest`, Darvas scans all periodic filings, deduplicates by `report_date` (preferring a filing with maturity buckets, then latest `filed` date), and returns filings that contain a maturity ladder when available, falling back to balance-only filings otherwise. * **Weighted-average maturity and shares.** `total_maturities` sums all non-null buckets from `year_1` through `thereafter`. `share_by_year` expresses each bucket as a percentage of `total_maturities` (two decimals). `weighted_average_maturity_years` weights reported buckets using fixed-income midpoints: `0.5` (`year_1`), `1.5` (`year_2`), `2.5` (`year_3`), `3.5` (`year_4`), `4.5` (`year_5`), and `7.5` years (`thereafter`). * **Debt balances versus principal maturities.** `short_term_debt`, `long_term_debt`, and `total_debt` reflect balance-sheet carrying amounts, which can differ from `total_maturities` because of unamortized discounts, issuance costs, or commercial paper outside the long-term principal schedule. * **Exact tag provenance.** `source_tags` records the exact `taxonomy:Tag` or composite expression behind each field, such as `us-gaap:CommercialPaper+us-gaap:LongTermDebtCurrent` or `computed:short_term_debt+long_term_debt`. * **Related endpoints.** Inspect raw underlying debt tags at [`/financials/xbrl-facts`](/financials/xbrl-facts) with `tag=LongTermDebt*`. Combine maturity walls with leverage ratios at [`/financial-metrics/snapshot`](/financials/metrics-snapshot) and full balance sheets at [`/financials/balance-sheets`](/financials/balance-sheets). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/financials/debt-schedule", headers=headers, params={"ticker": "AAPL", "period": "latest", "limit": 2}, ).json() latest = resp["debt_schedules"][0] print(latest["form"], latest["report_date"], latest["currency"], "WAM (yrs):", latest["weighted_average_maturity_years"]) print("Total maturities:", latest["total_maturities"], "Total debt:", latest["total_debt"]) print("Shares by year (%):", latest["share_by_year"]) print("Year 1 tag:", latest["source_tags"]["year_1"]) ``` ```bash theme={null} # Last 5 annual debt maturity schedules for Ford (F) curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financials/debt-schedule?ticker=F&period=annual&limit=5" ``` # Extended Financial Metrics API: 150+ Ratios Source: https://docs.darvas.app/financials/extended-metrics openapi.yaml GET /financial-metrics/extended Fetch every valuation, profitability, return, efficiency, liquidity, leverage, cash flow, per-share and growth metric per period, each null with its cause. ## Overview This endpoint returns every metric of the Darvas metric catalog for one company per period, newest first, ten periods a page. The metrics come grouped by category: `valuation`, `profitability`, `returns`, `efficiency`, `liquidity`, `leverage`, `cash_flow`, `per_share` and `growth`. A metric is a number or `null`, and every `null` names its cause in `null_reasons`, such as `missing_input` or `not_meaningful` for a P/E on a loss. Each metric's formula, unit and inputs are at [`/financial-metrics/catalog`](/financials/metrics-catalog). The periods, filters and pagination are those of [`/financial-metrics`](/financials/metrics). | Coverage | Details | | - | - | | Companies | Every SEC filer with standardized statements, and UK and French companies by `market` or `isin` | | Periods | `annual`, `quarterly` or `ttm`; ten periods a page with `next_page_url` | | Units | Names end in `_usd`, `_pct`, `_ratio` or `_days`; `units` restates them in every answer | | Valuation | The last close at most ten days before the period end, on the share count of the row's filing | | MCP tool | `list_extended_financial_metrics` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/financial-metrics/extended", headers=headers, params={ "ticker": "AAPL", "period": "ttm", "limit": 4, }, ).json() for row in answer["financial_metrics"]: print(row["report_period"], row["valuation"]["price_to_earnings_ratio"], row["null_reasons"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financial-metrics/extended?ticker=AAPL&period=ttm&limit=4" ``` # Income Statement API: Annual, Quarterly & TTM Source: https://docs.darvas.app/financials/income-statements openapi.yaml GET /financials/income-statements Query standardized annual, quarterly and TTM income statements of about 20,600 SEC filers and UK and French companies: revenue, gross profit, EBIT and EPS. ## Overview Standardized income statements of US-listed companies and foreign companies filing with SEC, under the same field names for every company. Each 10-K, 10-Q, 20-F and 40-F with XBRL data since 2009 gives the rows of its own period. | Coverage | Details | | - | - | | Companies | About 20,600 XBRL filers | | History | Every 10-K, 10-Q, 20-F and 40-F with XBRL since 2009; fiscal years back to 1993 from older 10-Ks | | Periods | `annual`, `quarterly`, `ttm` | | Updated | Minutes after acceptance, once SEC's XBRL API shows the filing; at the latest from SEC's nightly file | | Page size | 10 periods; `limit` counts across pages, up to 400 | | MCP tool | `list_income_statements` on the [data API MCP server](/mcp-server) | ## How the statements are built * Values come from SEC's XBRL company facts: the numbers each filing tags under the US GAAP or IFRS taxonomy. A field maps to the tags filers use for it, in order of preference; `ebit`, `free_cash_flow` and a few totals are computed from other fields when the filing does not tag them. * A quarter that a 10-Q reports only year to date is the difference of two year-to-date values. The fourth quarter is the fiscal year less its first nine months, and its row carries the 10-K. Share counts are never subtracted, so a derived fourth quarter has no weighted average shares. * `ttm` adds the four quarters that end on its date; balance sheet values and share counts are those of its last quarter, and `form_type` is null. * Each row uses the facts known when its filing was made. A period that a later filing restated answers with the newest filing; with a `filing_date` filter, with the newest one filed within it. `filing_date_lte` therefore gives what was public on a day. * Every row is checked against the totals its filing reports: assets against liabilities and equity, gross profit against revenue less cost of revenue, the change in cash against the three cash flows. Values are in `currency`, as filed. A field the filing does not report is null. Fiscal years before XBRL come from the 10-K's own tables, plain text or HTML, read without a model: a table reaches the API only when the totals it prints agree, and its cash flow statement must start from its income statement's net income. These years have no quarters or trailing twelve months, and fewer fields than the XBRL years. ## UK and French companies Listed companies in the UK and France file their annual report as XBRL under ESEF, or UKSEF in the UK. Darvas reads every such report for the years ending since 2020 and builds its fiscal year by the same rules as the US statements. Name the company by `ticker` and `market`, or by `isin`: | Parameter | Example | Notes | | - | - | - | | `market` | `UK`, `FR` | `exchange=LSE` is a deprecated alias of `market=UK` | | `ticker` | `RR.`, `BT.A`, `MC` | London tickers keep the exchange's spelling; `RR` finds `RR.` too | | `isin` | `GB00B63H8491` | Any share of the company, instead of `ticker` and `market` | These companies carry `annual` periods only; `quarterly` and `ttm` answer 400. Values are in the report's currency, mostly GBP or EUR. `accession_number` and `filing_datetime` are null, `form_type` is `ESEF` or `UKSEF`, and `filing_url` opens the report in an online viewer. [Statement Tickers](/financials/tickers) lists each market's companies. A company found by its ISIN needs a share traded in the EU, and one found by its ticker a London or Paris listing. A company that only lists bonds has statements but no ticker or ISIN to find them by. ## Known gaps * SEC's company facts hold no values with dimensions, so a figure a company reports only per share class or per segment, such as Berkshire Hathaway's earnings per Class A share, is null. * SEC's company facts sometimes miss the IFRS values of a 20-F; those periods are absent until SEC adds them. * Not every French report is available: about 290 French companies since 2020. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/financials/income-statements" quarters = requests.get(url, headers=headers, params={"ticker": "NVDA", "period": "quarterly", "limit": 8}).json() for row in quarters["income_statements"]: print(row["fiscal_period"], row["revenue"], row["earnings_per_share_diluted"]) # The statements as they were known on 1 February 2026. as_of = requests.get( url, headers=headers, params={"ticker": "AAPL", "period": "ttm", "filing_date_lte": "2026-02-01", "limit": 1} ).json() ``` # Financial Line Items Multi-Ticker Query API Source: https://docs.darvas.app/financials/line-items openapi.yaml POST /financials/search/line-items Pull specific standardized income, balance sheet or cash flow line items across multiple tickers and fiscal periods in a single POST request. ## Overview Send the statement fields you need and the companies, and get the newest `limit` periods of each, in the order of the tickers. Any field of the [income statement](/financials/income-statements), [balance sheet](/financials/balance-sheets) or [cash flow statement](/financials/cash-flow-statements) works; `net_income` is the income statement's. A ticker Darvas does not know returns no rows. **MCP tool:** `search_line_items` on the [data API MCP server](/mcp-server). ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.post( "https://api.darvas.app/v1/financials/search/line-items", headers=headers, json={"line_items": ["revenue", "free_cash_flow", "total_debt"], "tickers": ["AAPL", "MSFT", "NVDA"], "period": "ttm"}, ).json() for row in body["search_results"]: print(row["ticker"], row["report_period"], row["revenue"], row["free_cash_flow"]) ``` # Historical Valuation Ratios & Metrics API Source: https://docs.darvas.app/financials/metrics openapi.yaml GET /financial-metrics Query historical P/E, EV/EBITDA, P/S, P/B, ROE, ROIC, margins and leverage ratios by fiscal period for backtesting and equity valuation models. ## Overview Ratios computed from the [standardized statements](/financials/income-statements), one row per fiscal year, quarter or trailing twelve months, with the statement's filing metadata. **MCP tool:** `list_financial_metrics` on the [data API MCP server](/mcp-server). | Group | Ratios | How | | - | - | - | | Profitability | `gross_margin`, `operating_margin`, `net_margin`, `return_on_equity`, `return_on_assets`, `return_on_invested_capital` | Over revenue, period-end equity, period-end assets, and debt plus equity less cash | | Efficiency | `asset_turnover`, `inventory_turnover`, `receivables_turnover`, `days_sales_outstanding`, `operating_cycle`, `working_capital_turnover` | Over the average of the period's balance and the previous one | | Liquidity and leverage | `current_ratio`, `quick_ratio`, `cash_ratio`, `operating_cash_flow_ratio`, `debt_to_equity`, `debt_to_assets`, `interest_coverage` | At the period end | | Growth | `revenue_growth`, `earnings_growth`, `book_value_growth`, `earnings_per_share_growth`, `free_cash_flow_growth`, `operating_income_growth`, `ebitda_growth` | Against the same period a year earlier, over the size of the earlier value | | Per share | `earnings_per_share`, `book_value_per_share`, `free_cash_flow_per_share`, `payout_ratio` | Over period-end shares outstanding | Ratios are fractions: a 46% margin is `0.46`. A quarter's ratios use the quarter alone and are not annualized; use `period=ttm` for yearly ratios at every quarter end. A ratio whose inputs the filing does not report is null. Valuation ratios (`market_cap`, `enterprise_value`, `price_to_earnings_ratio`, `price_to_book_ratio`, `price_to_sales_ratio`, `enterprise_value_to_ebitda_ratio`, `enterprise_value_to_revenue_ratio`, `free_cash_flow_yield`, `peg_ratio`) take the stock's last close at most 10 days before the period ends. Darvas adjusts that close for splits onto the share count of the period's filing. They are null for statements in a currency other than USD, for UK and French companies, and for a period without a stored US close. The [snapshot](/financials/metrics-snapshot) prices the newest trailing twelve months at the latest share price. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} metrics = requests.get( "https://api.darvas.app/v1/financial-metrics", headers=headers, params={"ticker": "AAPL", "period": "ttm", "limit": 8}, ).json() for row in metrics["financial_metrics"]: print(row["report_period"], row["gross_margin"], row["return_on_equity"], row["revenue_growth"]) ``` # Financial Metrics Catalog: Formulas & Units Source: https://docs.darvas.app/financials/metrics-catalog openapi.yaml GET /financial-metrics/catalog Read every financial metric's category, unit, formula and inputs, the facts formulas read, and the inputs that must be positive for a metric to mean anything. ## Overview This endpoint returns the catalog behind [`/financial-metrics/extended`](/financials/extended-metrics): every metric with its category, unit, formula, the facts it reads and the facts that must be above zero, such as the net income under a P/E. `facts` gives the meaning of every fact a formula names, and `methodology` says how periods, averages, growth and valuation prices are chosen. The catalog is one record, so a call costs one credit whatever its length. | Coverage | Details | | - | - | | Metrics | Every metric of the extended set, in answer order | | Categories | `valuation`, `profitability`, `returns`, `efficiency`, `liquidity`, `leverage`, `cash_flow`, `per_share`, `growth` | | Units | `usd`, `usd_per_share`, `pct`, `ratio`, `days` and `shares` | | MCP tool | `get_financial_metrics_catalog` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/financial-metrics/catalog", headers=headers, ).json() catalog = answer["catalog"] print(catalog["metric_count"], catalog["categories"]) for metric in catalog["metrics"][:5]: print(metric["name"], metric["unit"], metric["formula"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financial-metrics/catalog" ``` # Live Stock Valuation Ratios & TTM Metrics API Source: https://docs.darvas.app/financials/metrics-snapshot openapi.yaml GET /financial-metrics/snapshot Get the latest TTM P/E, EV/EBITDA, market cap, enterprise value, margins, growth rates and return ratios of a covered US stock in one request. ## Overview This endpoint returns all 39 [financial metrics](/financials/metrics) for a US company's newest trailing twelve months (`ttm`) in one `snapshot` object alongside `ticker`, `report_period`, and `currency`. Valuation multiples (`market_cap`, `enterprise_value`, `price_to_earnings_ratio`, `price_to_book_ratio`, `price_to_sales_ratio`, `enterprise_value_to_ebitda_ratio`, `enterprise_value_to_revenue_ratio`, `free_cash_flow_yield`, and `peg_ratio`) are computed live from the stock's latest US share price at [`/prices/snapshot`](/stocks/price-snapshot). | Coverage | Details | | - | - | | Company lookup | `ticker` (any case; ignored when `cik` is sent) or `cik` (with or without leading zeros) | | Period basis | Newest trailing twelve months (`ttm`); averages and year-over-year growth read up to five preceding TTM periods | | Valuation pricing | Latest US stock price from [`/prices/snapshot`](/stocks/price-snapshot), split-adjusted onto the filing's share count | | Units | Ratios and growth rates are decimal fractions (a 48.8% margin is `0.488`); `days_sales_outstanding` and `operating_cycle` are in days | | MCP tool | `get_financial_metrics_snapshot` on the [data API MCP server](/mcp-server) | ## Valuation computation and edge cases * **Market cap and enterprise value.** Darvas adjusts the latest US share price for any stock splits between the filing date and the quote date so it matches the filing's share basis, then multiplies by `outstanding_shares` (falling back to diluted then basic weighted-average shares) for `market_cap`. `enterprise_value` equals `market_cap + total_debt - cash_and_equivalents`, treating missing debt or cash as zero. `peg_ratio` divides `price_to_earnings_ratio` by diluted EPS growth in percent. * **When valuation fields are `null`.** Valuation fields return `null` when Darvas has no US stock price for the ticker, when the filing reports no share count, or when the company's statements are reported in a currency other than `USD`. Any individual ratio whose underlying statement input is missing or zero also returns `null`. * **Non-US annual filers.** UK and French ESEF filings (`uk:` and `fr:` prefixes) do not report trailing twelve months and return `400` here; query [`/financial-metrics`](/financials/metrics) with `period=annual` instead. * **Related endpoints.** For historical ratio series across annual, quarterly, and TTM periods, see [`/financial-metrics`](/financials/metrics) and [`/financial-metrics/tickers`](/financials/metrics-tickers). For stock prices and split history, see [`/prices/snapshot`](/stocks/price-snapshot) and [`/prices/splits`](/stocks/splits). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} snapshot = requests.get( "https://api.darvas.app/v1/financial-metrics/snapshot", headers=headers, params={"ticker": "AAPL"}, ).json()["snapshot"] print( snapshot["report_period"], "mkt cap:", snapshot["market_cap"], "P/E:", snapshot["price_to_earnings_ratio"], "EV/EBITDA:", snapshot["enterprise_value_to_ebitda_ratio"], "net margin:", snapshot["net_margin"], ) ``` ```bash theme={null} # Latest TTM valuation, profitability and leverage ratios for NVIDIA curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financial-metrics/snapshot?ticker=NVDA" ``` # Stock Peer Comparison & Valuation Comps API Source: https://docs.darvas.app/financials/peer-comparison openapi.yaml GET /financials/peer-comparison Compare 2 to 20 US stocks side by side with 12 peer group medians across valuation multiples, growth, margins and returns, from one request by tickers. ## Overview This endpoint lines up the latest price and the newest trailing twelve month (TTM) financial ratios of 2 to 20 US stocks, one entry per ticker, and adds the peer group median of the main valuation, profitability, growth and leverage metrics. Use it for comparable company analysis, relative valuation screens and questions such as "is MSFT expensive against its peers?". | Coverage | Details | | - | - | | Companies | US stocks with stored financial metrics or a stored price | | Tickers | 2 to 20 unique tickers in `tickers`, comma-separated; duplicates are dropped | | Per peer | `price`, `day_change_percent` and every field of the [financial metrics snapshot](/financials/metrics-snapshot) | | Medians | 12 metrics across peers with `status: "ok"`, nulls ignored | | MCP tool | `compare_financial_peers` on the [data API MCP server](/mcp-server) | ## Parameters and response `tickers` is the only parameter, such as `tickers=AAPL,MSFT,GOOGL`. Fewer than 2 or more than 20 unique tickers return `400`, and the answer is `404` only when none of them has stored metrics or a price. | Field | Description | | - | - | | `tickers` | The unique tickers, uppercased, in the order sent | | `peers` | One entry per ticker in the same order. `status` is `ok` or `not_found`; an `ok` entry adds `price`, `day_change_percent`, `report_period`, `currency`, `market_cap`, `enterprise_value`, the valuation ratios, margins, returns, turnover, liquidity, leverage, growth and per share fields | | `medians` | `market_cap`, `enterprise_value`, `price_to_earnings_ratio`, `price_to_book_ratio`, `price_to_sales_ratio`, `enterprise_value_to_ebitda_ratio`, `gross_margin`, `operating_margin`, `net_margin`, `return_on_equity`, `revenue_growth` and `debt_to_equity` | Margins, returns and growth rates are fractions: `0.318` is 31.8%. A median of an even number of peers is the mean of the two middle values; a metric no peer has is `null`. A peer that sends `not_found` carries only `ticker` and `status`, so check `status` before reading its fields. ## Related endpoints For one company's full ratio history, see [Financial Ratios](/financials/metrics). To find the peers themselves by ratio thresholds, use the [Stock Screener](/financials/stock-screener). For one company with its insider, 13F and 8-K activity, use the [Company Dossier](/companies/dossier). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/financials/peer-comparison", headers=headers, params={"tickers": "AAPL,MSFT,GOOGL,AMZN,META"}, ).json() medians = answer["medians"] print("Peer median P/E:", medians["price_to_earnings_ratio"], "EV/EBITDA:", medians["enterprise_value_to_ebitda_ratio"]) for peer in answer["peers"]: if peer["status"] != "ok": print(peer["ticker"], "not found") continue pe = peer.get("price_to_earnings_ratio") premium = None if pe is not None and medians["price_to_earnings_ratio"]: premium = round((pe / medians["price_to_earnings_ratio"] - 1) * 100, 1) print(peer["ticker"], peer["price"], "P/E:", pe, "vs median %:", premium, "Net margin:", peer.get("net_margin")) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financials/peer-comparison?tickers=NVDA,AMD,INTC,AVGO" ``` # Altman Z, Piotroski F & Beneish M Score API Source: https://docs.darvas.app/financials/quality-scores openapi.yaml GET /financials/scores Get Altman Z-Score, Piotroski F-Score and Beneish M-Score per year from SEC statements, with every component, threshold and the model the SIC code recommends. ## Overview This endpoint scores one company per annual or trailing year, newest first, ten a page. Altman's Z-Score comes in its 1968 form for public manufacturers and its Z'' form for other companies, with the form the SIC code recommends. Piotroski's F-Score shows each of its nine tests, and Beneish's M-Score each of its eight indices, so every score can be checked by hand. Scores compare whole years: send `period=annual` or `period=ttm`. A score with a missing input is `null` and names what is missing in `null_reason`. | Coverage | Details | | - | - | | Companies | Every SEC filer with standardized statements | | Periods | `annual` or `ttm`; ten scored periods a page | | Altman zones | `safe`, `grey` or `distress` from each model's thresholds | | Beneish cutoff | `likely_manipulator` is true above -1.78 | | MCP tool | `list_financial_scores` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/financials/scores", headers=headers, params={ "ticker": "AAPL", "period": "annual", "limit": 3, }, ).json() for row in answer["quality_scores"]: altman = row["altman_z_score"][row["altman_z_score"]["recommended_model"]] print(row["report_period"], altman["z_score"], row["piotroski_f_score"]["f_score"], row["beneish_m_score"]["m_score"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financials/scores?ticker=AAPL&period=annual&limit=3" ``` # All Company Segment Financial Disclosures API Source: https://docs.darvas.app/financials/segments openapi.yaml GET /financials/segments Retrieve all SEC XBRL business and geographic segment income, balance sheet and cash flow breakdowns together in a single structured API query. ## Overview A segment value is a fact the filing reports on the product or service axis (`product`), the geographical axis (`geography`) or the business segment axis (`segment`) alone, for its own period: revenue, operating income and depreciation on the income statement; assets, goodwill and long-lived assets on the balance sheet; capital expenditure on the cash flow statement. Labels are the filing's own, such as `iPhone`, `Other countries` or `Americas`. A line the filing does not break down is null. `annual` reads 10-K, 20-F and 40-F filings, `quarterly` 10-Q filings. **MCP tool:** `list_segmented_financials` on the [data API MCP server](/mcp-server). ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.get( "https://api.darvas.app/v1/financials/segments", headers=headers, params={"ticker": "AAPL", "period": "annual", "limit": 4}, ).json() for period in body["segmented_financials"]: revenue = period["income_statement"]["revenue"] or {"product": [], "geography": [], "segment": []} for item in revenue["segment"]: print(period["fiscal_period"], item["label"], item["value"]) ``` # Fundamental Stock Screener API with Filters Source: https://docs.darvas.app/financials/stock-screener openapi.yaml POST /financials/search/screener Screen stocks over POST on the statement fields and ratios of their newest trailing twelve months, sorted and filtered, today or as known on a past day. ## Overview A screen reads each company's newest trailing twelve months in `currency` and keeps those that match every filter. Companies whose newest period ends more than 180 days before the screen date are left out. **MCP tool:** `screen_companies` on the [data API MCP server](/mcp-server). * Fields: every statement field, the ratios one period gives alone (margins, returns, liquidity, leverage, per share), and `sector`, `industry` and `ticker`. [Screener fields](/financials/screener-filters) lists them. * Operators: `gt`, `lt`, `gte`, `lte` and `eq` on numbers; `eq` and `in` on text, in any case; `in` takes a list. * `order_by` sorts on a numeric field before `limit` applies; without it, results come sorted by ticker. Companies without a value come last. * `as_of` screens what was public on that day: each company's newest filing accepted by then. It reaches back to 2010. `sector` is the SEC office that reviews the company's filings and `industry` its SIC industry, as [company facts](/companies/profile) gives them. They are not GICS classes, which are licensed. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.post( "https://api.darvas.app/v1/financials/search/screener", headers=headers, json={ "filters": [ {"field": "gross_margin", "operator": "gte", "value": 0.5}, {"field": "revenue", "operator": "gt", "value": 10_000_000_000}, {"field": "debt_to_equity", "operator": "lt", "value": 1}, ], "order_by": {"field": "revenue", "direction": "desc"}, "limit": 25, }, ).json() for company in body["results"]: print(company["ticker"], company["revenue"], company["gross_margin"]) ``` # Historical P/E & EV/EBITDA Valuation API Source: https://docs.darvas.app/financials/valuation-history openapi.yaml GET /valuation/history Get a US stock's daily, weekly or monthly market cap, enterprise value, P/E, P/S, P/B, EV/EBITDA and yields on the trailing year it had filed by each day. ## Overview This endpoint returns a US stock's market capitalization, enterprise value and valuation multiples on every trading day, or the last of each week or month, oldest first, 250 rows a page. Each day rests on the trailing twelve months the company had filed by that day, so a restatement filed later never changes an earlier day and the series has no look-ahead. Every row names the filing it rests on and how old its period is. Without dates the answer covers the last 365 days; one request spans up to 40 years. | Coverage | Details | | - | - | | Stocks | US listings with daily closes and standardized SEC statements | | Multiples | P/E, P/S, P/B, P/FCF, EV/revenue, EV/EBITDA, EV/EBIT, earnings, free cash flow and dividend yields | | Sampling | `day`, `week` or `month`; 250 rows a page with `next_page_url` | | Nulls | A multiple over a loss or a missing input is `null` with its cause in `null_reasons` | | MCP tool | `list_valuation_history` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/valuation/history", headers=headers, params={ "ticker": "AAPL", "interval": "month", "start_date": "2016-01-01", }, ).json() for day in answer["valuation_history"]: print(day["date"], day["price_to_earnings_ratio"], day["ev_to_ebitda_ratio"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/valuation/history?ticker=AAPL&interval=month&start_date=2016-01-01" ``` # SEC EDGAR XBRL Company Facts to JSON API Source: https://docs.darvas.app/financials/xbrl-facts openapi.yaml GET /financials/xbrl-facts Query raw non-dimensional SEC EDGAR XBRL facts in the us-gaap, ifrs-full and dei taxonomies by ticker or CIK, with wildcard tag prefixes, forms and units. ## Overview This endpoint exposes raw, non-dimensional SEC EDGAR XBRL facts for one company across the `us-gaap`, `ifrs-full`, and `dei` taxonomies. Use it when standardized statements omit a footnote concept or when you want exact SEC concept tags, measurement units, calendar frames, and filing links before applying your own accounting rules. | Coverage | Details | | - | - | | Company lookup | `ticker` (any case; ignored when `cik` is sent) or `cik` (with or without leading zeros); includes linked predecessor CIKs | | Taxonomies | Optional `taxonomy`: `us-gaap`, `ifrs-full`, or `dei` | | Tag matching | Optional exact concept `tag` (such as `Revenues`) or trailing wildcard prefix ending in `*` (such as `LongTermDebt*`) | | Extra filters | Optional `unit` (`USD`, `shares`, `USD/shares`, `pure`), `form` (`10-K`, `10-Q`, comma-separated or repeated), `period_end_gte`, and `period_end_lte` | | Pagination | `limit` from `1` to `1000` facts per page (default `200`), sorted newest `period_end` and `filed` first; paginate with `next_page_url` | | MCP tool | `list_xbrl_facts` on the [data API MCP server](/mcp-server) | ## Fact fields, instants and pagination Every row in `facts` preserves the SEC filing provenance alongside its accounting dates. * **Duration versus instant facts.** Flow items from income and cash flow statements populate both `period_start` and `period_end`. Balance-sheet and point-in-time disclosures set `period_start` to `null` and record the balance date in `period_end`. * **Wildcard concept search.** Append `*` to `tag` (for example `tag=LongTermDebt*` or `tag=OperatingLease*`) to pull every concept sharing a prefix in one query. Mid-string wildcards are rejected with `400`. * **Restatements and comparative rows.** A single fiscal period can appear in multiple filings (such as comparative columns in later `10-K` filings or `10-K/A` amendments). Inspect `filed`, `form`, `accession_number`, `frame` (such as `CY2026Q3I`), and `filing_url` to choose point-in-time or latest restated values. * **Cursor pagination.** When more rows match, `next_page_url` carries a `cursor` token that replaces all other query parameters. Passing `period_end_lte` earlier than `period_end_gte` returns `400`. * **Related endpoints.** For pre-built debt maturity ladders from these facts, see [`/financials/debt-schedule`](/financials/debt-schedule). For standardized financial statements, see [`/financials`](/financials/all-statements) and [`/financials/as-reported`](/financials/as-reported-statements). For dimensional segment breakdowns, see [`/financials/segments`](/financials/segments). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/financials/xbrl-facts", headers=headers, params={ "ticker": "AAPL", "taxonomy": "us-gaap", "tag": "LongTermDebt*", "unit": "USD", "form": "10-K", "period_end_gte": "2024-01-01", "limit": 100, }, ).json() print(resp["ticker"], resp["cik"], "facts returned:", len(resp["facts"])) for fact in resp["facts"][:5]: print(fact["period_end"], fact["tag"], fact["value"], fact["form"], "filed:", fact["filed"]) ``` ```bash theme={null} # Pull all dei entity share count facts for Microsoft from 10-K and 10-Q filings curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/financials/xbrl-facts?ticker=MSFT&taxonomy=dei&tag=EntityCommonStockSharesOutstanding&form=10-K,10-Q&limit=20" ``` # CFTC Commitment of Traders (COT) Data API Source: https://docs.darvas.app/futures/commitment-of-traders openapi.yaml GET /cot Query weekly CFTC Commitment of Traders positioning across 960+ futures markets, including CME Bitcoin, Ether, metals, rates, FX and commodities. ## Overview Every week the CFTC publishes the open futures positions of each market by the kind of trader that holds them: the positions of Tuesday, out the Friday after. Darvas reads the three futures-only reports: | `report` | Groups | Since | | - | - | - | | `legacy` (default) | `noncommercial`, `commercial`, `non_reportables` | 1986 | | `disaggregated` | `producer_merchant`, `swap_dealers`, `managed_money`, `other_reportables`, `non_reportables` | 2006 | | `tff`, traders in financial futures | `dealer`, `asset_manager`, `leveraged_funds`, `other_reportables`, `non_reportables` | 2006 | Name the market by `market_code`, the CFTC's six-character code: [COT Markets](/futures/cot-markets) finds it by name. CME's bitcoin futures are `133741` and its ether futures `146021`, both in `tff`. Each group carries `long`, `short`, `spread` and `net` in contracts, and the week's change of each; a field the report does not give for a group, such as the spread of commercials, is null. | Coverage | Details | | - | - | | Markets | 960+ CFTC futures markets listed by [COT Markets](/futures/cot-markets) | | Reports | `legacy` (default, since 1986), `disaggregated` (since 2006) and `tff` (since 2006) | | Pagination | `limit` with `next_page_url` and `cursor`, newest Tuesday report first | | MCP tool | `list_cot` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/cot" weeks = requests.get(url, headers=headers, params={"market_code": "133741", "report": "tff", "limit": 12}).json() for week in weeks["cot"]: funds = week["groups"]["leveraged_funds"] print(week["report_date"], funds["net"], funds["change_long"], funds["change_short"]) ``` # COT Index & Positioning Extremes API Source: https://docs.darvas.app/futures/cot-analytics openapi.yaml GET /cot/analytics Compute the 52 and 156-week COT Index, net position z-scores, crowding and hedger versus speculator divergence per market, or screen every market. ## Overview This endpoint analyses CFTC Commitments of Traders positioning. With `market_code` or `symbol`, such as ES, GC, CL or BTC, it returns that market's rolling analytics: the 52-week and 156-week COT Index from 0 to 100, percentiles and z-scores of net positions, the share of the largest four and eight traders, and flags for crowded and diverging groups. Without a market it screens every market for extremes, filtered by asset class, COT Index range, open interest, extremes or divergences only, and ranked by open interest, COT Index, z-score, weekly change or concentration. | Coverage | Details | | - | - | | Reports | `legacy`, `disaggregated` (commodities) or `tff` (financials and crypto) | | Single market | 1 to 156 trailing weeks; 26 by default | | Screener | Up to 500 markets, `52w` or `156w` lookback | | MCP tool | `get_cot_analytics` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/cot/analytics", headers=headers, params={ "symbol": "GC", "weeks": 52, }, ).json() print(answer["mode"], answer["market_code"], answer["as_of"]) print(answer["latest"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/cot/analytics?symbol=GC&weeks=52" ``` # US CPI & PCE Inflation Historical Data API Source: https://docs.darvas.app/macro/cpi-pce-inflation openapi.yaml GET /macro/inflation Query 14 official BLS CPI and BEA PCE inflation series including headline, core, shelter, energy and services inflation with exact release dates. ## Overview One row per month of a series, with the index level and its changes. Pass `series`; the ids are listed by [Inflation Series](/macro/inflation-series). | Series | Source | | - | - | | `cpi_all_sa`, `cpi_all_nsa`, `cpi_core_sa`, `cpi_core_nsa` | BLS, CPI-U all items and less food and energy | | `cpi_food_sa`, `cpi_energy_sa`, `cpi_shelter_sa`, `cpi_services_less_energy_sa`, `cpi_core_goods_sa` | BLS, CPI-U components | | `cpi_apparel_sa`, `cpi_transportation_sa`, `cpi_medical_care_sa` | BLS, CPI-U major groups | | `pce_all_sa`, `pce_core_sa` | BEA, PCE price index and PCE less food and energy | `change_1m_pct` and `change_12m_pct` are percent changes from the prior month and the same month a year earlier, to one decimal. `first_published_value` is the first level Darvas recorded; see [Market Coverage](/market-coverage) for what that means for periods before 25 November 2026. | Coverage | Details | | - | - | | Series | 14 official US inflation series (12 BLS CPI-U since 1947, 2 BEA PCE since 1959) | | Pagination | Up to 1,000 monthly rows per page in date order; follow `next_page_url` with `cursor` | | Discovery | Series IDs and source codes live at [Inflation Series](/macro/inflation-series) | | MCP tool | `list_inflation` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} base = "https://api.darvas.app/v1/macro" core = requests.get(f"{base}/inflation", headers=headers, params={"series": "cpi_core_sa", "start_date": "2025-01-01"}).json() for month in core["inflation"]: print(month["date"], month["change_12m_pct"]) ``` # Economic Calendar API: CPI, FOMC & Global Data Source: https://docs.darvas.app/macro/economic-calendar openapi.yaml GET /macro/economic-calendar Query global macroeconomic releases including CPI, NFP, FOMC and GDP with consensus estimates, actuals, revisions, impact levels and pagination. ## Overview This endpoint returns scheduled and published macroeconomic releases from official calendars worldwide: inflation, jobs, growth, central bank decisions and other indicators, each with its release time, importance, the actual value, the consensus forecast, the previous reading and any revision. Darvas adds the numeric surprise against consensus, so a trading script or an AI agent can ask "which high-impact USD releases come this week?" or "did CPI beat expectations?" in one call. | Coverage | Details | | - | - | | Countries and currencies | Listed with release counts by [Economic Calendar Countries](/macro/economic-calendar-countries) | | Default window | 7 days ago to 14 days ahead, in UTC | | Order | Oldest release first, by `release_at` | | Page size | `limit` from 1 to 200, 100 by default; `next_page_url` links the next page | | MCP tool | `list_economic_calendar` on the [data API MCP server](/mcp-server) | ## Parameters | Parameter | Description | | - | - | | `start_date`, `end_date` | Release date bounds in `YYYY-MM-DD` or ISO-8601 UTC (aliases `from` and `to`); `start_date` counts from 00:00 UTC and `end_date` through 23:59:59 UTC | | `country` | Comma-separated ISO 3166-1 alpha-2 codes (`US,GB,EU`), numeric ISO codes (`840`), or country names | | `currencies` | Comma-separated currency codes, such as `USD,EUR,GBP` (alias `currency`) | | `importance` | Comma-separated `low`, `medium` and `high` (alias `impact`); any other value returns `400` | | `event_name` | Case-insensitive substring of the release name, such as `CPI` or `Payrolls` | | `series_key` | One recurring release by exact key, such as `us-cpi-yoy` (defaults to a 5-year lookback and adds top-level `series_summary`) | | `q` | Case-insensitive search across event name, country name and `series_key` | | `updated_since`, `upcoming_only` | Incremental sync timestamp in ISO-8601 UTC, and boolean filter (`true` or `false`) for upcoming releases | | `format` | `json` (default) or `ics` for an RFC 5545 iCalendar feed | | `limit`, `cursor` | Page size (1 to 200, default 100), and the cursor carried by `next_page_url` | Follow `next_page_url` as returned: it keeps your filters and adds the cursor. Top-level JSON responses also carry `count`, `has_more`, `next_cursor` (when more rows remain), and `series_summary` (when `series_key` is set). Without `next_page_url`, the page is the last one. ## Response fields | Field | Description | | - | - | | `id`, `series_key` | The release identifier, and the recurring series it belongs to | | `event_name`, `canonical_event_name` | Display title and canonical English name | | `currency`, `country_code`, `country_iso2`, `country_name` | Affected currency, numeric ISO country code, alpha-2 code and country name | | `importance`, `event_type`, `time_mode`, `status` | Impact (`low`, `medium` or `high`), type (`event`, `indicator` or `holiday`), time mode (`exact`, `all_day` or `tentative`), and status (`released` or `scheduled`) | | `release_at`, `updated_at` | Scheduled release timestamp and last update timestamp in UTC | | `actual`, `forecast`, `previous`, `old_previous`, `unit` | Formatted strings as published (such as `2.7%`); `old_previous` holds the unrevised prior reading when revised (`null` until known) | | `actual_numeric`, `forecast_numeric`, `previous_numeric`, `old_previous_numeric` | Parsed floating-point values for `actual`, `forecast`, `previous` and revised `old_previous` (`null` when absent) | | `surprise`, `surprise_pct`, `surprise_z_score`, `surprise_direction` | `actual_numeric` minus `forecast_numeric`, percent surprise, point-in-time z-score against prior releases of the same series, and direction (`beat`, `miss` or `inline`) | For the full monthly histories behind US releases, see [CPI and Inflation](/macro/cpi-pce-inflation), [Labor Market](/macro/labor-market) and [GDP and Income](/macro/gdp-income); for policy rates, see [Central Bank Interest Rates](/macro/interest-rates). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/macro/economic-calendar" params = { "start_date": "2026-11-30", "end_date": "2026-12-11", "currencies": "USD,EUR", "importance": "high", } releases = [] while url: page = requests.get(url, headers=headers, params=params).json() releases.extend(page["economic_calendar"]) url, params = page.get("next_page_url"), None # the next URL carries the filters def verdict(surprise): if surprise is None: return "pending" if surprise > 0: return "above forecast" if surprise < 0: return "below forecast" return "in line" for r in releases: print(r["release_at"], r["currency"], r["event_name"], r["actual"], "vs", r["forecast"], verdict(r["surprise"])) ``` ```bash theme={null} # Every US CPI YoY release in 2026, oldest first curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/macro/economic-calendar?series_key=us-cpi-yoy&start_date=2026-01-01&end_date=2026-12-31" ``` # Fed Net Liquidity API: WALCL, TGA, RRP Source: https://docs.darvas.app/macro/fed-net-liquidity openapi.yaml GET /macro/liquidity Track Fed net liquidity (total assets less the Treasury General Account and reverse repo) daily, with weekly changes, a regime label and SOFR and EFFR spreads. ## Overview This endpoint tracks US dollar liquidity from the Federal Reserve's and the Treasury's own releases. It combines the Fed's weekly balance sheet (total assets, securities held outright and reserve balances) with the daily Treasury General Account and the daily overnight reverse repo, and derives Fed net liquidity as total assets less the TGA and reverse repo, with its 1-week and 4-week changes and a regime label. `reference_rates` gives the overnight rates SOFR, EFFR, OBFR, TGCR and BGCR with the spreads that show funding stress. `history` aligns every series by day. | Coverage | Details | | - | - | | Series | Fed total assets, securities held, reserves, TGA, overnight reverse repo and net liquidity | | Rates | SOFR, EFFR, OBFR, TGCR and BGCR | | History | 1 to 365 trailing days; 30 by default | | MCP tool | `get_macro_liquidity` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/macro/liquidity", headers=headers, params={ "days": 90, }, ).json() print(answer["snapshot"]) print(answer["reference_rates"]) print(len(answer["history"]), "days") ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/macro/liquidity?days=90" ``` # US GDP Growth, GDI & Corporate Profits API Source: https://docs.darvas.app/macro/gdp-income openapi.yaml GET /macro/gdp Query 12 official BEA national accounts series including real and nominal GDP, GDP growth components, GDI, corporate profits and saving rate. ## Overview One row per quarter or month of a series. Pass `series`; the ids are listed by [GDP Series](/macro/gdp-series). | Series | Frequency | BEA code | | - | - | - | | `real_gdp_growth`, `real_gdp`, `nominal_gdp` | Quarterly | A191RL, A191RX, A191RC | | `consumption_contribution`, `investment_contribution`, `net_exports_contribution`, `government_contribution` | Quarterly | DPCERY, A006RY, A019RY, A822RY | | `real_gdi_growth`, `corporate_profits` | Quarterly | A261RL, A051RC | | `personal_income`, `saving_rate`, `real_pce` | Monthly | A065RC, A072RC, DPCERX | Quarters are dated by their first day. Every estimate of a quarter (advance, second, third, annual revisions) adds a value; `value` is the newest. For quarters released since 25 November 2026, `first_published_value` is the advance estimate. | Coverage | Details | | - | - | | Series | 12 official BEA national accounts series covering quarterly GDP, GDI and corporate profits plus monthly income and saving | | Pagination | Up to 1,000 rows per page in date order; follow `next_page_url` with `cursor` | | Discovery | Series IDs and BEA codes live at [GDP Series](/macro/gdp-series) | | MCP tool | `list_gdp` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} base = "https://api.darvas.app/v1/macro" growth = requests.get(f"{base}/gdp", headers=headers, params={"series": "real_gdp_growth", "start_date": "2024-01-01"}).json() for quarter in growth["gdp"]: print(quarter["date"], quarter["value"], "first estimate", quarter["first_published_value"]) ``` # Latest US GDP & Corporate Profits Snapshot Source: https://docs.darvas.app/macro/gdp-snapshot openapi.yaml GET /macro/gdp/snapshot Fetch the latest quarterly BEA readings for real GDP growth, consumption, investment, net exports, corporate profits and personal income in one call. ## Overview The latest quarter or month of all 12 series in one call. Pass `series` for one. | Coverage | Details | | - | - | | Series | Latest quarterly or monthly reading for all 12 BEA GDP, GDI, corporate profits and income series, or one via `series` | | History | Full history lives at [GDP & Income](/macro/gdp-income); IDs at [GDP Series](/macro/gdp-series) | | MCP tool | `get_gdp_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/macro/gdp/snapshot" ``` # Live Cloud GPU Hourly Rental Price Snapshot Source: https://docs.darvas.app/macro/gpu-prices-snapshot openapi.yaml GET /macro/gpu-prices/snapshot Get current hourly cloud GPU rental prices across H100, H200, GB200, A100 and MI300X benchmarks in one JSON response for AI capex forecasting. ## Overview The newest day of all five models in one call, with their changes. Today's value is refreshed every hour. Pass `series` for one model, as an id or a name with one such as `NVIDIA H100`. | Coverage | Details | | - | - | | Models | Current daily median hourly price for all 5 GPU models (`h100`, `h200`, `gb200`, `a100`, `mi300x`), or one via `series` | | Freshness | Refreshed hourly from cloud on-demand list prices, with `stability_band` and 1, 7 and 30-day changes | | History | Daily history lives at [GPU Rental Prices](/macro/gpu-rental-prices); IDs at [GPU Price Series](/macro/gpu-prices-series) | | MCP tool | `get_gpu_prices_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/macro/gpu-prices/snapshot" ``` # Cloud GPU Rental Prices API: H100, H200, GB200 Source: https://docs.darvas.app/macro/gpu-rental-prices openapi.yaml GET /macro/gpu-prices Track historical hourly cloud rental price benchmarks for NVIDIA H100, H200, GB200, A100 and AMD MI300X GPUs to gauge AI infrastructure demand. ## Overview One row per day of a GPU model, newest first. Pass `series`: a model id, or a name with one such as `NVIDIA H100`, `H100-SXM` or `AMD MI300X`, and `resolved_from` echoes the name you sent. The models are listed by [GPU Price Series](/macro/gpu-prices-series). Darvas reads cloud on-demand list prices every hour. The price of a size with several GPUs is divided by its GPU count, and Windows and low priority prices are left out. Each day's value is the median of its newest on-demand reading across sizes and regions, with `stability_band` their standard deviation and `min`, `p25`, `p75` and `max` their spread; `spot` gives the same reading's interruptible offers. The changes compare `value` with the day before, 7 days before and 30 days before. These are list prices. Reserved capacity and negotiated contracts cost less. Other clouds and marketplaces that rent other people's GPUs are not included yet. | Coverage | Details | | - | - | | Models | 5 AI accelerator benchmarks: `h100`, `h200`, `gb200`, `a100` and `mi300x` | | Series names | `h100`, `NVIDIA H100`, `H100-SXM` and `h100_80gb` all name the H100 | | Window & paging | Defaults to the last 90 days without dates; up to 10 days per page with `next_page_url` | | Discovery | Supported model IDs live at [GPU Price Series](/macro/gpu-prices-series) | | MCP tool | `list_gpu_prices` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} base = "https://api.darvas.app/v1/macro" h100 = requests.get(f"{base}/gpu-prices", headers=headers, params={"series": "h100"}).json() for day in h100["gpu_prices"]: print(day["date"], day["value"], day["change_7d_pct"]) ``` # Latest US CPI & PCE Inflation Snapshot API Source: https://docs.darvas.app/macro/inflation-snapshot openapi.yaml GET /macro/inflation/snapshot Read the latest headline CPI, core CPI, PCE, core PCE and major component readings from official BLS and BEA releases in one JSON snapshot call. ## Overview The latest release of all 14 series in one call, with their changes. Pass `series` for one. | Coverage | Details | | - | - | | Series | Latest monthly reading for all 14 BLS CPI and BEA PCE series in one call, or one series via `series` | | Changes | Includes `change_1m_pct` and `change_12m_pct` alongside index level | | History | Monthly time series live at [CPI & PCE Inflation](/macro/cpi-pce-inflation); IDs at [Inflation Series](/macro/inflation-series) | | MCP tool | `get_inflation_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/macro/inflation/snapshot" ``` # Global Central Bank Interest Rates API (BIS) Source: https://docs.darvas.app/macro/interest-rates openapi.yaml GET /macro/interest-rates Query historical policy interest rates across 31 global central banks from BIS data, including the Federal Reserve, ECB, BOE, BOJ, PBOC and CBRT. ## Overview One row per bank and calendar day, with the rate in effect that day. Pass `bank`; the symbols are listed by [Central Banks](/macro/central-banks). | Coverage | Details | | - | - | | Banks | 31, from the Federal Reserve and the ECB to the Central Bank of the Republic of Turkey and Bank Indonesia | | History | The Federal Reserve since 1954; other banks from the start of their BIS series | | Source | BIS central bank policy rates, daily | | Checked | Hourly | | MCP tool | `list_interest_rates` on the [data API MCP server](/mcp-server) | For the Federal Reserve the rate is the midpoint of the federal funds target range since 19 December 1985, and the effective federal funds rate before. `first_published_rate` is the first rate Darvas recorded for the day. ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} base = "https://api.darvas.app/v1/macro" rates = requests.get(f"{base}/interest-rates", headers=headers, params={"bank": "FED", "start_date": "2024-01-01"}).json() changes = [r for prev, r in zip(rates["interest_rates"], rates["interest_rates"][1:]) if r["rate"] != prev["rate"]] for change in changes: print(change["date"], change["rate"]) ``` # Latest Global Central Bank Policy Rates API Source: https://docs.darvas.app/macro/interest-rates-snapshot openapi.yaml GET /macro/interest-rates/snapshot Get the current policy interest rate and last change date for all 31 major global central banks in a single low-latency JSON snapshot response. ## Overview The newest day of each bank's series, in one call. Pass `bank` for one bank. | Coverage | Details | | - | - | | Banks | Latest policy interest rate for all 31 BIS central banks, or one bank via `bank` (such as `FED` or `ECB`) | | Discovery | Valid bank codes live at [Central Banks](/macro/central-banks) | | History | Full daily policy rate history lives at [Interest Rates](/macro/interest-rates) | | MCP tool | `get_interest_rates_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```bash theme={null} curl "https://api.darvas.app/v1/macro/interest-rates/snapshot" -H "X-API-KEY: $DARVAS_API_KEY" ``` # US Labor Market API: Payrolls, JOLTS & Claims Source: https://docs.darvas.app/macro/labor-market openapi.yaml GET /macro/labor Query 24 official US labor series from BLS and DOL including nonfarm payrolls, unemployment rate, wages, JOLTS openings, quits and jobless claims. ## Overview One row per period of a series, with its change from the prior period and from a year earlier. Pass `series`; the ids are listed by [Labor Series](/macro/labor-market-series). | Group | Series | Source | | - | - | - | | Payrolls | `payrolls_sa`, `payrolls_nsa`, `private_payrolls_sa`, `manufacturing_payrolls_sa`, `government_payrolls_sa`, `average_hourly_earnings_sa`, `average_weekly_hours_sa` | BLS establishment survey | | Household survey | `unemployment_rate_sa`, `unemployment_rate_nsa`, `u6_rate_sa`, `participation_rate_sa`, `employment_population_ratio_sa`, `labor_force_sa`, `employed_sa`, `unemployed_sa`, `long_term_unemployed_sa` | BLS current population survey | | JOLTS | `job_openings_sa`, `job_openings_rate_sa`, `hires_sa`, `quits_sa`, `quits_rate_sa`, `layoffs_sa` | BLS | | Jobless claims | `initial_claims_nsa`, `continued_claims_nsa` | Department of Labor ETA 539, weekly, the sum of all states | Monthly series are dated by the first day of the month, claims by the end of the week. `change_year` compares with 12 months or 52 weeks earlier. | Coverage | Details | | - | - | | Series | 24 official US labor series: 22 BLS establishment, household and JOLTS series plus 2 DOL weekly jobless claims series | | Pagination | Up to 1,000 rows per page in date order; follow `next_page_url` with `cursor` | | Discovery | Series IDs, units and frequencies live at [Labor Series](/macro/labor-market-series) | | MCP tool | `list_labor` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} base = "https://api.darvas.app/v1/macro" payrolls = requests.get(f"{base}/labor", headers=headers, params={"series": "payrolls_sa", "start_date": "2026-01-01"}).json() for month in payrolls["labor"]: print(month["date"], month["change_prior"], "thousand jobs") ``` # Latest US Jobs, Payrolls & Claims Snapshot Source: https://docs.darvas.app/macro/labor-market-snapshot openapi.yaml GET /macro/labor/snapshot Get the latest official readings across all 24 US labor market series including payrolls, unemployment, U-6, JOLTS and weekly jobless claims. ## Overview The latest payrolls, household survey, JOLTS and claims figures in one call, with their changes. Pass `series` for one. | Coverage | Details | | - | - | | Series | Latest reading across all 24 US payrolls, unemployment, JOLTS and weekly claims series, or one via `series` | | Changes | Includes `change_prior` and `change_year` alongside each reading | | History | Full history lives at [Labor Market](/macro/labor-market); IDs at [Labor Series](/macro/labor-market-series) | | MCP tool | `get_labor_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/macro/labor/snapshot" ``` # US Treasury Yield Curve Historical Rates API Source: https://docs.darvas.app/macro/treasury-yield-curve openapi.yaml GET /macro/yield-curve Query daily US Treasury yield curve rates across all 14 official maturities from 1 month to 30 years for 2s10s spreads and fixed-income analysis. ## Overview One object per business day with a field per tenor, in percent. A tenor that did not exist that day is absent: the 1-month bill starts in 2001, the 20-year bond returns in 1993, the 1.5-month bill starts in 2025. | Coverage | Details | | - | - | | Tenors | 1, 1.5, 2, 3, 4 and 6 months; 1, 2, 3, 5, 7, 10, 20 and 30 years | | History | Since 2 January 1990 | | Source | US Treasury daily par yield curve rates | | Checked | Every 10 minutes | | MCP tool | `list_yield_curve` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} base = "https://api.darvas.app/v1/macro" curve = requests.get(f"{base}/yield-curve", headers=headers, params={"start_date": "2026-01-01"}).json()["yield_curve"] inverted = [day["date"] for day in curve if day.get("3_month", 0) > day.get("10_year", 0)] print(len(inverted), "days with the 3-month yield above the 10-year") ``` # Latest US Treasury Yield Curve Snapshot API Source: https://docs.darvas.app/macro/treasury-yield-curve-snapshot openapi.yaml GET /macro/yield-curve/snapshot Fetch the latest US Treasury constant-maturity yields across all 14 tenors from 1 month to 30 years in a single structured snapshot response. ## Overview The newest curve as one object with a field per tenor. | Coverage | Details | | - | - | | Tenors | All 14 official US Treasury constant-maturity tenors from `1_month` to `30_year`, in percent | | Freshness | Checked every 10 minutes; returns the most recent US Treasury business day | | History | Daily curve history since 1990 lives at [Treasury Yield Curve](/macro/treasury-yield-curve) | | MCP tool | `get_yield_curve_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```bash theme={null} curl "https://api.darvas.app/v1/macro/yield-curve/snapshot" -H "X-API-KEY: $DARVAS_API_KEY" ``` # Yield Curve Spread & Sahm Rule API Source: https://docs.darvas.app/macro/yield-curve-spreads openapi.yaml GET /macro/spreads Get US Treasury 2s10s, 3m10y, 2s5s and 5s30s spreads, 10-year less Fed funds, inversion streaks, the curve regime and the Sahm Rule recession indicator. ## Overview This endpoint computes US Treasury yield curve spreads from the daily par yield curve: 2s10s, 3m10y, 2s5s, 5s30s and the 10-year yield less the Fed funds target midpoint, with the curve's regime and how long each spread has been inverted. `sahm_rule` gives the real-time Sahm Rule recession indicator from the monthly unemployment rate. The history arrays cover `days` of spreads and `months` of the Sahm Rule. | Coverage | Details | | - | - | | Spreads | 2s10s, 3m10y, 2s5s, 5s30s and 10-year less the Fed funds target midpoint | | Recession signal | Sahm Rule from the monthly unemployment rate | | History | 1 to 1,260 trading days and 1 to 240 months | | MCP tool | `get_macro_spreads` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/macro/spreads", headers=headers, params={ "days": 250, "months": 36, }, ).json() print(answer["yield_curve_spreads"]) print(answer["sahm_rule"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/macro/spreads?days=250&months=36" ``` # Financial Data Coverage, History & Freshness Source: https://docs.darvas.app/market-coverage Compare history depth, update cadence and primary sources across SEC EDGAR filings since 1994, US/UK/FR financials, macro, crypto, DeFi and COT. This page lists what each dataset covers: the markets and companies, how far back it goes and how soon new data arrives. Each dataset name links to its endpoint page. ## Markets for company data | Market | Status | Request with | Periods | Currency | | - | - | - | - | - | | United States | Available | `ticker` or `cik` | Annual, quarterly, TTM | USD | | United Kingdom | Available | `ticker` + `market=UK`, or `isin` | Annual | As reported | | France | Available | `ticker` + `market=FR`, or `isin` | Annual | As reported | | More EU markets | Coming soon | | | | * **United States**: every SEC filer, active and delisted, with segments, as-reported statements, earnings and KPIs. Statements since 2009, and since 1993 for fiscal years before XBRL. * **United Kingdom**: about 800 companies that file a tagged annual report, for years ending since 2020, with as-reported statements. * **France**: about 290 companies that file a tagged annual report, for years ending since 2020, with as-reported statements. Amounts are in the reporting currency, EUR for most. ## Companies and filings | Dataset | Coverage | Updated | | - | - | - | | [Company profiles](/companies/profile) | Every SEC filer, about 994,000, with their tickers | Within about a minute of a new filing | | [Company dossier](/companies/dossier) | Every US stock with an SEC profile, stored prices or stored financial metrics, in eight sections | With each section's dataset | | Ticker history | Current tickers, and tickers of delisted companies since 2006 | Every 6 hours | | [Filings](/sec-edgar/filings) | 27 million filings since 1994 | Within about a minute of acceptance | | [Filing items](/sec-edgar/filing-items) | Every 10-K, 10-Q and 8-K by item, with an 8-K's exhibits | New filings within about a minute, older ones on request | | [8-K events](/sec-edgar/8k-events) | Every 8-K since August 2004, by event type | Within about a minute of acceptance | | [Earnings](/earnings/releases) | Releases since January 2023, statements since 2009 | Within about a minute of acceptance | | [KPIs](/earnings/kpis), [guidance](/earnings/guidance) and [non-GAAP metrics](/earnings/non-gaap) | Releases since January 2023, each value with its text | Within about a minute of acceptance | | [Market news](/stocks/financial-news) | US federal agency releases since November 2026 | Every ten minutes | ## Financial statements | Dataset | Coverage | Updated | | - | - | - | | [Income statements](/financials/income-statements), [balance sheets](/financials/balance-sheets), [cash flow statements](/financials/cash-flow-statements) | Every 10-K, 10-Q, 20-F and 40-F with XBRL data, about 20,600 filers since 2009 | Minutes after acceptance | | Fiscal years before XBRL | 10-K filings since 1993 whose printed totals agree | Read once | | [As-reported statements](/financials/as-reported-statements) and [segments](/financials/segments) | Every 10-K, 10-Q, 20-F and 40-F with XBRL since June 2009 | Within about a minute of acceptance | | [XBRL facts](/financials/xbrl-facts) | Every non-dimensional `us-gaap`, `ifrs-full` and `dei` fact of each filing with XBRL data, with predecessor CIKs | Minutes after acceptance | | [Debt maturity schedule](/financials/debt-schedule) | Debt due in each of the next five years and after, from the XBRL facts of 10-K, 10-Q, 20-F and 40-F filings | With the XBRL facts | | [Financial metrics](/financials/metrics), [line item search](/financials/line-items), [screener](/financials/stock-screener) | The same companies. Valuation ratios of US stocks take the share price at each period end, and the [snapshot](/financials/metrics-snapshot) takes the latest price | With the statements and prices | | [Peer comparison](/financials/peer-comparison) | 2 to 20 US stocks with stored metrics or a price, with the peer group median of 12 metrics | With the metrics and prices | ## Ownership and holdings | Dataset | Coverage | Updated | | - | - | - | | [Insider trades](/ownership/insider-trading) and [holdings](/ownership/insider-holdings) | Forms 3, 4 and 5 since January 2006 | Within about a minute of acceptance | | [Insider sale notices](/ownership/form-144-sale-notices) | Every Form 144 filed electronically, since April 2023 | Within about a minute of acceptance | | [5% owners](/ownership/beneficial-13d-13g) | Every Schedule 13D and 13G filed in XML, since December 2024 | Within about a minute of acceptance | | [Institutional holdings](/ownership/13f-institutional-holdings) | Every 13F-HR since 2013 Q2 | Within about a minute of acceptance | | [Fund and ETF holdings](/ownership/etf-fund-holdings) | Every public N-PORT since 2019 Q4, and every fund share class ticker | Within about a minute of acceptance | | [IPO filings](/sec-edgar/ipo-filings) | Every S-1, F-1 and final prospectus since January 2025 | Within about a minute of acceptance | ## Markets | Dataset | Coverage | Updated | | - | - | - | | [Stock prices](/stocks/historical-prices) | About 10,000 Nasdaq, NYSE, Cboe and OTC stocks, each from its first session; daily bars adjusted for splits | Bars after each close; session prices every 30 minutes | | [Dividends](/stocks/dividends) and [splits](/stocks/splits) | The same stocks, each from its first session: every cash dividend as paid and every split | After each close | | [Stock technicals](/stocks/technical-indicators) | The same stocks: SMA, EMA, RSI-14, MACD, Bollinger Bands, ATR-14, the 52-week range and returns over the newest 280 daily or weekly bars | With the bars | | [Tokenized stocks](/tokenized-stocks/markets), with [price](/tokenized-stocks/prices) and [trade](/tokenized-stocks/trades) history | About 240 OKX stock perpetual swaps, 11 Bybit xStocks tokens and Coinbase's stock tokens on Base. Base token prices add pool liquidity and the gap to net asset value | Prices as they trade | | [Fails to deliver](/stocks/fails-to-deliver) | Every security with a balance of fails on a day, since July 2009 | Twice a month | | [Short volume](/stocks/short-volume) | Every symbol in FINRA's consolidated NMS daily short sale volume file, one trading day per request | Each trading day | | [Commitments of Traders](/futures/commitment-of-traders) | About 960 futures markets; legacy since 1986, disaggregated and financial futures since 2006 | Weekly | ## Crypto | Dataset | Coverage | Updated | | - | - | - | | [Crypto candles](/crypto/prices) and [snapshots](/crypto/price-snapshot) | Darvas aggregated pairs (`exchange=darvas`, including `ALLUSD` and `venues` filtering) plus OKX, Binance, Bybit, Hyperliquid, Coinbase, Kraken, Bitstamp, Deribit and Bitfinex instruments | Live | | [Market snapshot](/crypto/market-snapshot) | Latest price, 24-hour change and 24-hour volume of up to 2,000 pairs per exchange, or of the Darvas aggregated pairs | Every 15 seconds | | [Aggregated perpetual volume](/crypto/aggregated-volume) | 24-hour USD and base volume of a perpetual, summed across OKX, Binance, Bybit and Hyperliquid | Every 30 seconds | | [Market context](/crypto/market-context) | One market's 1-hour, 4-hour and 24-hour ranges, hourly bars, funding and open interest changes, and nearby high-impact macro releases | Live | | [Index prices](/crypto/index-prices) and [snapshots](/crypto/index-snapshot) | Composite spot indices such as `BTC-USD` and `ETH-USDT`, with candles from `1m` to `1W` | Live | | [Hyperliquid markets](/crypto/hyperliquid-markets) | Every active Hyperliquid perpetual, with mark and oracle price, funding, open interest and maximum leverage | Every 30 seconds | | [Crypto trades](/crypto/trades) | Every OKX, Binance, Bybit and Hyperliquid instrument, 90 days (OKX spot, Hyperliquid perpetuals, Binance and Bybit since 23 November 2026) | Live | | [Crypto order flow](/crypto/order-flow) | Darvas aggregated pairs and OKX, Binance, Bybit and Hyperliquid minute bars, 13 months | Every minute | | [Crypto footprint](/crypto/footprint-charts) | Price-level taker buy/sell volume, delta path and trade counts for Darvas aggregated pairs and OKX, Binance, Bybit and Hyperliquid spot and perpetuals, 1m to 1W bars | Live | | [Large trades](/crypto/large-trades) and [whale trade zones](/crypto/whale-trade-zones) | Executions above a USD floor on OKX, Binance, Bybit and Hyperliquid up to 7 days back, and the OKX perpetual price zones with the most notional over a day, week or month | Live | | [Order book](/crypto/order-book) | L2 books of spot and perpetual markets, up to 400 levels a side, merged across OKX, Binance, Bybit and Hyperliquid | Live | | [Order book heatmap](/crypto/order-book-heatmap) | Time-weighted resting bid and ask size per price row and bar, from one-second OKX, Binance and Bybit book samples, up to 600 bars | Live | | [Volume profiles](/crypto/volume-profile) and [fixed range profiles](/crypto/fixed-range-volume-profile) | Up to 30 sessions of OKX perpetual profiles built from every trade, and profiles of any range on Darvas pairs and nine exchanges | Live | | [TPO profiles](/crypto/tpo-market-profile) | Up to 12 daily, weekly or monthly sessions of Darvas pairs and the nine exchanges | Live | | [Market structure](/crypto/market-structure) | Smart Money Concepts, order and breaker blocks, session fair value gaps, swings, volume zones and Monte Carlo ranges over up to 500 candles | Live | | [Crypto technical indicators](/crypto/technical-indicators) | SMA, EMA, RSI-14, MACD, Bollinger Bands, ATR-14, relative volume and returns for Darvas aggregated pairs or any of the nine primary exchanges | Live | | [Derivatives](/crypto/derivatives) and [snapshots](/crypto/derivatives-snapshot) | Funding, open interest, basis, long-short ratios and taker volume on OKX, Binance, Bybit and Hyperliquid, up to 30 days back | Live | | [Open interest scan](/crypto/open-interest-scanner) | OKX perpetuals and futures, ranked by open interest change over `5m` to `1D` bars | Live, cached up to a minute | | [Options chain](/crypto/options-chain) and [IV skew](/crypto/options-iv-skew) | OKX `BTC-USD`, `ETH-USD` and `SOL-USD` options with Greeks, ATM IV, 25-delta skew, term structure and implied minus realized volatility | Live | | [Liquidations](/crypto/liquidations) and [liquidation heatmap](/crypto/liquidation-heatmap) | Forced fills on OKX, Binance, Bybit and Hyperliquid up to 7 days back, and estimated OKX perpetual liquidation levels | Live | | [Crypto screener](/crypto/screener) and [its metrics](/crypto/screener-metrics) | OKX USDT spot, perpetual and futures markets on 77 metrics, with up to 12 conditions a screen and watchlists of up to 200 instruments | Live | | [Spot ETF flows](/crypto/etf-flows) | Daily, weekly and monthly net flows of US spot Bitcoin, Ethereum and Solana ETFs, by issuer | Every 2 hours | ## DeFi and prediction markets | Dataset | Coverage | Updated | | - | - | - | | [DeFi protocols](/defi/protocols-tvl) | Up to 1,500 multi-chain protocols ranked by TVL, with 1-day and 7-day changes | Every 5 minutes | | [Stablecoins](/defi/stablecoins) | Circulating supply of USD, EUR and other pegged stablecoins, with the supply a day and a week earlier | Every 5 minutes | | [DeFi yields](/defi/yields) | Up to 3,000 lending, liquid staking and AMM pools with at least \$100,000 TVL | Every 5 minutes | | [DEX tokens](/defi/dex-tokens) | DEX pair prices, liquidity and volume on Solana, Ethereum, Base, Arbitrum, BSC and other chains, and trending tokens | Every 30 seconds | | [Prediction markets](/prediction-markets/markets) | Active binary contracts on Polymarket, Kalshi and OKX Event Contracts | Every 30 seconds | | [Prediction market series](/prediction-markets/series) | OKX event series with their settlement rules, and Polymarket and Kalshi category groups | Live | | [Prediction market arbitrage](/prediction-markets/arbitrage) | Matched Polymarket and Kalshi contracts whose YES and NO prices add up to less than 1.00 | Every 30 seconds | ## Macro | Dataset | Coverage | Updated | | - | - | - | | [Economic calendar](/macro/economic-calendar) | Scheduled and published releases of the [listed countries](/macro/economic-calendar-countries), with actual, forecast, previous and surprise | Every 15 minutes | | [Policy rates](/macro/interest-rates) | 31 central banks; the Federal Reserve since 1954 | Hourly | | [Treasury yield curve](/macro/treasury-yield-curve) | 14 tenors since 1990 | Every 10 minutes | | [CPI](/macro/cpi-pce-inflation) | 12 series since 1947 | Every 10 minutes | | [PCE prices](/macro/cpi-pce-inflation) | 2 series since 1959 | Every 10 minutes | | [Jobs](/macro/labor-market) | 22 series; payrolls since 1939 | Every 10 minutes | | [Jobless claims](/macro/labor-market) | Initial and continued claims since 1986 | Every 10 minutes | | [Growth and income](/macro/gdp-income) | 12 series; GDP since 1947 | Every 10 minutes | | [GPU rental prices](/macro/gpu-rental-prices) | NVIDIA H100, H200, GB200 and A100, AMD MI300X, daily since 26 November 2026 | Hourly | A revised macro value is added next to the earlier one. Answers carry the current value and `first_published_value`, the first value Darvas recorded. For periods released since 25 November 2026 that is the figure as first released, which backtests need; for earlier periods it is the value on that day. ## Discovering available tickers Each dataset lists the tickers it answers for under `/tickers`: ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" https://api.darvas.app/v1/financials/income-statements/tickers curl -H "X-API-KEY: $DARVAS_API_KEY" "https://api.darvas.app/v1/financials/income-statements/tickers?market=UK" curl -H "X-API-KEY: $DARVAS_API_KEY" https://api.darvas.app/v1/prices/tickers ``` Statement tickers carry each company's `identifier`, a CIK for US companies and an ISIN for UK and French ones, and whether it is `active` or `inactive`. ## Share classes and successor issuers * A US share class takes a dot or a dash, in any case. `BRK.B`, `BRK-B` and `brk.b` all name Berkshire Hathaway's B shares in company lookups, prices, dividends, splits, 13F and fund holdings, and fails to deliver. * A successor issuer is a company that takes over another's registration and ticker with an 8-K12B or 8-K12G3. SEC files it under a new CIK and keeps the earlier filings under the old one. Darvas answers the successor with both. ExxonMobil Holdings took over `XOM` from Exxon Mobil in July 2026, so its insider trades and holdings, sale notices, 5% owners, as-reported statements and segments include Exxon Mobil's, each row with the CIK it was filed under. Its standardized statements and metrics carry Exxon Mobil's earlier years. # Financial Data MCP Server for AI Agents Source: https://docs.darvas.app/mcp-server Connect Claude Code, Codex, Cursor, VS Code, Windsurf or Devin to api.darvas.app/mcp for 164 financial, SEC EDGAR, macro, crypto and DeFi tools. The data API is also an MCP server, so an agent such as Claude Code, Codex, Cursor or your own can call it as tools. It has 164 tools, one for every read and search endpoint of the REST API; the 4 webhook operations stay REST only. A tool is named after its operation in snake case, such as `list_income_statements` or `search_documents`. It takes the endpoint's query parameters, path parameters such as `request_id`, or JSON body fields for `POST` endpoints, and answers what the endpoint answers. | Setting | Value | | - | - | | URL | `https://api.darvas.app/mcp` | | Transport | Streamable HTTP: one JSON-RPC 2.0 message per `POST`, one JSON answer, no sessions | | Authentication | Your API key in `X-API-KEY`, or `Authorization: Bearer` | | Protocol versions | `2025-11-25`, `2025-06-18`, `2025-03-26` | | Server | `darvas-data`, version 2.0.0 | | Tools listed | 10 by default, all 164 with `?mode=full` | `https://darvas.app/api/data/v1/mcp` is the earlier URL of the same server and keeps working. ## Which Darvas MCP server to use | Server | URL | Sign-in | Use it for | | - | - | - | - | | Data API | `https://api.darvas.app/mcp` | API key in a header | Coding and data agents that answer with financial data: Claude Code, Codex, Cursor, VS Code, Windsurf, Devin | | Docs search | `https://docs.darvas.app/mcp` | None | Agents that search and read these docs. See [AI agents](/ai-agents). | | Darvas account | `https://darvas.app/mcp` | Darvas account, OAuth 2.1 | Apps that connect by sign-in instead of a header, such as Claude and ChatGPT. Reads your Darvas account, alerts, and charts read-only for `0` credits on every plan (Free `15` RPM, Pro `60` RPM, Max `180` RPM, Ultra `360` RPM). | ## Tool lists `tools/list` answers 10 tools by default, so a short list keeps the agent's context small: 8 flagship tools plus `search_data_tools` and `call_data_tool`. Every one of the 164 tools stays callable by name in `tools/call`, whatever the list shows. | URL | `tools/list` answers | | - | - | | `https://api.darvas.app/mcp` or `?mode=progressive` | `get_company_dossier`, `compare_financial_peers`, `get_price_snapshot`, `get_financial_metrics_snapshot`, `search_documents`, `get_crypto_market_context`, `get_crypto_derivatives_snapshot`, `list_economic_calendar`, `search_data_tools` and `call_data_tool` | | `?mode=full` | All 164 tools | | `?toolsets=crypto,macro` | The tools of the domains named | The domains are `equities`, `financials`, `filings`, `ownership`, `crypto`, `defi`, `macro`, `prediction` and `tokenized`. `toolsets` also takes the aliases `sec` (filings, financials, equities and ownership), `stocks` (equities and financials), `company` (equities, financials and filings), `derivatives` (crypto) and `all`. When both are sent, `toolsets` wins over `mode`. A client can also send `mode` or `toolsets` as `tools/list` params. `search_data_tools` finds tools by `query` keywords, by `domain`, or by up to 6 exact `names`, and answers ranked matches with their input schemas within an 8 KB budget; `limit` takes 1 to 25. `call_data_tool` runs any tool by `name` with its `arguments`, for clients that call only the tools they listed. ## Response shaping Two extra arguments cut the tokens an answer costs, on any tool and on `call_data_tool`: | Argument | Values | | - | - | | `response_format` | `json` (the default), `compact`, which drops null and empty values, or `tsv`, which answers the rows as tab-separated text | | `fields` | Up to 100 field names to keep, such as `["report_period", "revenue", "net_income"]` | `result.structuredContent` holds the JSON answer. `result.content[0].text` holds the same JSON when it is 1 KiB or less, and a one-line summary of the rows, pages and credits when it is longer. With `tsv`, `content[0].text` holds the table and there is no `structuredContent`. `result._meta` carries `credits_used`, `quota_remaining` and `rate_limit_per_minute` when the endpoint sends them. ```json theme={null} {"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_income_statements","arguments":{"ticker":"NVDA","period":"annual","limit":4,"response_format":"tsv","fields":["report_period","revenue","net_income"]}}} ``` ## Errors an agent can fix `result.isError` is `true` when a call failed, and the answer says how to fix it: * An unknown tool name answers `did_you_mean` with the closest tool names. * Arguments that do not match the tool's input schema answer up to 6 issues, each with the field and, where one is close, a `did_you_mean` value. * An endpoint error answers the REST error JSON with `retryable`, `true` for `429` and `5xx`, and hints such as a closer ticker, series, exchange or screener metric. ## Catalog resources Four resources hold reference tables an agent can read with `resources/read` and their `uri`. They cost 0 credits. `resources/templates/list` answers an empty list. | URI | What it holds | | - | - | | `darvas://catalog/tools` | Every tool grouped by domain, with the flagship tools and the toolset aliases | | `darvas://catalog/macro-series` | Central bank codes, Treasury yield curve tenors, and the CPI and PCE, labor, GDP and GPU rental series IDs | | `darvas://catalog/crypto-metrics` | Crypto screener metric IDs, categories, operators, timeframes, universes and market types | | `darvas://catalog/exchanges` | Crypto candle and order flow exchanges, equity markets, prediction market venues and tokenized stock venues | ## Analyst prompts `prompts/list` answers six prompt templates, and `prompts/get` fills one with its arguments. Each tells the agent which tools to call and in what order. | Prompt | Arguments | What it plans | | - | - | - | | `stock_deep_dive` | `ticker`, optional `peers` | A fundamental, valuation, peer, ownership and SEC filing review of a company | | `crypto_trade_setup` | `ticker`, optional `exchange` | Multi-venue context, order flow, volume profile, derivatives skew, liquidation levels and macro catalysts | | `earnings_preview` | `ticker` | Past earnings, KPIs, management guidance, non-GAAP adjustments and insider activity before a report | | `insider_whale_scan` | optional `ticker` and `min_value` | Form 4 trades, Form 144 notices, 13F positions, 13D activists, short volume and fails to deliver | | `macro_regime_check` | optional `horizon` | Central bank rates, yield curve spreads, inflation, labor, GDP, the economic calendar and crypto ETF flows | | `defi_yield_audit` | optional `chain` and `protocol` | Protocol TVL, base and reward APY, stablecoin flows and DEX liquidity | ## Credits and rate limits * Every message, `initialize`, `ping`, `tools/list`, `tools/call`, `resources/*` and `prompts/*` alike, counts as one request against your account's per-minute [rate limit](/authentication#rate-limits-concurrency-and-headers) (`1,200` RPM on Pro, `3,600` RPM on Max, `6,000` RPM on Ultra). A message over the per-minute limit answers HTTP `429` with JSON-RPC error `-32000` and `Retry-After`. * In-flight concurrency limits apply across REST and Data MCP (`4` concurrent on Pro, `10` on Max, `20` on Ultra). Exceeding your concurrency cap returns HTTP `429` with `CONCURRENCY_LIMIT` and `Retry-After: 1`; temporary platform-wide saturation returns HTTP `503` with `BUSY` and `Retry-After: 1`. * Billing is call-based: **`1 credit = 1 successful call`** (up to `1,000` rows per page, with no endpoint multipliers), matching REST. Empty responses, errors, FINRA `/short-volume`, `tools/list`, `search_data_tools`, resources, prompts, and own-account MCP at `https://darvas.app/mcp` cost **`0` credits**. * A `tools/call` answer carries the endpoint's `X-RateLimit-*`, `X-Quota-*`, `X-Credits-Used` and `Retry-After` headers. * 44 tools take a `cursor`. Pass only the `cursor` value of an answer's `next_page_url`, such as `new URL(next_page_url).searchParams.get("cursor")`, never the whole URL. See [Pagination](/pagination#pagination-on-the-mcp-server). ## Transport rules | Request | Answer | | - | - | | `GET` | `405` with `Allow: POST`; the server opens no stream | | A `Content-Type` other than `application/json` | `415` | | A body over 64 KiB (65,536 bytes) | `413` | | A missing, unknown or revoked key | `401` with `UNAUTHORIZED` | | A notification, a message without `id` such as `notifications/initialized` | `202` with no body | | A batch or a body that is not one JSON-RPC 2.0 request | JSON-RPC error `-32600` | The server keeps no session, so a client can send `tools/list` or `tools/call` without `initialize` first. ## Claude Code Export the key first, then add the server: ```bash theme={null} export DARVAS_API_KEY=dvk_... claude mcp add --transport http --scope user darvas https://api.darvas.app/mcp --header "X-API-KEY: $DARVAS_API_KEY" claude mcp list ``` The shell puts the key's value into the command, and Claude Code stores it in `~/.claude.json`. With `DARVAS_API_KEY` unset, the header is saved empty and every call answers `401`. `--scope user` adds the server to every project; `claude mcp list` shows whether it connects. To share the server through a project's `.mcp.json` without the key, let Claude Code read it from each user's environment: ```json theme={null} { "mcpServers": { "darvas": { "type": "http", "url": "https://api.darvas.app/mcp", "headers": { "X-API-KEY": "${DARVAS_API_KEY}" } } } } ``` ## Codex Add the server to `~/.codex/config.toml`, or to `.codex/config.toml` in a project you trust. Codex reads the key from the `DARVAS_API_KEY` environment variable. ```toml theme={null} [mcp_servers.darvas] url = "https://api.darvas.app/mcp" env_http_headers = { "X-API-KEY" = "DARVAS_API_KEY" } ``` To send the key as a Bearer token instead, replace `env_http_headers` with `bearer_token_env_var = "DARVAS_API_KEY"`. To list all 164 tools up front, use `url = "https://api.darvas.app/mcp?mode=full"`. ## Cursor Add the server to `~/.cursor/mcp.json`, or to `.cursor/mcp.json` in a project. `${env:DARVAS_API_KEY}` reads the key from your environment. ```json theme={null} { "mcpServers": { "darvas": { "url": "https://api.darvas.app/mcp", "headers": { "X-API-KEY": "${env:DARVAS_API_KEY}" } } } } ``` ## VS Code GitHub Copilot in VS Code reads `~/.copilot/mcp-config.json` for every workspace, or `.mcp.json` at the workspace root. `${DARVAS_API_KEY}` reads the key from your environment, and `"tools": ["*"]` makes every tool available. ```json theme={null} { "mcpServers": { "darvas": { "type": "http", "url": "https://api.darvas.app/mcp", "headers": { "X-API-KEY": "${DARVAS_API_KEY}" }, "tools": ["*"] } } } ``` > [accordion] Older setups in .vscode/mcp.json > > `.vscode/mcp.json` uses a top-level `servers` key, and VS Code's docs mark it deprecated for new configurations. An existing file can ask for the key through an input prompt: > > ```json theme={null} > { > "inputs": [ > { "type": "promptString", "id": "darvas-api-key", "description": "Darvas API key", "password": true } > ], > "servers": { > "darvas": { > "type": "http", > "url": "https://api.darvas.app/mcp", > "headers": { "X-API-KEY": "${input:darvas-api-key}" } > } > } > } > ``` ## Windsurf and Devin Desktop Windsurf is now Devin Desktop. Its Cascade agent reads `~/.config/devin/mcp_config.json` on macOS and Linux, or `%AppData%/devin/mcp_config.json` on Windows; **Open MCP config file** opens it. A remote server takes its URL as `serverUrl`, and `${env:DARVAS_API_KEY}` reads the key from your environment. ```json theme={null} { "mcpServers": { "darvas": { "serverUrl": "https://api.darvas.app/mcp", "headers": { "X-API-KEY": "${env:DARVAS_API_KEY}" } } } } ``` ## Devin CLI Devin CLI reads `~/.config/devin/mcp_config.json` for every project, `.devin/mcp_config.json` in a project, and `.devin/mcp_config.local.json`, a local file kept out of git. Its docs promise no variables in `headers`, so write the key itself in the user file or the local file. Never commit a file that holds the key. ```json theme={null} { "mcpServers": { "darvas": { "url": "https://api.darvas.app/mcp", "transport": "http", "headers": { "X-API-KEY": "dvk_..." } } } } ``` ## Any client over HTTP Each request is one JSON-RPC 2.0 message in a `POST`. ```bash theme={null} curl "https://api.darvas.app/mcp?mode=full" \ -H "X-API-KEY: $DARVAS_API_KEY" -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' curl https://api.darvas.app/mcp \ -H "X-API-KEY: $DARVAS_API_KEY" -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_income_statements","arguments":{"ticker":"NVDA","period":"annual","limit":2}}}' ``` ## Python ```python theme={null} import os import requests def call_tool(name, arguments): response = requests.post( "https://api.darvas.app/mcp", headers={"X-API-KEY": os.environ["DARVAS_API_KEY"]}, json={"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": name, "arguments": arguments}}, ) response.raise_for_status() body = response.json() if "error" in body: raise RuntimeError(body["error"]["message"]) if body["result"].get("isError"): raise RuntimeError(body["result"]["content"][0]["text"]) return body["result"]["structuredContent"] statements = call_tool("list_income_statements", {"ticker": "NVDA", "period": "annual", "limit": 2}) print(statements["income_statements"][0]["revenue"]) ``` With `response_format: "tsv"`, read `body["result"]["content"][0]["text"]` instead of `structuredContent`. ## TypeScript This example uses the MCP TypeScript SDK, `@modelcontextprotocol/sdk`. ```typescript theme={null} import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const transport = new StreamableHTTPClientTransport(new URL("https://api.darvas.app/mcp"), { requestInit: { headers: { "X-API-KEY": process.env.DARVAS_API_KEY ?? "" } }, }); const client = new Client({ name: "my-agent", version: "1.0.0" }); await client.connect(transport); const { tools } = await client.listTools(); console.log(tools.length, "tools listed"); // 10 by default, 164 with ?mode=full const answer = await client.callTool({ name: "list_income_statements", arguments: { ticker: "NVDA", period: "annual", limit: 2, response_format: "compact" }, }); console.log(answer.structuredContent); await client.close(); ``` # Financial Data API, MCP Server & Pine Script Source: https://docs.darvas.app/overview Darvas docs for the financial data API, MCP server, SEC EDGAR filings, stock, macro, crypto order flow, DeFi, prediction markets and Pine Script. Darvas collects financial data from the institutions that publish it: SEC EDGAR, FINRA, the US Treasury, the Bureau of Labor Statistics, the Bureau of Economic Analysis, the Department of Labor and the Bank for International Settlements. The same data powers the Darvas app and the data API documented here: 168 REST operations at `https://api.darvas.app/v1`, 164 of them also tools on the MCP server, with crypto market data from 9 exchanges. These docs also cover the Pine Script custom indicators that run on Darvas charts. > [card] [Data API quickstart](/quickstart) > > Make your first request with an API key in two minutes. > [card] [MCP server](/mcp-server) > > Call 164 data tools from Claude Code, Codex, Cursor, VS Code, Windsurf or your own agent. > [card] [Docs for AI agents](/ai-agents) > > llms.txt, Markdown pages, the docs MCP server, and which tool answers which question. > [card] [Market coverage](/market-coverage) > > The markets, companies and history each dataset covers, and how fast it updates. > [card] [Insider trades](/ownership/insider-trading) > > Form 4 and 5 transactions since 2006, read about a minute after each filing. > [card] [Custom indicators](/pine-script/introduction) > > Write Pine Script indicators for Darvas charts, or describe one to the Darvas assistant. ## Make a request ```bash theme={null} curl "https://api.darvas.app/v1/financials/income-statements?ticker=NVDA&period=annual&limit=2" \ -H "X-API-KEY: $DARVAS_API_KEY" ``` Every endpoint follows the same rules: | Rule | Value | | - | - | | Base URL | `https://api.darvas.app/v1` | | Authentication | The key in the `X-API-KEY` header, or `Authorization: Bearer`. See [Authentication and limits](/authentication). | | Plans and credits | Included in Darvas Pro (`$20/mo` or free via active OKX affiliate, 250,000 calls/mo), Max (`$100/mo`, 2,000,000 calls/mo), and Ultra (`$200/mo`, 5,000,000 calls/mo). `1 credit = 1 successful call` (up to 1,000 rows per page); empty responses, errors, FINRA short volume, and own-account MCP cost `0` credits. | | Companies | `ticker` or `cik`. UK and French companies take `ticker` and `market`, or `isin`. | | Dates | `YYYY-MM-DD` | | Pages | Follow `next_page_url` until the answer has none. See [Pagination](/pagination). | | Errors | JSON with a stable `error` code and a `message`. A `429` carries `Retry-After`. | | OpenAPI 3.1 spec | [`openapi.yaml`](https://docs.darvas.app/openapi.yaml) | | Data MCP server | `https://api.darvas.app/mcp`, with the same key: 10 tools by default, all 164 with `?mode=full`. See [MCP server](/mcp-server). | | Docs MCP server | `https://docs.darvas.app/mcp`, with no key. See [Docs for AI agents](/ai-agents). | ## What the API covers | Dataset | Endpoints | Covers | History | | - | - | - | - | | Company profiles | [`/company/facts`](/companies/profile) | Every SEC filer, about 994,000 | Active and delisted filers | | Company dossier | [`/company/dossier`](/companies/dossier) | A US stock's profile, price, technicals, valuation, earnings, insider trades, 13F holders and 8-K events in one call | The newest entries of each dataset | | SEC filings | [`/filings`](/sec-edgar/filings), [`/filings/items`](/sec-edgar/filing-items), [`/filings/events`](/sec-edgar/8k-events), [`/search`](/sec-edgar/full-text-search) | Every form, 10-K, 10-Q and 8-K items, 8-K events and full-text search | Since 1994 | | Financial statements | [`/financials/income-statements`](/financials/income-statements), [`/financials/balance-sheets`](/financials/balance-sheets), [`/financials/cash-flow-statements`](/financials/cash-flow-statements) | About 20,600 SEC filers, plus UK and French companies | Since 2009, and 10-Ks since 1993 | | As-reported statements and segments | [`/financials/as-reported`](/financials/as-reported-statements), [`/financials/segments`](/financials/segments) | Each filing's own XBRL lines, and values by product, region and segment | Since June 2009 | | XBRL facts and debt maturities | [`/financials/xbrl-facts`](/financials/xbrl-facts), [`/financials/debt-schedule`](/financials/debt-schedule) | Every non-dimensional `us-gaap`, `ifrs-full` and `dei` fact of a filer, and the debt due in each of the next five years | Every filing with XBRL data | | Ratios and screener | [`/financial-metrics`](/financials/metrics), [`/financials/search/screener`](/financials/stock-screener) | Valuation, margins, returns, liquidity, leverage, growth and per share ratios | With the statements | | Peer comparison | [`/financials/peer-comparison`](/financials/peer-comparison) | 2 to 20 US stocks side by side, with the peer group median of 12 metrics | The newest trailing twelve months | | Earnings, KPIs and guidance | [`/earnings`](/earnings/releases), [`/kpi/metrics`](/earnings/kpis), [`/kpi/guidance`](/earnings/guidance), [`/kpi/non-gaap`](/earnings/non-gaap) | 8-K earnings releases and the 10-Q or 10-K that follows | Releases since January 2023 | | Insider trades | [`/insider-trades`](/ownership/insider-trading) | Forms 4 and 5 | Since 2006 | | Insider holdings | [`/insider-ownership`](/ownership/insider-holdings) | Forms 3 and 5 | Since 2006 | | Insider sale notices | [`/insider-trades/sale-notices`](/ownership/form-144-sale-notices) | Form 144 | Every XML notice, since April 2023 | | 5% owners | [`/beneficial-ownership`](/ownership/beneficial-13d-13g), [`/activist-ownership`](/ownership/activist-13d) | Schedules 13D and 13G | Since December 2024 | | Institutional holdings | [`/institutional-holdings`](/ownership/13f-institutional-holdings) | Form 13F | Since 2013 | | Fund holdings | [`/index-funds`](/ownership/etf-fund-holdings) | Form N-PORT of every registered fund and ETF | Since 2019 | | IPOs | [`/ipos`](/sec-edgar/ipo-filings) | S-1, F-1, 424B4 | Since January 2025 | | News | [`/news`](/stocks/financial-news) | A company's 8-Ks, and Federal Reserve, SEC, BEA and BLS releases | Agency releases since November 2026 | | Stock prices | [`/prices`](/stocks/historical-prices), [`/prices/snapshot`](/stocks/price-snapshot), [`/dividends`](/stocks/dividends), [`/splits`](/stocks/splits) | About 10,000 Nasdaq, NYSE, Cboe and OTC stocks | Each stock's first session | | Stock technicals | [`/prices/technicals`](/stocks/technical-indicators) | SMA, EMA, RSI-14, MACD, Bollinger Bands, ATR-14, the 52-week range and returns of a US stock | The newest 280 daily or weekly bars | | Tokenized stocks | [`/tokenized-stocks`](/tokenized-stocks/markets), [`/tokenized-stocks/prices`](/tokenized-stocks/prices), [`/tokenized-stocks/trades`](/tokenized-stocks/trades) | OKX stock swaps, Bybit xStocks and Coinbase stock tokens on Base | Prices as they trade, and stored price and trade history | | Fails to deliver | [`/fails-to-deliver`](/stocks/fails-to-deliver) | Every security with fails on a day | Since July 2009 | | Short volume | [`/short-volume`](/stocks/short-volume) | FINRA daily short sale volume, short-exempt volume and short ratio of every NMS symbol | One trading day per request | | Commitments of Traders | [`/cot`](/futures/commitment-of-traders) | About 960 futures markets | Legacy reports since 1986 | | Economic calendar | [`/macro/economic-calendar`](/macro/economic-calendar) | Scheduled and published releases worldwide, with actual, forecast, previous and surprise | 7 days back to 14 days ahead by default | | Policy rates | [`/macro/interest-rates`](/macro/interest-rates) | 31 central banks | The Fed since 1954 | | Treasury yields | [`/macro/yield-curve`](/macro/treasury-yield-curve) | 14 tenors | Since 1990 | | Inflation | [`/macro/inflation`](/macro/cpi-pce-inflation) | CPI and PCE prices | CPI since 1947, PCE since 1959 | | Labor market | [`/macro/labor`](/macro/labor-market) | Payrolls, household survey, JOLTS and jobless claims | Payrolls since 1939 | | Growth and income | [`/macro/gdp`](/macro/gdp-income) | GDP, profits, income and saving | GDP since 1947 | | GPU rental prices | [`/macro/gpu-prices`](/macro/gpu-rental-prices) | NVIDIA H100, H200, GB200 and A100, AMD MI300X | Daily since 26 November 2026 | | Crypto prices and snapshots | [`/crypto/prices`](/crypto/prices), [`/crypto/prices/snapshot`](/crypto/price-snapshot), [`/crypto/tickers`](/crypto/tickers) | Darvas aggregated feeds (`ALLUSD` included) across OKX, Binance, Bybit, Hyperliquid, Coinbase, Kraken, Bitstamp, Deribit and Bitfinex | Live candles every minute | | Crypto footprint and order flow | [`/crypto/footprint`](/crypto/footprint-charts), [`/crypto/order-flow`](/crypto/order-flow), [`/crypto/trades`](/crypto/trades) | Darvas aggregated feeds and OKX, Binance, Bybit and Hyperliquid trades | Order flow for 13 months, raw trades for 90 days | | Crypto technical indicators | [`/crypto/indicators`](/crypto/technical-indicators) | SMA, EMA, RSI, MACD, Bollinger Bands, ATR, relative volume and returns on Darvas aggregated or single-exchange candles | Live across minute to monthly frames | | Crypto indices and market context | [`/crypto/index/prices`](/crypto/index-prices), [`/crypto/prices/snapshot/market`](/crypto/market-snapshot), [`/crypto/volume/aggregated`](/crypto/aggregated-volume), [`/crypto/context`](/crypto/market-context), [`/crypto/hyperliquid/markets`](/crypto/hyperliquid-markets) | Composite spot indices, every pair's 24-hour price and volume, perpetual volume across four exchanges, Hyperliquid perpetuals and a one-call market brief | Live | | Crypto order book and large trades | [`/crypto/order-book`](/crypto/order-book), [`/crypto/order-book/heatmap`](/crypto/order-book-heatmap), [`/crypto/large-trades`](/crypto/large-trades), [`/crypto/large-trades/zones`](/crypto/whale-trade-zones) | L2 books merged across OKX, Binance, Bybit and Hyperliquid, book heatmaps from one-second samples, and whale trades with the price zones where they traded | Live books, whale trades up to 7 days back and zones up to 30 days | | Crypto profiles and structure | [`/crypto/volume-profile`](/crypto/volume-profile), [`/crypto/volume-profile/fixed-range`](/crypto/fixed-range-volume-profile), [`/crypto/tpo`](/crypto/tpo-market-profile), [`/crypto/market-structure`](/crypto/market-structure) | Session and fixed range volume profiles, TPO market profiles, Smart Money Concepts, order blocks, fair value gaps and swings | Up to 30 sessions of profiles, and up to 500 candles of structure | | Crypto derivatives and options | [`/crypto/derivatives`](/crypto/derivatives), [`/crypto/derivatives/snapshot`](/crypto/derivatives-snapshot), [`/crypto/derivatives/oi-scan`](/crypto/open-interest-scanner), [`/crypto/derivatives/option-chain`](/crypto/options-chain), [`/crypto/derivatives/iv-skew`](/crypto/options-iv-skew) | Funding, open interest, basis, long-short ratios and taker volume on OKX, Binance, Bybit and Hyperliquid, and OKX options with Greeks and IV skew | Series up to 30 days back, options live | | Crypto liquidations | [`/crypto/liquidations`](/crypto/liquidations), [`/crypto/liquidations/heatmap`](/crypto/liquidation-heatmap) | Forced liquidation fills on OKX, Binance, Bybit and Hyperliquid, and estimated OKX perpetual liquidation levels | Fills up to 7 days back | | Crypto screener | [`/crypto/screener`](/crypto/screener), [`/crypto/screener/metrics`](/crypto/screener-metrics) | OKX USDT spot, perpetual and futures markets, screened on 77 rating, technical, volume, performance and derivatives metrics, with ranges, crossovers and a timeframe per condition | Live | | Spot crypto ETF flows | [`/crypto/etf-flows`](/crypto/etf-flows) | Daily, weekly and monthly net flows of US spot Bitcoin, Ethereum and Solana ETFs, by issuer | Up to 365 days per request | | DeFi | [`/defi/protocols`](/defi/protocols-tvl), [`/defi/stablecoins`](/defi/stablecoins), [`/defi/yields`](/defi/yields), [`/defi/dex-tokens`](/defi/dex-tokens) | Protocol TVL, stablecoin supply, lending and pool yields, and DEX pair liquidity on Ethereum, Solana, Base, Arbitrum, BSC and other chains | Current snapshots every 5 minutes, DEX pairs every 30 seconds | | Prediction markets | [`/prediction-markets`](/prediction-markets/markets), [`/prediction-markets/series`](/prediction-markets/series), [`/prediction-markets/arbitrage`](/prediction-markets/arbitrage) | Polymarket, Kalshi and OKX event contracts, their series, and price gaps between venues on the same question | Active contracts every 30 seconds | Every value names its source: an SEC accession number, or a publisher and series code. Macro values keep the figure as it was first published next to the current, revised one. [Market coverage](/market-coverage) gives the counts and update times of each dataset. ## Connect an AI agent * To let an agent answer with data, connect the data MCP server, `https://api.darvas.app/mcp`, with your key. [MCP server](/mcp-server) has the setup for Claude Code, Codex, Cursor, VS Code, Windsurf and Devin. * To let an agent write code against the API, give it [`/llms.txt`](https://docs.darvas.app/llms.txt) or the docs MCP server, `https://docs.darvas.app/mcp`. * To pick the right endpoint for a question, read the table in [Docs for AI agents](/ai-agents#which-endpoint-answers-which-question). # SEC 13F Institutional Holdings & Hedge Funds Source: https://docs.darvas.app/ownership/13f-institutional-holdings openapi.yaml GET /institutional-holdings Query quarterly SEC Form 13F institutional equity portfolios by stock ticker or investment manager, tracking share positions, values and changes. ## Overview Every manager with \$100 million or more in US-listed equities files Form 13F within 45 days of each quarter end. Send `filer_cik` for one manager's report, or `ticker` for every manager holding a security. | Coverage | Details | | - | - | | History | Every 13F report since 2013 Q2, from SEC's Form 13F Data Sets, and each later filing's XML | | Updated | Within about a minute of acceptance | | Managers | About 9,900 reports a quarter | | Tickers | Mapped from each CUSIP; `cusip` is always there | | Page size | 100; `limit` counts across pages | | MCP tool | `list_institutional_holdings` on the [data API MCP server](/mcp-server) | ## How positions are built * A manager often splits one security over several rows: by voting authority, or by the other managers that share discretion. A position sums those rows; `subsidiaries` lists them with their row number in the information table. * For each manager and quarter the report in force is the newest original or restatement, plus every "new holdings" amendment filed after it. `accession_number` and `filing_date` name the report in force. * Without `report_period`, `filer_cik` gives the manager's newest report, and `ticker` gives one position per manager whose newest report, filed within the last 15 months, holds the security. Managers that sold out do not appear. * `value_usd` is in dollars. Reports filed before 3 January 2023 stated thousands; they are multiplied. Some managers kept writing thousands after that date: `reported_price` far below the market price shows it. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/institutional-holdings" # Berkshire Hathaway's newest report, largest positions first berkshire = requests.get(url, headers=headers, params={"filer_cik": "1067983", "limit": 20}).json() for position in berkshire["institutional_holdings"]: print(position["ticker"], position["shares"], position["value_usd"]) # Who held NVIDIA at the end of June 2026 holders = requests.get( url, headers=headers, params={"ticker": "NVDA", "report_period": "2026-06-30", "limit": 100} ).json() for position in holders["institutional_holdings"][:10]: print(position["filer_name"], position["shares"]) ``` # Most Bought Stocks by 13F Institutions API Source: https://docs.darvas.app/ownership/13f-most-bought openapi.yaml GET /institutional-ownership/top-bought Rank the stocks 13F institutions bought or sold most in a quarter by net dollar flow, value change, share change, new positions and net buyers. ## Overview This endpoint ranks common stocks by net institutional accumulation, or with `direction=sold` by distribution, in one quarter of 13F reports. Each stock carries its holders now and a quarter ago, buyers and sellers, new, added, reduced and sold-out positions, the price-adjusted net dollar flow and its institutional ownership. Rank by net flow, net value change, net share change, new positions or net buyers. | Coverage | Details | | - | - | | Coverage | Common equity in every Form 13F report of the quarter | | Direction | `bought` (default) or `sold` | | Results | Up to 100 stocks | | MCP tool | `list_institutional_top_bought` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/institutional-ownership/top-bought", headers=headers, params={ "direction": "bought", "min_holders": 50, }, ).json() for stock in answer["stocks"]: print(stock["rank"], stock["ticker"], stock["net_buyers_count"], stock["new_positions_count"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/institutional-ownership/top-bought?direction=bought&min_holders=50" ``` # 13F Holdings Changes API: New, Added, Sold Source: https://docs.darvas.app/ownership/13f-position-changes openapi.yaml GET /institutional-ownership/changes Compare each 13F manager's holdings quarter over quarter: new positions, adds, cuts and exits, with share and value changes and percent of shares outstanding. ## Overview This endpoint compares each institution's 13F holdings in `report_period` with the quarter before and classifies every position as `new_position`, `added`, `reduced`, `sold_out` or `unchanged`. Each row carries the change in shares and dollars, both in percent, and the position's share of shares outstanding. Ask by held ticker, by filer CIK or by investor name. Only filers with a report in force for the quarter are compared, so a late filer does not show as having sold out. | Coverage | Details | | - | - | | Coverage | Every Form 13F holdings report and its amendments | | Actions | `new_position`, `added`, `reduced`, `sold_out`, `unchanged` | | Instruments | `all`, `equity`, `call` or `put` positions | | Pages | Up to 100 rows a page with `next_page_url` | | MCP tool | `list_institutional_changes` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/institutional-ownership/changes", headers=headers, params={ "ticker": "NVDA", "action": "new_position,sold_out", }, ).json() for change in answer["changes"]: print(change["filer_name"], change["action"], change["current_shares"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/institutional-ownership/changes?ticker=NVDA&action=new_position,sold_out" ``` # Activist Investor Schedule 13D Stakes API Source: https://docs.darvas.app/ownership/activist-13d openapi.yaml GET /activist-ownership Monitor activist investor campaigns from SEC Schedule 13D filings, including reporting group, stake percentage, acquisition purpose and filing links. ## Overview Track activist campaigns from SEC Schedule 13D and 13D/A XML filings under the `activist_owners` response key. Every row isolates one reporting person within an active ownership stake, preserving exact voting power, dispositive power, share counts, ownership percentage and the narrative Item 4 disclosure. For combined active and passive 5% ownership records, query [Beneficial Ownership](/ownership/beneficial-13d-13g). This dedicated activist route excludes passive Schedule 13G filings so event-driven monitors receive only stakes filed with active intent. | Coverage | Details | | - | - | | Filing forms | `SCHEDULE 13D` (initial campaign) and `SCHEDULE 13D/A` (amendments) | | Data source | Structured SEC EDGAR XML submissions required since December 2024 | | Latency | Indexed within about one minute of EDGAR acceptance | | Pagination | Up to 100 rows per page; `limit` traverses cursor pages up to 10,000 rows | | MCP tool | `list_activist_owners` on the [data API MCP server](/mcp-server) | ## Schedule 13D versus Schedule 13G thresholds Section 13(d) of the Securities Exchange Act requires any investor or coordinated group that acquires beneficial ownership above 5% of a registered voting equity class to file a Schedule 13D unless the holder qualifies for the shorter passive Schedule 13G regime. * **Control or influence trigger.** Crossing 5% while intending to influence board composition, capital allocation, strategic alternatives or corporate governance mandates Schedule 13D disclosure within five business days of the triggering `event_date`. * **Passive-to-active conversion.** A qualified institutional or passive investor already reporting on Schedule 13G must convert to Schedule 13D if its intent shifts toward activism or if an exempt passive stake exceeds 20% of the class. * **Joint group reporting.** When an activist fund, general partner and portfolio manager file jointly as a reporting group, each reporting entity receives its own row with separate sole and shared voting totals so you can avoid double-counting shares across affiliated entities. ## Parameters Provide one target identifier (`ticker`, `cik` or `filer_cik`), or omit all three to scan recent activist filings market-wide. | Parameter | Type | Description | | - | - | - | | `ticker` | string | Target company ticker symbol. Returns activist stakes held in that issuer. | | `cik` | string | Target company SEC CIK. Useful when tracking issuers with historical ticker changes. | | `filer_cik` | string | Activist investor or reporting fund CIK. Returns every company where that filer holds a 13D stake. | | `history` | boolean | Defaults to `false` (latest filing per stake). Set `true` to return the initial 13D plus every sequential 13D/A amendment. | | `filing_date` | string | Exact SEC acceptance date (`YYYY-MM-DD`). | | `filing_date_gte`, `filing_date_lte`, `filing_date_gt`, `filing_date_lt` | string | Date bounds on `filing_date` to isolate campaigns filed inside an event window. | | `limit` | integer | Maximum rows returned across paginated calls, up to 10,000. | | `cursor` | string | Pagination token returned in `next_cursor` for continuing large scans. | ## Amendment timelines and Item 4 purpose disclosures Activist campaigns rarely end with the initial filing. Under SEC rules, a reporting person must file a `SCHEDULE 13D/A` amendment within two business days after any material change, including acquiring or disposing of 1% or more of the equity class or changing strategic plans. 1. **Tracking campaign progression.** Request `history=true` and sort by `amendment_number` or `filing_date` to inspect how `percent_of_class` builds from initial entry to board settlement or full exit. 2. **Reading Item 4 (`purpose_of_transaction`).** This field stores the filer's stated intent verbatim, ranging from routine investment language to demands for board representation, spin-offs, management replacement, share buybacks or an outright sale of the company. 3. **Separating voting and economic control.** Compare `sole_voting_power` and `shared_voting_power` against `sole_dispositive_power` and `shared_dispositive_power` to see whether the activist can vote shares directly in a proxy contest or shares discretion across managed accounts. ## Response fields | Field | Description | | - | - | | `ticker`, `issuer_name`, `issuer_cik`, `issuer_cusip`, `security_class_title` | Target issuer identifiers and the specific voting equity class covered by the campaign. | | `filer_cik`, `reporting_person_name`, `reporting_person_cik`, `type_of_reporting_person` | Reporting entity details and SEC filer classification code (such as `IN`, `PN`, `IA` or `CO`). | | `form_type`, `is_amendment`, `amendment_number`, `is_latest` | Distinguishes initial `SCHEDULE 13D` filings from numbered `SCHEDULE 13D/A` updates and flags the current state. | | `filing_date`, `event_date`, `accession_number`, `filing_url` | SEC acceptance date, triggering transaction date, accession identifier and direct EDGAR index link. | | `aggregate_amount_beneficially_owned`, `percent_of_class` | Total shares beneficially owned by the reporting person and resulting percentage of the class. | | `sole_voting_power`, `shared_voting_power`, `sole_dispositive_power`, `shared_dispositive_power` | Breakdown of direct versus shared voting and sale authority across the stake. | | `purpose_of_transaction` | Full Item 4 narrative text describing the activist's strategic objectives and proposed actions. | ## Analyst workflows and examples ### Inspect a campaign timeline and Item 4 changes Fetch every amendment for one company to track stake accumulation and spot when Item 4 language escalates from passive discussion to proxy proposals. ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/activist-ownership?ticker=VANI&history=true" ``` ### Monitor new activist campaigns across all issuers Poll daily with `filing_date_gte` and filter for `is_amendment == False` to surface fresh initial Schedule 13D entries before full media coverage. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/activist-ownership", headers=headers, params={"filing_date_gte": "2026-11-01", "limit": 100}, ).json() for row in resp["activist_owners"]: if not row["is_amendment"]: print(row["filing_date"], row["ticker"], row["reporting_person_name"], f'{row["percent_of_class"]}%') ``` # SEC Schedule 13D & 13G Beneficial Owners API Source: https://docs.darvas.app/ownership/beneficial-13d-13g openapi.yaml GET /beneficial-ownership Track owners of more than 5% of a company's shares from SEC Schedule 13D and 13G filings since December 2024, with shares, ownership percent and amendments. ## Overview Anyone who comes to own more than 5% of a class of a company's shares files a Schedule 13D, or a shorter Schedule 13G when the stake is passive. Each row is one reporting person of one filing: joint filings, such as a fund and its manager, list several. | Coverage | Details | | - | - | | History | Every schedule filed as XML, which SEC has required since December 2024 | | Updated | Within about a minute of acceptance | | Forms | SCHEDULE 13D, 13D/A, 13G, 13G/A | | Page size | 100; `limit` counts across pages, up to 10,000 | | MCP tool | `list_beneficial_owners` on the [data API MCP server](/mcp-server) | A stake is one filer's holding in one company, as a 13D or as a 13G. By default each stake's newest filing comes; `history=true` returns every filing of the chain with `is_latest` on the newest. `type` is `activist` for a 13D and `passive` for a 13G. A 13D states its purpose in `purpose_of_transaction`; a 13G names the rule it is filed under. ## Filtering * `ticker` or `cik` for who owns a company, or `filer_cik` for what a filer owns; send one. * `type`: `activist` or `passive`. * `history`: `true` for every filing. * `filing_date`, `filing_date_gte`, `filing_date_lte`, `filing_date_gt`, `filing_date_lt`: ISO dates. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/beneficial-ownership" owners = requests.get(url, headers=headers, params={"ticker": "AAPL", "limit": 50}).json() for row in owners["beneficial_owners"]: print(row["reporting_person_name"], row["type"], row["percent_of_class"]) ``` # ETF & Mutual Fund Holdings API (SEC N-PORT) Source: https://docs.darvas.app/ownership/etf-fund-holdings openapi.yaml GET /index-funds Query US ETF and mutual fund portfolio holdings from SEC Form N-PORT filings by fund or stock ticker, with weights, market values and share counts. ## Overview Registered funds and ETFs report their full portfolio to SEC on Form N-PORT every month; the report for the last month of each quarter is made public. Send `ticker` for one fund's holdings, or `holding` for the funds that hold a security. | Coverage | Details | | - | - | | Funds | Every registered fund that files N-PORT: about 14,000 reports a quarter, all share class tickers | | History | Since 2019 Q4, from SEC's Form N-PORT Data Sets, and each later filing's XML | | Updated | Within about a minute of acceptance | | Page size | 100; `limit` counts across pages, default 50; `offset` skips rows | | MCP tool | `list_index_fund_holdings` on the [data API MCP server](/mcp-server) | * `ticker` takes any share class: VOO, VFIAX and VFFSX all name the Vanguard 500 Index Fund. The answer is the fund's newest report, or with `as_of` the newest on or before that date. An amended report (NPORT-P/A) replaces the first one. * `weight` is the holding as a percent of net assets, as the fund reports it. Leveraged and short positions can take the total above or below 100. * A holding's `ticker` is the US ticker of its CUSIP; securities without a US listing have none, and keep their `isin`. * `holding` returns the funds whose newest report, filed within the last 15 months, holds the security, largest weight first. A fund's `ticker` there is its shortest share class ticker, which is the ETF's where there is one. Unit investment trusts such as SPY and DIA do not file N-PORT, so their holdings are not here. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/index-funds" voo = requests.get(url, headers=headers, params={"ticker": "VOO", "limit": 10}).json() print(voo["fund"]["as_of"], voo["fund"]["total_holdings"]) for holding in voo["holdings"]: print(holding["ticker"], round(holding["weight"], 2)) holders = requests.get(url, headers=headers, params={"holding": "NVDA", "limit": 20}).json() for fund in holders["funds"]: print(fund["ticker"], fund["name"], round(fund["weight"], 2)) ``` # SEC Form 144 Proposed Insider Sale Notices API Source: https://docs.darvas.app/ownership/form-144-sale-notices openapi.yaml GET /insider-trades/sale-notices Monitor SEC Form 144 notices of proposed insider sales since April 2023, with broker, shares to sell, market value, approximate sale date and recent sales. ## Overview An officer, director, or other affiliate who plans to sell restricted or control shares files Form 144 before the sale. The endpoint returns one row per notice, newest filing first. Each notice records how many shares the seller may sell and through which broker, how and when the seller acquired those shares, and what the seller sold during the preceding three months. | Coverage | Details | | - | - | | History | Every notice filed as XML, which SEC has required since April 2023, and earlier XML notices | | Updated | Within about a minute of acceptance, from each new notice's XML | | Forms | 144, 144/A | | Companies | Any: without `ticker` or `cik`, the newest notices across all companies come first | | Page size | 100 rows per page; `limit` counts across pages, up to 10,000 | | MCP tool | `list_sale_notices` on the [data API MCP server](/mcp-server) | A Form 144 notice states intent to sell, not an executed trade. When a sale takes place, the completed transaction appears later on Form 4 in [Insider Trades](/ownership/insider-trading). ## Parameters Filter notices by issuer, seller name, or SEC filing date, or omit company filters to scan market-wide notices. | Parameter | Type | Description | | - | - | - | | `ticker` | string | Issuer ticker symbol. Leave both `ticker` and `cik` out to query across all companies. | | `cik` | string | Issuer SEC CIK. Takes precedence when both `ticker` and `cik` are provided. | | `name` | string | Word match against seller names in any order and any case, so `stepien` or `thomas stepien` both match `THOMAS M STEPIEN`. | | `filing_date` | string | Exact SEC filing date in `YYYY-MM-DD` format. | | `filing_date_gte`, `filing_date_lte`, `filing_date_gt`, `filing_date_lt` | string | Inclusive or exclusive ISO date range bounds on `filing_date`. | | `limit` | integer | Maximum rows returned across pages, up to 10,000. | | `cursor` | string | Pagination token returned in `next_cursor` to fetch the next page. | ## Response fields Each item in `sale_notices` represents one Form 144 or corrected Form 144/A filing. | Field | Description | | - | - | | `ticker`, `issuer`, `issuer_cik` | Resolved ticker, company name as filed, and issuer CIK. | | `name`, `seller_cik`, `relationships` | Seller name, filer CIK, and reported relationships to the issuer such as `OFFICER` or `DIRECTOR`. | | `form_type`, `filing_date`, `notice_date`, `accession_number`, `filing_url` | `144` or `144/A`, SEC acceptance date, signing date, accession number, and EDGAR index link. | | `replaces_accession_number` | On a corrected `144/A` notice, the accession number of the original notice it replaces; `null` on an initial notice. | | `securities` | Array of security classes proposed for sale, including share counts, broker, and estimated `market_value`. | | `acquisitions` | How and when the seller acquired the shares being offered for sale. | | `sales_past_3_months` | Prior sales reported by the seller during the preceding three months; empty when none occurred. | | `plan_adoption_dates` | Dates on which the seller adopted Rule 10b5-1 trading plans covering the planned sale; empty when none apply. | | `remarks` | Free-text remarks filed by the seller; amended `144/A` filings often explain what changed here. | ## Examples Rank a day's market-wide notices by planned sale value, or filter one company's notices for Rule 10b5-1 plans. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/insider-trades/sale-notices" # Today's notices across the market, largest planned sale first today = requests.get(url, headers=headers, params={"filing_date": "2026-11-24", "limit": 500}).json() largest = sorted( today["sale_notices"], key=lambda notice: sum(c["market_value"] or 0 for c in notice["securities"]), reverse=True, ) for notice in largest[:10]: value = sum(c["market_value"] or 0 for c in notice["securities"]) print(notice["ticker"], notice["name"], round(value)) # Notices of one company that fall under a 10b5-1 plan nvda = requests.get(url, headers=headers, params={"ticker": "NVDA", "limit": 100}).json() print(sum(1 for notice in nvda["sale_notices"] if notice["plan_adoption_dates"])) ``` # Insider Cluster Buying API: Form 4 Clusters Source: https://docs.darvas.app/ownership/insider-cluster-buys openapi.yaml GET /insider-trades/clusters Find companies where several insiders bought on the open market within a window, scored by buy and sell dollars and a net insider sentiment score. ## Overview This endpoint finds companies where at least `min_insiders` distinct insiders made open-market purchases within `window_days`, from Form 4 and Form 5 filings. Each cluster sums the buyers' and sellers' shares and dollars, the average buy price, the buy-to-sell dollar ratio and a net insider sentiment score from -100 to +100, and lists the insiders who bought. Exclude Rule 10b5-1 scheduled trades with `exclude_10b5_1=true`, narrow to a sector, and rank by total buy value, distinct buyers, sentiment or the newest filing. | Coverage | Details | | - | - | | Coverage | Open-market non-derivative purchases on Forms 4 and 5 | | Window | 1 to 180 days ending on `as_of`; 30 by default | | Results | Up to 100 clusters | | MCP tool | `list_insider_clusters` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/insider-trades/clusters", headers=headers, params={ "window_days": 30, "min_insiders": 3, }, ).json() for cluster in answer["clusters"]: print(cluster["ticker"], cluster["distinct_buyers"], cluster["total_buy_value_usd"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/insider-trades/clusters?window_days=30&min_insiders=3" ``` # Corporate Insider Ownership & Holdings API Source: https://docs.darvas.app/ownership/insider-holdings openapi.yaml GET /insider-ownership Query what officers, directors and 10% owners hold, from SEC Form 3 initial statements and Form 5 annual statements since 2006, by ticker or CIK. ## Overview One row per holding reported on Form 3, the initial statement an insider files on taking a role, or Form 5, the annual statement of ownership. Holdings are point-in-time snapshots, returned newest filing first. | Coverage | Details | | - | - | | History | Since January 2006 | | Updated | Within about a minute of SEC acceptance | | Forms | 3, 3/A, 5, 5/A | | Page size | 100 rows per page; `limit` counts across pages, up to 10,000 | | MCP tool | `list_insider_ownership` on the [data API MCP server](/mcp-server) | Use this endpoint for point-in-time positions disclosed when an insider joins or files an annual summary. For open-market buys, sales, grants, and option exercises, use [Insider Trades](/ownership/insider-trading). ## Parameters Narrow holdings by company, insider name, form type, or SEC filing date. | Parameter | Type | Description | | - | - | - | | `ticker` | string | Issuer ticker symbol, case-insensitive. | | `cik` | string | Issuer SEC CIK. Takes precedence when both `ticker` and `cik` are sent. | | `name` | string | Case-insensitive substring match against reporting owner names. | | `form_type` | string | Filter to one form: `3`, `3/A`, `5`, or `5/A`. | | `filing_date` | string | Exact SEC filing date in `YYYY-MM-DD` format. | | `filing_date_gte`, `filing_date_lte`, `filing_date_gt`, `filing_date_lt` | string | Inclusive or exclusive ISO date range bounds on `filing_date`. | | `limit` | integer | Maximum rows returned across pages, up to 10,000. | | `cursor` | string | Pagination token returned in `next_cursor` to fetch the next page. | ## Response fields Each item in `insider_ownership` joins one holding row with its filing metadata, reporting owners, and footnotes. | Field | Description | | - | - | | `ticker`, `issuer`, `issuer_cik` | Resolved ticker, company name as filed, and issuer CIK. | | `name`, `title`, `owner_cik`, `reporting_owners` | First reporting owner's name, role title, CIK, and the full owner list on joint filings. | | `is_board_director`, `is_officer`, `is_ten_percent_owner` | Boolean flags describing the first owner's relationship to the issuer. | | `form_type`, `filing_date`, `as_of_date`, `accession_number`, `filing_url` | SEC form code, acceptance date, statement date, accession number, and EDGAR index link. | | `holding_type`, `security_title`, `shares_owned`, `is_derivative` | `common` for non-derivative shares or `derivative` for options, units, and warrants, plus title and share count. | | `direct_or_indirect`, `nature_of_ownership` | `D` for direct ownership or `I` for indirect holdings, along with the holding vehicle such as a trust. | | `conversion_or_exercise_price`, `exercise_date`, `expiration_date`, `underlying_security_title`, `underlying_security_shares` | Populated on derivative holdings to describe conversion terms and underlying shares. | | `footnotes` | Array of footnotes attached to the holding with their text. | ## Examples Fetch initial Form 3 insider holdings for a company and inspect share counts and ownership type. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} holdings = requests.get( "https://api.darvas.app/v1/insider-ownership", headers=headers, params={"ticker": "TSLA", "form_type": "3", "limit": 20}, ).json()["insider_ownership"] for holding in holdings: print(holding["filing_date"], holding["name"], holding["holding_type"], holding["shares_owned"]) ``` # Insider Trading Screener API: Form 4 Buys Source: https://docs.darvas.app/ownership/insider-screener openapi.yaml GET /insider-trades/screener Screen Form 4 and 5 insider trades of every company by type, dollar value, role, 10b5-1 plan, sector and date, with holding change and filing delay. ## Overview This endpoint screens SEC Form 4 and Form 5 insider transactions across every company, or one company by ticker or CIK. Filter by transaction type (buy, sell, option exercise, award and others, or the SEC codes P, S, M, A), by dollar value, by role (CEO, CFO, officer, director, 10% owner), by Rule 10b5-1 plan, by sector and by filing date. Each trade carries `holding_change_pct` and `filing_delay_days`. Market-wide screens default to the trailing 30 days. Sort by filing date, transaction date, value, shares, holding change or filing delay. | Coverage | Details | | - | - | | Coverage | Every Form 4 and Form 5 filed with SEC since 2006 | | Roles | `ceo`, `cfo`, `officer`, `director` and `ten_percent_owner` | | Pages | Up to 100 trades a page with `next_page_url` | | MCP tool | `screen_insider_trades` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/insider-trades/screener", headers=headers, params={ "transaction_type": "buy", "role": "ceo", "min_value_usd": 1000000, }, ).json() for trade in answer["insider_trades"]: print(trade["ticker"], trade["owner_name"], trade["form_type"], trade["accession_number"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/insider-trades/screener?transaction_type=buy&role=ceo&min_value_usd=1000000" ``` # SEC Form 4 Insider Trading Data API Reference Source: https://docs.darvas.app/ownership/insider-trading openapi.yaml GET /insider-trades Track insider buys, sells, grants and option exercises by officers, directors and 10% owners from SEC Forms 4 and 5 since 2006, by ticker, CIK or owner. ## Overview One row per transaction reported on Form 4 or Form 5, returned newest filing first. Each row joins the transaction with its filing metadata, all reporting owners, and its footnotes. | Coverage | Details | | - | - | | History | Since January 2006, from SEC's Insider Transactions Data Sets | | Updated | Within about a minute of acceptance, from each new filing's XML | | Forms | 4, 4/A, 5, 5/A | | Page size | 100 rows per page; `limit` counts across pages, up to 10,000 | | MCP tool | `list_insider_trades` on the [data API MCP server](/mcp-server) | For point-in-time holdings filed on Form 3 or Form 5 without a transaction, use [Insider Ownership](/ownership/insider-holdings). For pre-sale Form 144 notices, use [Sale Notices](/ownership/form-144-sale-notices). ## Parameters Filter transactions by company, reporting owner, transaction type, form, or filing date. | Parameter | Type | Description | | - | - | - | | `ticker` | string | Issuer ticker symbol, case-insensitive. | | `cik` | string | Issuer SEC CIK. Takes precedence when both `ticker` and `cik` are sent. | | `name` | string | Case-insensitive substring match against reporting owner names. | | `transaction_type` | string | SEC one-letter transaction code or full name from the table below, in any case. | | `form_type` | string | Filter to one form: `4`, `4/A`, `5`, or `5/A`. | | `filing_date` | string | Exact SEC filing date in `YYYY-MM-DD` format. | | `filing_date_gte`, `filing_date_lte`, `filing_date_gt`, `filing_date_lt` | string | Inclusive or exclusive ISO date range bounds on `filing_date`. | | `limit` | integer | Maximum rows returned across pages, up to 10,000. | | `cursor` | string | Pagination token returned in `next_cursor` to fetch the next page. | ## Transaction types `transaction_type` accepts SEC's one-letter code or its name, in any case. | Code | Type | Code | Type | | - | - | - | - | | `P` | Purchase | `M` | Option exercise | | `S` | Sale | `C` | Conversion | | `A` | Award | `X` | In-the-money exercise | | `D` | Disposition to issuer | `G` | Gift | | `F` | Tax withholding | `J` | Other | The full list of 20 codes is in the [SEC Form 4 instructions](https://www.sec.gov/files/forms-3-4-5.pdf). ## Response fields Each item in `insider_trades` describes one reported transaction and the insider's holdings before and after the trade. | Field | Description | | - | - | | `ticker`, `issuer`, `issuer_cik` | Resolved ticker, company name as filed, and issuer CIK. | | `name`, `title`, `owner_cik`, `reporting_owners` | First reporting owner's name, role title, CIK, and every owner on joint filings. | | `is_board_director`, `is_officer`, `is_ten_percent_owner` | Boolean flags describing the first owner's relationship to the issuer. | | `form_type`, `filing_date`, `report_period`, `transaction_date`, `accession_number`, `filing_url` | Form code, filing date, report period, execution date, accession number, and EDGAR link. | | `transaction_code`, `transaction_type`, `acquired_or_disposed` | SEC transaction code, human-readable type, and `A` for acquired or `D` for disposed. | | `transaction_shares`, `transaction_price_per_share`, `transaction_value` | Share or unit count, execution price per share, and total dollar value. | | `shares_owned_before_transaction`, `shares_owned_after_transaction` | Computed pre-trade holdings and reported post-trade holdings. | | `is_10b5_1_plan`, `direct_or_indirect`, `nature_of_ownership` | Whether the Rule 10b5-1 trading plan box was checked, plus direct (`D`) or indirect (`I`) ownership details. | | `is_derivative`, `security_title`, `underlying_security_title`, `underlying_security_shares`, `conversion_or_exercise_price` | Security title and derivative fields for option exercises, conversions, and awards. | | `footnotes` | Array of filing footnotes referenced by the transaction. | ## Examples Query recent open-market insider purchases and count sales executed under Rule 10b5-1 trading plans. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/insider-trades" purchases = requests.get( url, headers=headers, params={"ticker": "NVDA", "transaction_type": "Purchase", "filing_date_gte": "2025-01-01", "limit": 50}, ).json()["insider_trades"] for trade in purchases: print(trade["filing_date"], trade["name"], trade["transaction_shares"], trade["transaction_price_per_share"]) # Sales made under a pre-arranged plan planned = requests.get(url, headers=headers, params={"ticker": "NVDA", "transaction_type": "S", "limit": 100}).json() print(sum(1 for t in planned["insider_trades"] if t["is_10b5_1_plan"])) ``` # Company Ownership Summary API: 13F, 13D, Insiders Source: https://docs.darvas.app/ownership/ownership-summary openapi.yaml GET /ownership/summary Read one company's ownership in a call: 13F institutions and their changes, 13D and 13G stakes, insider buying and sentiment, and ETF and fund holders. ## Overview This endpoint answers who owns a company in one call. It combines the 13F institutions with the largest holders and their quarter-over-quarter changes, the 13D activist and 13G passive stakes above 5%, insider open-market buying and selling over `insider_window_days` with a sentiment score, and the ETFs and mutual funds that hold the stock from Form N-PORT. Each section cites the filings it reads. | Coverage | Details | | - | - | | Companies | Every SEC filer, by ticker or CIK | | Sections | `institutional_13f`, `beneficial_13d_13g`, `insider_activity`, `etf_and_fund_holders` | | Insider window | 7 to 365 days; 90 by default | | MCP tool | `get_ownership_summary` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/ownership/summary", headers=headers, params={ "ticker": "TSLA", }, ).json() print(answer["company_name"], answer["as_of"]) print(answer["institutional_13f"]) print(answer["insider_activity"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/ownership/summary?ticker=TSLA" ``` # Cursor Pagination, Limits & Response Paging Source: https://docs.darvas.app/pagination 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](/financials/income-statements) | 10 periods | Counts periods across pages, up to 400 | | [Earnings releases](/earnings/releases) | 10 filings | Counts periods across pages, up to 40 | | [GPU rental prices](/macro/gpu-rental-prices) | Up to 10 days | Pages by date; the last 90 days without dates | | [SEC filings](/sec-edgar/filings), [IPO filings](/sec-edgar/ipo-filings), [insider trades](/ownership/insider-trading), [insider holdings](/ownership/insider-holdings), [Form 144](/ownership/form-144-sale-notices), [13D and 13G](/ownership/beneficial-13d-13g) | 100 | Up to 10,000 | | [13F holdings](/ownership/13f-institutional-holdings), [ETF and fund holdings](/ownership/etf-fund-holdings) | 100 | Counts across pages; fund holdings default to 50 and take `offset` | | [Historical stock prices](/stocks/historical-prices) | Up to 100 bars | Counts across pages | | [Financial news](/stocks/financial-news) | `limit`, 1 to 100 | 5 by default | | [Economic calendar](/macro/economic-calendar) | `limit`, 1 to 200 | 100 by default | | [XBRL facts](/financials/xbrl-facts), [tokenized stock prices](/tokenized-stocks/prices) and [trades](/tokenized-stocks/trades) | `limit`, 1 to 1,000 | 200 by default | | [Crypto prices](/crypto/prices), [crypto order flow](/crypto/order-flow) | 500 bars | 5,000 by default, up to 50,000 | | [Crypto trades](/crypto/trades) | 1,000 trades | 1,000 by default, up to 100,000 | | Macro history: [inflation](/macro/cpi-pce-inflation), [labor market](/macro/labor-market), [GDP and income](/macro/gdp-income) 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](/mcp-server) 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 `_`. # Pine Script AI Generator & Code Assistant Source: https://docs.darvas.app/pine-script/ai-assistant Describe a trading indicator in plain English, refine Pine Script logic or paste a broken TradingView script for the Darvas AI assistant to repair. The **Darvas** tab of the indicator editor writes Pine Script for you. It runs each answer on your chart, and when the script fails it sends the error back and fixes it. ## Before you start The assistant works with your own ChatGPT account and uses its quota. Connect the account in the chat panel. If it is not connected, the tab shows **Connect ChatGPT** and sends your request once the account is connected. The assistant uses the ChatGPT model you picked in the model menu. ## Describe an indicator 1. Open the indicator editor and choose the **Darvas** tab. 2. Describe what the indicator should draw. For example: "Find RSI 14 divergences. When price makes a lower low while RSI makes a higher low, connect the two lows with a line and put a label under the candle." 3. Send the request. The tab shows **Writing the indicator...**, then **Testing it on your chart...**. If the script fails, it shows **Fixing an error (attempt 2 of 3)...** and tries again. The assistant makes three attempts at most. A script that runs is added to the chart as a draft, and the tab lists it as a version. A new indicator is a Pine v6 `indicator()` script. The assistant does not write strategies, libraries or `import` statements. ## Change an indicator Write what should change, such as "make the line thicker" or "shade the background when RSI crosses 70". Each change is a new version. The assistant keeps the names of existing input variables, so input values you saved still apply. To go back, choose **Restore** on an earlier version. ## Paste a TradingView script Paste the whole script into the request box and send it. * Darvas first runs the script as pasted. If it runs and draws, Darvas adds it under its own `indicator()` title without asking the model, and the tab says "The script ran as pasted." * If it fails, the assistant gets the runner's error and makes the smallest change that makes it run. It keeps the script's `//@version` line, its inputs, plots and drawings, and every line the error does not involve. * A script for Pine v1 to v4 runs after an automatic rewrite to v5. See [Pine Script support](/pine-script/support#versions). ## Keep the result The assistant's indicator is a draft until you save it. Choose **Save** in the editor header to keep it, use it on other charts, set alerts or share it. If the request asks for alerts, the assistant also shows an alert card. An alert needs a saved indicator, so the card asks you to save first. See [Alerts on indicator marks](/pine-script/alerts). ## Limits * 60 requests an hour. * A request can be up to 100,000 characters, enough for a long pasted script. * If the script runner does not answer, the assistant keeps the script untested and says so. Add it to the chart to see whether it runs. # Pine Script alert() & alertcondition() Alerts Source: https://docs.darvas.app/pine-script/alerts Get an in-app, push, Telegram or Pro+ webhook alert when a saved Pine Script indicator draws a new buy or sell mark, or fires alertcondition() or alert(). An indicator alert checks a saved Pine Script indicator at every candle close and notifies you when it draws a new mark or raises an alert. ## Requirements * The indicator is saved. A draft is deleted when you close Darvas, and its alert would stop with it. * The chart timeframe is 15 minutes or longer, on a market whose candles Darvas stores. * Your plan has room for one more. Darvas Free has 1 indicator alert, Darvas Pro 5 and Darvas Pro+ 20, and each counts toward the plan's conditional alerts. ## Set an alert 1. Open the saved indicator in the editor, on the market and timeframe to watch. 2. In the **Darvas** tab, choose **Set alert**. The assistant also shows this card when your request asks for alerts. 3. Under **What sets off the alert**, choose one: * **Buy and sell marks**, then **BUY marks**, **SELL marks** or **All marks**. * One of the script's `alertcondition()` titles. * **Any alert() function call**. 4. Choose **Set alert**. Manage the alert in the **Alerts** panel. ## What counts as a mark A mark is a point of `plotshape()` or `plotchar()` whose value is not `false`, `na` or 0, or a label from `label.new()`. A `plotchar()` with an empty character does not count. Simulated strategy orders do not count. Darvas reads a mark's direction in this order: 1. Words in its title or text: buy, long, bull, bullish or al for a buy, and sell, short, bear, bearish or sat for a sell. A mark with words of both kinds goes on to the next rule. 2. Its shape or label style: an up shape is a buy and a down shape is a sell. 3. Its place: below the bar is a buy and above the bar is a sell. A mark with no direction matches only **All marks**. ```pine theme={null} //@version=6 indicator("EMA cross marks", overlay=true) fast = ta.ema(close, 9) slow = ta.ema(close, 21) plotshape(ta.crossover(fast, slow), "Buy", shape.triangleup, location.belowbar, color.green) plotshape(ta.crossunder(fast, slow), "Sell", shape.triangledown, location.abovebar, color.red) ``` ## alertcondition() and alert() * The card lists each `alertcondition()` whose title is a constant string. A title in a variable is not listed. * **Any alert() function call** fires on every bar where the script calls `alert()`. * The notification carries the alert's message, or the condition's title when the message is empty. Darvas fills these placeholders in `alertcondition()` and `alert()` messages: `{{ticker}}`, `{{exchange}}`, `{{interval}}`, `{{open}}`, `{{high}}`, `{{low}}`, `{{close}}`, `{{volume}}`, `{{time}}`, `{{timenow}}`, `{{syminfo.currency}}`, `{{syminfo.basecurrency}}`, `{{plot_0}}` to `{{plot_19}}` and `{{plot("Title")}}`. Times are in UTC. `{{strategy.*}}` placeholders stay as written. * Every frequency works as "once per bar close", because Darvas checks closed candles. A condition that is true only inside a candle, and false at its close, never fires. ## When Darvas checks * Darvas runs the saved script shortly after each candle closes, on the same 1,000 candles a chart uses, and reads only closed candles. * The first check only records the newest mark, so an alert never fires on history. * A newer mark sends a notification in the app, as a push notification and on Telegram, if you connected it. The alert stays on after it fires. * On Darvas Pro+, a [webhook](/pro/webhooks) that subscribes to `alarm.custom_indicator.triggered` receives each alert as a signed POST. ## When an alert pauses Darvas turns an alert off in these cases: * You can no longer run the indicator, for example because its author stopped sharing it. * The script fails on 3 candle closes in a row. * The script passes its 10 second run time or its memory on 10 candle closes in a row. You then get a notice that names the alert, says why it stopped and what turns it back on. # Pine Script Code Editor, Logs & Versions Source: https://docs.darvas.app/pine-script/editor Explore the Darvas Pine Script editor: AI assistant and Code tabs, runtime logs, input dialogs, version history, drafts and script management. ## Open the editor * **Desktop:** in `/terminal`, choose **Indicators** in the rail on the right of the chart. With Darvas V3, switch the V3 panel to **Custom indicator**. * **Mobile:** open the indicator menu, choose **Custom** and tap **New custom indicator**. The editor opens as a sheet. * **An indicator you saved:** choose its edit button in the **Custom** category of the indicator menu. ## Header | Part | What it does | | - | - | | Indicator switcher | Opens one of your saved indicators, or starts a **New indicator**. | | Status | **New draft**, **Not saved**, **Saved**, or the current version, such as **v3**. | | **Save** | Saves the script. The first save asks for a name. Each name can be used once per account. | | **Share** | Opens the sharing settings. See [Share an indicator](/pine-script/sharing). | | Menu | **New**, **Edit indicator details**, **Inputs**, **Share** and **Community indicators**. | **Edit indicator details** changes the name (up to 64 characters) and the description (up to 280 characters). Choose **Save** to keep the change. ## Darvas tab The **Darvas** tab is the assistant. Describe an indicator, or paste a TradingView script, and Darvas writes or fixes the Pine Script, tests it on the chart and adds it. See [Write indicators with Darvas](/pine-script/ai-assistant). The tab also lists the versions of the indicator. Every change to the code is a version, whether Darvas or you made it. Choose **Restore** on an earlier version to make its code current again. Darvas saves the restore as a new version. Darvas keeps the newest 50 versions. On a saved indicator, **Set alert** creates an alert on its marks. See [Alerts on indicator marks](/pine-script/alerts). ## Code tab The **Code** tab holds the Pine source. * **Add to chart** runs the script on the chart's newest 1,000 candles and draws it. After the first run the button reads **Update chart**. * When the script fails, the editor marks the line and shows the error message. * **Logs** lists the lines from `log.info()`, `log.warning()` and `log.error()` with the bar each line came from, plus warnings from the runner, such as drawings left out over a cap. It keeps the newest 1,000 lines. Logs come only from runs in the editor. * A script written for Pine v1 to v4 runs after an automatic rewrite to v5. The editor then shows "Converted from Pine v4 automatically. Compare the result with TradingView." ## Inputs **Inputs** in the menu, or the settings button of the indicator in the chart legend, opens a dialog with one field for each `input.*()` of the script. **Save** keeps your values and **Defaults** puts back the script's own. [Pine Script support](/pine-script/support#inputs) lists the input types and options the dialog shows. ## Drafts A script you add to the chart without saving is a draft. It stays in your browser until you close Darvas, and then it is removed. Save it to keep it, to use it on other charts and devices, and to set alerts or share it. ## Rename or delete an indicator * **Rename:** open the indicator, choose **Edit indicator details**, change the name and choose **Save**. * **Delete:** in the **Custom** category of the indicator menu, choose the delete button of the indicator and confirm. Deleting removes the saved source. If you shared the indicator, everyone who added it loses it too. # Pine Script v5 & v6 Custom Indicators Guide Source: https://docs.darvas.app/pine-script/introduction Run Pine Script v5 and v6 custom indicators on Darvas charts, import TradingView scripts, or generate indicators with your own ChatGPT account. A custom indicator is a Pine Script that Darvas runs on your chart. You can write the script yourself, paste one from TradingView, or describe what you want and let the Darvas assistant write it. Darvas runs Pine v5 and v6 as written and rewrites older versions to v5. Pine Script is the only indicator language Darvas runs. ```pine theme={null} //@version=6 indicator("My indicator", overlay=false) len = input.int(14, "Length", minval=1) rsi = ta.rsi(close, len) plot(rsi, "RSI", color=color.purple, linewidth=2) hline(70, "Overbought", color=color.gray) hline(30, "Oversold", color=color.gray) ``` This script is the template a new indicator starts with. It draws a 14-bar RSI in its own pane with lines at 70 and 30. ## What you can do > [card] [Write or paste Pine Script](/pine-script/quickstart) > > Add a script to the chart, change it and save it. > [card] [Describe it to Darvas](/pine-script/ai-assistant) > > The assistant writes the script, tests it on your chart and fixes its own errors. > [card] [Share it](/pine-script/sharing) > > Publish an indicator for every Darvas user, or only for people who know a password. > [card] [Get alerts](/pine-script/alerts) > > Get a notification when the indicator draws a new buy or sell mark. ## Where a script runs * A script you have not saved runs in your browser, in a sandboxed frame that has no network access. * A saved indicator runs on Darvas servers. That is how an alert can check it while Darvas is closed, and how a shared indicator can hide its code. * Every run reads the newest 1,000 candles of the chart. ## Reference > [card] [Pine Script support](/pine-script/support) > > Versions, outputs, strategies and inputs that Darvas runs. > [card] [Other symbols and data](/pine-script/request-security) > > request.security(), timeframes, company financials and US economic data. > [card] [Limits](/pine-script/limits) > > Run time, bar count, output caps and request limits. > [card] [The indicator editor](/pine-script/editor) > > Tabs, logs, inputs, versions and drafts. # Pine Script Execution Limits, Bars & Alerts Source: https://docs.darvas.app/pine-script/limits Check run time, bar counts, loop caps, script size, data reads, assistant requests and the Free, Pro and Pro+ indicator alert limits for Pine Script. ## Runs | Limit | Value | | - | - | | Bars a run reads | The newest 1,000 candles of the chart | | Run time | 10 seconds. Waiting for a `request.*()` series does not count, up to 15 seconds for each read. | | Loop iterations | 200,000. A loop that runs longer stops the script. | | Script length | 100,000 characters | | Data reads | 12 distinct series in one run, each up to 5,000 bars | | Saved indicator runs | 1,800 an hour for each account. A chart runs its indicators again on every new candle. | A script that passes its run time stops with "script exceeded its time budget". ## Output When a run passes one of these caps, Darvas draws the first plots, hlines, fills and inputs and the newest drawings and colored bars. It writes a warning to the editor's **Logs**, such as "only 5000 of 6120 drawings are drawn". | Output | Cap | | - | - | | Plots | 64 | | `hline()` | 64 | | `fill()` | 64 | | Drawings: labels, lines, boxes, linefills, polylines and tables | 5,000. A `plotshape()`, `plotchar()`, `plotcandle()` or table counts once, however many bars it marks. | | `bgcolor()` bars | 20,000 for all `bgcolor()` calls together | | `barcolor()` bars | 20,000 for all `barcolor()` calls together | | Inputs | 1,000 | ## Logs | Limit | Value | | - | - | | Log lines | The newest 1,000, each up to 1,000 characters | | Runner warnings | 50 | Only runs in the editor keep logs. ## Indicators and the assistant | Limit | Value | | - | - | | Indicator name | 64 characters, unique in your account | | Description | 280 characters | | Versions kept | The newest 50 | | Drafts in the browser | 25 | | Assistant requests | 60 an hour | | Active indicator alerts | 1 on Darvas Free, 5 on Darvas Pro, 20 on Darvas Pro+ | # Pine Script Quickstart: Build Your First Chart Source: https://docs.darvas.app/pine-script/quickstart Add an EMA crossover Pine Script indicator to a Darvas chart, configure inputs and save your script in four steps inside the built-in code editor. In this quickstart you add a moving average crossover indicator to a chart, save it and change one of its inputs. ## 1. Open the indicator editor * **Desktop:** in `/terminal`, choose **Indicators** in the rail on the right of the chart. If your account has Darvas V3, open the V3 panel and switch it to **Custom indicator**. * **Mobile:** open the indicator menu, choose the **Custom** category and tap **New custom indicator**. The editor opens with two tabs, **Darvas** and **Code**. ## 2. Paste the script Open the **Code** tab, replace the template with this script, and choose **Add to chart**. ```pine theme={null} //@version=6 indicator("EMA cross", overlay=true) fastLen = input.int(9, "Fast length", minval=1) slowLen = input.int(21, "Slow length", minval=1) fast = ta.ema(close, fastLen) slow = ta.ema(close, slowLen) plot(fast, "Fast", color=color.teal) plot(slow, "Slow", color=color.orange) plotshape(ta.crossover(fast, slow), "Buy", shape.triangleup, location.belowbar, color.green) plotshape(ta.crossunder(fast, slow), "Sell", shape.triangledown, location.abovebar, color.red) ``` The chart shows two moving averages on the price, a green triangle under each bar where the fast one crosses above the slow one, and a red triangle above each bar where it crosses below. The button now reads **Update chart**. If the script has an error, the editor marks the line and shows the message. Messages from `log.info()` and runner warnings are in **Logs** under the editor. ## 3. Save the indicator Choose **Save** and give the indicator a name. An indicator you do not save is removed when you close Darvas. A saved indicator is in the **Custom** category of the indicator menu, and you can add it to any chart and timeframe. Each change to its code is a new version that you can go back to. ## 4. Change an input Open the menu in the editor header and choose **Inputs**, or use the settings button of the indicator in the chart legend. Set **Fast length** to 5 and save. The fast average and the triangles move. ## Next steps > [card] [Write it with Darvas](/pine-script/ai-assistant) > > Describe the indicator in your own words. > [card] [Set an alert](/pine-script/alerts) > > Get a notification on each new buy or sell triangle. > [card] [Pine Script support](/pine-script/support) > > What Darvas draws and what it does not run. > [card] [The indicator editor](/pine-script/editor) > > Every part of the editor. # Pine Script request.security & Financial Data Source: https://docs.darvas.app/pine-script/request-security Pull multi-timeframe symbols with request.security() and access US company financials, earnings, dividends, splits and macro data in Pine Script. ## Another timeframe or symbol `request.security()` reads another timeframe of the chart's symbol, or another symbol that Darvas lists, such as a crypto pair. ```pine theme={null} //@version=6 indicator("Daily close on intraday", overlay=true) dailyClose = request.security(syminfo.tickerid, "D", close) plot(dailyClose, "Daily close", color=color.orange) ``` * `syminfo.tickerid` and the chart's own pair read the chart's market. * Another symbol is matched against the markets Darvas lists. A ticker matches without separators, so `ETHUSDT` finds `ETH-USDT`. The `.P` suffix asks for the perpetual. Without it, spot comes first. * An exchange prefix, such as `OKX:` in `OKX:ETHUSDT`, picks the exchange that Darvas reads first, when your account can chart that exchange. The chart's exchange comes next. A prefix of an exchange that Darvas does not list, such as `KUCOIN:`, stops the script with "`KUCOIN` in `KUCOIN:BTCUSD` is not an exchange on Darvas". * A symbol Darvas does not list, such as `DXY` or `SPY`, stops the script with "`DXY` is not available on Darvas". * Timeframes can be seconds, minutes, `D`, `W` and `M`, including non-standard ones such as `3D`. An unsupported timeframe stops the script with an error that names it. * A series covers the chart back to its first bar. A lower timeframe reads up to 5,000 bars, so on long charts the oldest bars can read `na`. A higher timeframe reads at least 500 of its own bars. * One run makes at most 12 data reads. Each distinct `request.*()` series counts as one read, and so does `indicator(timeframe=...)`. ## Run the whole script on another timeframe `indicator(timeframe="D")` runs the script on that timeframe of the chart's symbol and places the values on the chart's bars, as on TradingView. * Write the timeframe as a string literal. * `timeframe_gaps` works as on TradingView. Gaps are on by default. * Labels, lines, boxes, tables, polylines and linefills cannot be combined with `timeframe=`. A script that draws them fails with an error. ## US company data These calls read US companies' SEC filings. Each value appears on the day its filing was public. A later restatement changes the value from its own filing day, and earlier bars keep what was filed. | Call | What it returns | | - | - | | `request.financial(symbol, id, period)` | A reported value for `period` `FQ`, `FY` or `TTM`. | | `request.earnings(symbol, earnings.actual)` | Each quarter's diluted EPS, from its first filing. | | `request.dividends(symbol, dividends.gross)` | The cash dividend per share as paid, from its ex-date. Later splits do not adjust it. | | `request.splits(symbol, splits.numerator)` | A split's ratio from its first session. `splits.denominator` gives the other side. | The `request.financial` ids are `TOTAL_REVENUE`, `GROSS_PROFIT`, `OPER_INCOME`, `NET_INCOME`, `EBITDA`, `EARNINGS_PER_SHARE_BASIC`, `EARNINGS_PER_SHARE_DILUTED`, `DPS_COMMON_STOCK_PRIM_ISSUE`, `TOTAL_ASSETS`, `TOTAL_DEBT`, `TOTAL_EQUITY`, `CASH_N_EQUIVALENTS`, `TOTAL_SHARES_OUTSTANDING`, `DILUTED_SHARES_OUTSTANDING`, `CASH_F_OPERATING_ACTIVITIES`, `CAPITAL_EXPENDITURES`, `FREE_CASH_FLOW`, `BOOK_VALUE_PER_SHARE`, `GROSS_MARGIN` and `RETURN_ON_EQUITY`. `GROSS_MARGIN` and `RETURN_ON_EQUITY` are percentages. The symbol is an SEC ticker, with or without a US exchange prefix, such as `NASDAQ:AAPL` or `NYSE:BRK.B`. On an OKX stock swap or a Bybit xStocks chart, `syminfo.tickerid` names the stock that the market tracks. Any other symbol stops the script with "is not a US company on Darvas". ```pine theme={null} //@version=6 indicator("P/E", overlay=false) eps = request.financial(syminfo.tickerid, "EARNINGS_PER_SHARE_DILUTED", "TTM", ignore_invalid_symbol=true) plot(close / eps, "P/E") ``` > [!NOTE] > > An xStocks close is the price of one token, and one token may not equal one share. A ratio such as P/E then needs the token's share ratio. ## US economic data `request.economic("US", field)` reads these fields, each from the day it was published: | Field | Series | | - | - | | `GDPQQ` | Real GDP growth, each quarter | | `IRYY` | Inflation rate: CPI change over 12 months | | `CIR` | Core inflation rate: core CPI change over 12 months | | `CPI` | Consumer price index, not seasonally adjusted | | `CCPI` | Core consumer price index, not seasonally adjusted | | `PCEPI` | PCE price index | | `CPCEPI` | Core PCE price index | | `UR` | Unemployment rate | | `NFP` | Non-farm payrolls: the change from the month before | | `LFPR` | Labor force participation rate | | `EMR` | Employment rate: the employment to population ratio | | `AWH` | Average weekly hours | | `INTR` | Interest rate: the midpoint of the federal funds target range. TradingView shows the upper bound. | ## Values that read na * `earnings.estimate`, `earnings.standardized`, `dividends.net`, the period `FH`, the `currency` argument, other countries and other economic fields read `na`. * With `ignore_invalid_symbol=true`, `request.financial`, `request.earnings`, `request.dividends` and `request.splits` read `na` for a symbol Darvas cannot serve, such as a crypto pair, instead of stopping the script. * `request.economic` reads `na` when Darvas cannot serve the field. * With `barmerge.gaps_on`, a value shows only on the bar where it changed. Without it, the value holds on every later bar. # Publish & Share Private Pine Script Indicators Source: https://docs.darvas.app/pine-script/sharing Publish custom Pine Script indicators publicly or behind a password, protect source code visibility and install community scripts on Darvas charts. You can share a saved Pine Script indicator. A draft cannot be shared, so save it first. ## Publish an indicator 1. Open the indicator in the editor and choose **Share** in the header. 2. The first time you share, choose a username. Your indicators are listed under it, and the name on your account is never shown. A username has 3 to 20 characters: letters a to z, digits, underscores and dots. It cannot start or end with a dot or have two dots in a row. You cannot change it later. 3. Under **Who can use it**, choose one option: * **Private**. Only you can use it. * **Public**. Anyone on Darvas can add it. It is listed under **Community indicators**. * **Invite only**. Only people who know the password can add it. The password has at least 10 characters. 4. Choose whether to **Hide the code**. See [Hidden code](#hidden-code). 5. Choose **Publish**. After you publish, Darvas shows a link to the indicator. Copy it and send it with the password to the people you choose. The link opens the indicator in Darvas, and adding an invite-only indicator still needs the password. ## What the people who add it get * They run your newest version. When you save a change, their charts use it. * They can change their own input values. They cannot change the code. * If the code is shared, they can read it. ## Hidden code With **Hide the code**, other users never see the code. The indicator runs on Darvas servers, and only its results reach their charts. Logs and error details stay with you. When it fails on their chart, they see "The indicator failed on this chart". You choose this at the first publication, and you cannot change it afterwards. ## Change the password Enter a new password in the sharing settings. People who added the indicator before stay on the version that was current at the change, until they enter the new password. Leave the field empty to keep the current password. ## Stop sharing Choose **Private**, then **Make private**. Everyone who added the indicator loses it, and their chart says the author stopped sharing it. Deleting the indicator removes it for them too. ## Add an indicator from the community 1. Open the editor menu and choose **Community indicators**. The list shows what Darvas users published, the most added and favourited first. Search it by name. 2. Choose **Add**. For an invite-only indicator, enter the password and choose **Unlock**. The indicator then appears with your custom indicators. Each row shows the author, how many users added it, when it last changed, and whether its code is hidden or invite only. The favourite button marks an indicator as a favourite, and the code button opens code that the author shares, read only. Wrong passwords are limited. After too many attempts, wait and try again later. # Pine Script v5 & v6 Language Support Matrix Source: https://docs.darvas.app/pine-script/support Review every Pine Script v5 and v6 declaration, plot, drawing, strategy function and input Darvas supports, plus key differences from TradingView. Darvas runs Pine Script with [PineTS](https://github.com/LuxAlgo/PineTS), an open-source Pine runtime, and draws the result the way TradingView draws it. This page lists what that covers. ## Versions | Script | What Darvas does | | - | - | | `//@version=6` or `//@version=5` | Runs the script as written. | | `//@version=1` to `//@version=4` | Rewrites the script to v5, then runs it. The rewrite changes namespaces, typed `input()` calls, `transp`, `iff()` and v3 color and style names, and keeps line numbers. The editor shows a note with the original version. | | No `//@version` line, with `study(` | Reads the script as v1 and rewrites it. | A rewrite is syntactic. Where a language rule changed between versions, compare the result with TradingView. ## Declarations | Declaration | Support | | - | - | | `indicator()` | Runs. | | `study()` | Runs as `indicator()`. `resolution=` becomes `timeframe=`. | | `strategy()` | Runs. See [Strategies](#strategies). | | `library()` and `import` | Refused with "Pine libraries are not supported yet". | A script without an `indicator()` or `strategy()` declaration fails with an error. ## What the chart draws * `plot()` with the styles `line`, `linebr`, `stepline`, `stepline_diamond`, `steplinebr`, `histogram`, `columns`, `area`, `areabr`, `circles` and `cross`, and the options `offset`, `show_last`, `trackprice`, `histbase`, `join`, `linestyle`, `format`, `precision`, `display` and `force_overlay`. * `hline()`, `fill()` between plots or hlines, including gradient fills, `bgcolor()` and `barcolor()`. * `plotshape()`, `plotchar()`, `plotarrow()`, `plotcandle()` and `plotbar()`. * `label`, `line`, `box`, `linefill`, `polyline` and `table` drawings, with text, tooltips, arrows and `extend`. * `display.none` hides a plot. `scale.left` and `scale.none` place the script on the left scale or on an unlabeled scale of its own. A `plotchar()` with an empty character, a drawing with an `na` coordinate or color, a polyline with fewer than two points and an empty table draw nothing. When a run passes one of the [output caps](/pine-script/limits), Darvas leaves the extra items out and writes a warning to the editor's **Logs**. ## Strategies A `strategy()` script runs, and Darvas places no orders. * Simulated orders are arrows on the price chart, under the bar for a buy and over it for a sell. Blue marks a long entry, red a short entry and purple an exit. Each arrow shows the order id and the signed size, such as "Long +1". * **Backtest** in the chart legend shows the net profit, closed and open trades, win rate, profit factor and max drawdown of the closed trades. * Darvas does not show the Strategy Tester's other figures or its trade list. * Strategy order alerts do not exist on Darvas, so `{{strategy.*}}` placeholders stay as written. ## Inputs The inputs dialog has a field for each of these `input.*()` types. | Type | Field | | - | - | | `input.int`, `input.float`, `input.price` | Number | | `input.bool` | Switch | | `input.color` | Color picker with an opacity field | | `input.source`, `input.enum`, any input with `options` | List | | `input.string` | Text | | `input.text_area` | Multiline text | | `input.time` | Date and time, in your local time | | `input.timeframe` | List of Darvas timeframes and the chart's own | | `input.session` | Session text, checked as `HHMM-HHMM` with optional weekdays | | `input.symbol` | Text with suggestions from the chart's exchange | Darvas applies these input options: * `minval` and `maxval` limit the value. * `step` sets the step of the number field. * `group` puts inputs under a heading, and inputs that share an `inline` id sit on one row. * `tooltip` adds an info button next to the input name. * `confirm=true` opens the dialog when you add the indicator to a chart. Closing the dialog keeps the defaults. * The dialog lists every input whatever its `display` says. A value that no longer fits the script, such as an input the script removed, is skipped and does not fail the run. ## Logs `log.info()`, `log.warning()` and `log.error()` write to **Logs** in the editor, with the bar each line came from. Only runs in the editor keep logs. Saved runs, alerts and community indicators keep none. ## Not supported | Feature | What happens | | - | - | | `library()` and `import` | The script fails with "Pine libraries are not supported yet". | | `ticker.renko`, `ticker.kagi`, `ticker.linebreak`, `ticker.pointfigure` | The script fails with a message that names the call. `ticker.heikinashi` works. | | A variable named `range`, or `ta.sum` | The script fails, as it does on TradingView. Use `math.sum` instead of `ta.sum`. | | The session `2400-0700` | Refused by the runtime. | | A symbol Darvas does not list | `request.security()` stops the script. See [Other symbols and data](/pine-script/request-security). | ## Known differences from TradingView * `x == (y == z)` loses its parentheses, so `barstate.isfirst == (bar_index == 0)` is false. * `ta.supertrend` gives `na` as the direction on its warm-up bars, where TradingView gives 1. # Cross-Venue Prediction Market Arbitrage API Source: https://docs.darvas.app/prediction-markets/arbitrage openapi.yaml GET /prediction-markets/arbitrage Detect live YES/NO pricing discrepancies and cross-venue arbitrage spreads on matched binary contracts between Polymarket and Kalshi via API. ## Overview This endpoint compares active binary contracts on Polymarket and Kalshi, matches pairs by normalized question-token overlap, and returns complementary YES and NO combinations whose `combined_cost` falls below `1.00`. Opportunities return in `arbitrage_opportunities`, ranked from highest gross `edge_percent` downward. | Coverage | Details | | - | - | | Venues compared | Live active contracts from `polymarket` and `kalshi` (30-second cache) | | Matching threshold | `min_similarity` Jaccard token similarity from `0` to `1` (default `0.5`) | | Edge floor | `min_edge_pct` minimum gross edge percentage from `0` to `99` (default `0.5`) | | Liquidity floor | `min_liquidity` minimum USD liquidity required on the smaller leg (default `0`) | | Row limit | `limit` from `1` to `100` opportunities (default `50`), sorted descending by `edge_percent` | | MCP tool | `scan_prediction_market_arbitrage` on the [data API MCP server](/mcp-server) | ## Matching math and verification caveats Understanding how the scanner pairs contracts helps avoid false positives from similar wording with different resolution rules. * **Question token matching.** Each contract's `question` is lowercased, stripped of punctuation, filtered to tokens of three or more characters excluding common stopwords, and scored with Jaccard similarity (`intersection / union`). Raise `min_similarity` (for example `0.65` or `0.75`) to require tighter textual overlap. * **Combined cost and gross edge.** For every matched pair, Darvas checks both cross-venue directions (`polymarket YES + kalshi NO` and `kalshi YES + polymarket NO`), selects the cheaper `combined_cost`, sets `buy_yes_venue`, `buy_yes_price`, `buy_no_venue`, and `buy_no_price`, and computes `edge_percent = (1 - combined_cost) * 100`. * **Liquidity and resolution checks.** `min_liquidity` equals the smaller of the two venues' reported liquidity values. Gross `edge_percent` does not deduct exchange trading fees, settlement fees, or order-book slippage. Always inspect `polymarket_question`, `kalshi_question`, `polymarket_url`, and `kalshi_url` to confirm both venues share the same resolution source and cutoff date. * **Related endpoints.** Inspect full order-book quotes, spreads, and resolution dates on [`/prediction-markets`](/prediction-markets/markets). Check underlying rate or crypto prices with [`/macro/interest-rates`](/macro/interest-rates) and [`/crypto/prices`](/crypto/prices). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/prediction-markets/arbitrage", headers=headers, params={ "min_similarity": 0.6, "min_edge_pct": 1.0, "min_liquidity": 5000, "limit": 20, }, ).json() for opp in resp["arbitrage_opportunities"]: print(f'{opp["edge_percent"]}% edge (cost {opp["combined_cost"]}, sim {opp["similarity"]})') print(" YES:", opp["buy_yes_venue"], opp["buy_yes_price"], "| NO:", opp["buy_no_venue"], opp["buy_no_price"]) print(" Polymarket:", opp["polymarket_question"], opp["polymarket_url"]) print(" Kalshi:", opp["kalshi_question"], opp["kalshi_url"]) ``` ```bash theme={null} # Scan Polymarket and Kalshi spreads with at least 0.65 question similarity and $1,000 min leg liquidity curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prediction-markets/arbitrage?min_similarity=0.65&min_edge_pct=0.5&min_liquidity=1000&limit=25" ``` # FOMC & CPI Market-Implied Odds API Source: https://docs.darvas.app/prediction-markets/macro-odds openapi.yaml GET /prediction-markets/macro-odds See what Kalshi and Polymarket price for the next FOMC decisions, the Fed funds rate, CPI, payrolls, unemployment, GDP and a recession, normalized to 100. ## Overview This endpoint reads what Kalshi and Polymarket traders price for US macro events: the next FOMC decisions, the Fed funds rate, the number of rate cuts, CPI and core CPI, payrolls, unemployment, GDP and a US recession. Exclusive outcomes are normalized to sum to 100, a ladder of above-strike contracts gets its implied median, and each FOMC meeting gets hike, hold and cut odds. `fed_consensus` combines both venues for each meeting. | Coverage | Details | | - | - | | Indicators | `fed_decision`, `fed_rate`, `rate_cuts`, `cpi_mom`, `core_cpi_mom`, `cpi_yoy`, `payrolls`, `unemployment`, `gdp`, `recession` | | Venues | `kalshi`, `polymarket` or `all` | | Events | 1 to 6 upcoming events per indicator and venue; 3 by default | | MCP tool | `list_prediction_macro_odds` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/prediction-markets/macro-odds", headers=headers, params={ "indicator": "fed_decision", "events": 2, }, ).json() for event in answer["macro_odds"]: print(event["indicator"], event["venue"], event["title"], event["most_likely"]) print(answer["fed_consensus"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prediction-markets/macro-odds?indicator=fed_decision&events=2" ``` # Prediction Market Detail API: Odds & Rules Source: https://docs.darvas.app/prediction-markets/market-detail openapi.yaml GET /prediction-markets/markets/{id} Get one Polymarket or Kalshi market: resolution rules, every outcome's price, its event's outcomes, spread, volume, open interest and probability history. ## Overview This endpoint returns one Polymarket or Kalshi market by its id: the resolution rules and sources, every outcome's price, the other outcomes of its event, the best bid and ask with the spread in basis points of the \$1 payout, volume, open interest, the taker fee rate and the probability history over the chosen window. The id is a Polymarket market id, condition id or slug, or a Kalshi market ticker, as [`/prediction-markets`](/prediction-markets/markets) lists them. | Coverage | Details | | - | - | | Venues | `polymarket` and `kalshi` | | History | `none`, `1d`, `1w` (default), `1m` or `max` | | Prices | Probabilities from 0 to 1 and in percent | | MCP tool | `get_prediction_market` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/prediction-markets/markets/KXRECSSNBER-27", headers=headers, params={ "history": "1m", }, ).json() print(answer["market"]) print(len(answer["price_history"]["points"]), "points") ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prediction-markets/markets/KXRECSSNBER-27?history=1m" ``` # Prediction Markets API: Polymarket, Kalshi, OKX Source: https://docs.darvas.app/prediction-markets/markets openapi.yaml GET /prediction-markets Query live prediction market contracts, YES/NO implied probabilities, volume, liquidity and resolution dates across Polymarket, Kalshi and OKX. ## Overview This endpoint normalizes active binary event contracts across Polymarket, Kalshi, and OKX Event Contracts onto one schema: YES and NO prices from `0` to `1`, implied probability from `0` to `100`, top-of-book bid, ask, and spread, 24-hour and cumulative volume, liquidity, resolution date, and direct venue URL. | Coverage | Details | | - | - | | Venues | `venue` accepts `all` (default), `polymarket`, `kalshi`, or `okx` | | Search and filters | `query` (case-insensitive substring on `question` or `ticker`), `category` (substring such as `Economics`, `Politics`, or `Crypto`), and `min_volume` (minimum 24-hour volume, default `0`) | | Sorting | `sort` descending by `volume_24h` (default), `volume_total`, `liquidity`, or `probability` | | Row limit | `limit` from `1` to `200` contracts (default `50`) | | Freshness | Active open contracts cached for 30 seconds (up to 200 active markets on Polymarket and Kalshi; live contracts across up to 12 OKX event series) | | MCP tool | `list_prediction_markets` on the [data API MCP server](/mcp-server) | ## Normalization across venues Each venue publishes different units and field shapes. Darvas normalizes every active contract before filtering and sorting. * **Prices and implied probability.** Kalshi cent quotes and OKX percentage quotes are scaled to match Polymarket's `0` to `1` dollar price scale. `implied_probability` equals `yes_price * 100` rounded to two decimal places. Contracts priced at `0` or `1` (settled or degenerate markets) are excluded. * **Order book, liquidity and open interest.** `best_bid`, `best_ask`, and `spread` (`best_ask - best_bid`) use the `0` to `1` scale and return `null` when top-of-book quotes are unavailable (including OKX Event Contracts). `open_interest` is populated where reported by the venue (Kalshi) and `null` otherwise. On OKX, `volume_total` mirrors `volume_24h` and `liquidity` is `0`. * **Venue availability.** When `venue=all`, if one venue feed fails to answer, Darvas returns live contracts from the venues that succeeded. The endpoint answers `503` only when every requested venue feed is unavailable. * **Related endpoints.** Discover OKX event series with settlement rules plus active Polymarket and Kalshi category counts at [`/prediction-markets/series`](/prediction-markets/series). Scan matched Polymarket and Kalshi contracts for cross-venue pricing spreads with [`/prediction-markets/arbitrage`](/prediction-markets/arbitrage). Pair macro event odds with [`/macro/interest-rates`](/macro/interest-rates), [`/macro/inflation`](/macro/cpi-pce-inflation), and federal agency releases at [`/news`](/stocks/financial-news). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/prediction-markets", headers=headers, params={"venue": "all", "query": "BTC", "min_volume": 1000, "sort": "volume_24h", "limit": 10}, ).json() for m in resp["prediction_markets"]: print(m["venue"], f'{m["implied_probability"]}%', "spread:", m["spread"], "24h vol:", m["volume_24h"], m["question"]) ``` ```bash theme={null} # Active OKX Event Contracts ranked by 24-hour volume curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prediction-markets?venue=okx&sort=volume_24h&limit=20" ``` # Prediction Market Order Book API Source: https://docs.darvas.app/prediction-markets/order-book openapi.yaml GET /prediction-markets/orderbook Read the live order book of a Polymarket or Kalshi outcome, best price first, with USD notional per level, the spread and depth within 1, 5 and 10 cents. ## Overview This endpoint returns the live book of one outcome of a Polymarket or Kalshi market, best price first, with each level's dollar notional and running total. The answer adds the best bid and ask, the implied probability, the spread in basis points of the \$1 payout, and the dollars resting within 1, 5 and 10 cents of the best bid and ask. Ask for the YES side (default) or the NO side, up to 100 levels a side. | Coverage | Details | | - | - | | Venues | `polymarket` and `kalshi` | | Sides | `yes` (default) or `no` | | Depth | 1 to 100 levels a side; 20 by default | | MCP tool | `get_prediction_market_order_book` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/prediction-markets/orderbook", headers=headers, params={ "market_id": "KXRECSSNBER-27", "depth": 20, }, ).json() print(answer["question"], answer["best_bid"], answer["best_ask"], answer["spread_bps"]) print(answer["bid_depth"], answer["ask_depth"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prediction-markets/orderbook?market_id=KXRECSSNBER-27&depth=20" ``` # Prediction Market Event Series & Categories Source: https://docs.darvas.app/prediction-markets/series openapi.yaml GET /prediction-markets/series Discover recurring prediction market event series, settlement rules and active category groups across Polymarket, Kalshi and OKX Event Contracts. ## Overview This endpoint discovers event contract series and category groups across OKX Event Contracts, Polymarket, and Kalshi in one `series` list. Use it to inspect recurring OKX event series with their settlement rules and underlying indices, or to discover active category counts on Polymarket and Kalshi before querying individual contracts. | Coverage | Details | | - | - | | Venues | `venue` accepts `all` (default), `okx`, `polymarket`, or `kalshi` | | Filters | Optional case-insensitive `category` (such as `Crypto`, `Economics`, `Politics`) and `query` (matches `title`, `series_id`, or `underlying`) | | Row limit | `limit` from `1` to `200` series entries (default `100`) | | Availability | With `venue=all`, partial venue failures still return series from reachable venues; `503` returns only if all requested venues fail | | MCP tool | `list_prediction_market_series` on the [data API MCP server](/mcp-server) | ## Native OKX series versus venue category groups Every row in `series` uses the same ten-field schema, with venue-specific fields set to `null` where the venue does not publish them. * **OKX Event Contracts (`venue: "okx"`).** Entries come from OKX's live event series catalog and populate `series_id` (such as `BTC_USD_DAILY`), `title`, `category`, `frequency` (recurrence cadence such as `daily` or `weekly`), `underlying` (reference asset or index such as `BTC-USD`), `settlement_method`, `settlement_source`, and `close_early` (whether contracts can settle before expiry). `market_count` is `null`. * **Polymarket and Kalshi (`venue: "polymarket"` or `"kalshi"`).** Entries aggregate currently active contracts by category (using the 30-second market cache), sorted by `market_count` descending then category name. `series_id` uses `:` (such as `polymarket:economics`), `market_count` holds the active contract count, and OKX-specific settlement fields (`frequency`, `underlying`, `settlement_method`, `settlement_source`, `close_early`) return `null`. * **Related endpoints.** Read live YES/NO prices, spreads, and probabilities for contracts in these series at [`/prediction-markets`](/prediction-markets/markets). Scan cross-venue Polymarket and Kalshi spreads at [`/prediction-markets/arbitrage`](/prediction-markets/arbitrage). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/prediction-markets/series", headers=headers, params={"venue": "okx", "query": "BTC", "limit": 20}, ).json() for item in resp["series"]: print(item["series_id"], item["title"], "freq:", item["frequency"], "underlying:", item["underlying"], "source:", item["settlement_source"]) ``` ```bash theme={null} # Discover active prediction market series and categories across all three venues curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prediction-markets/series?venue=all&category=Crypto&limit=50" ``` # Darvas Pro+ Trading Alerts & Account Webhooks Source: https://docs.darvas.app/pro/webhooks Receive signed HTTPS webhooks when price or indicator alarms fire, scheduled AI jobs run, economic releases land, ETF flows update or connections drop. A Darvas Pro+ webhook sends a signed POST to your HTTPS endpoint each time an event it subscribes to happens. Darvas sends an event as soon as it stores the event, usually within a second. ## Plans Webhooks are part of Darvas Pro+. A Pro+ account can have 15 webhooks on at once. A webhook that is off does not count toward the 15. Darvas Free and Darvas Pro, including Pro through an OKX account opened with Darvas, have no webhooks. When Pro+ ends, your webhooks stop receiving new events and show **Paused by plan**. You can still read their deliveries and delete them. When Pro+ comes back, they turn on again, oldest first, up to the plan's limit. A webhook you turned off stays off. ## Add a webhook Add a webhook in your Darvas settings: 1. Open **Settings** and choose **Webhooks**. 2. Select **Add webhook**. 3. Give the webhook a **Name** of up to 100 characters, if you like. Without one, the list shows the host of its URL. 4. Enter the **Endpoint URL**, a public `https://` address. 5. Under **Events**, tick a whole group, such as **Alarms**, or single event types. 6. Select **Add webhook**, then **Copy secret** to copy the signing secret, `whsec_...`. Darvas shows the signing secret only once, when you add the webhook. Store it with your server before you select **I saved my secret**. You need it to verify each delivery. Each webhook in the list shows **On**, **Off** or **Paused by plan**, the number of failed deliveries in a row, and these buttons: | Button | What it does | | - | - | | **Turn off**, **Turn on** | Stops or starts the webhook's deliveries. Turning a webhook on sets its failure count to 0. | | **Send test** | Sends a test event to a webhook that is on. | | **Deliveries** | Shows the webhook's last 25 deliveries. | | **Edit** | Changes the name, the URL or the events. The signing secret stays the same. | | **Delete** | Deletes the webhook and its delivery history. | A test event has `livemode: false`, the type of the webhook's first event and this object: ```json theme={null} { "test": true, "message": "A test event from Darvas" } ``` Each webhook gets one test event a minute. **Deliveries** lists each delivery with its event type, its status (**Delivered**, **Pending** or **Failed**), the HTTP status your endpoint answered, or **No answer**, and the number of attempts. **Refresh** reads the list again. ## Events A webhook receives only the types you choose. An event of your account, such as an alarm's fire, goes only to your own webhooks. ETF flow updates and data events go to every webhook that subscribes to them. | Group | Type | Sent when | | - | - | - | | Alarms | `alarm.price.triggered` | A price alarm fires. When several of your price alarms fire together, each alarm sends its own event. | | Alarms | `alarm.condition.triggered` | An indicator condition alarm fires. | | Alarms | `alarm.custom_indicator.triggered` | An [alert on a custom indicator](/pine-script/alerts) fires on a mark, an `alertcondition()` or an `alert()` call. | | Alarms | `alarm.footprint.triggered` | A footprint pattern alarm fires. | | Alarms | `alarm.paused` | Darvas pauses one of your alarms or scheduled tasks. | | Schedules | `schedule.completed` | A scheduled task answers. | | Schedules | `schedule.skipped` | A scheduled task skips a run, because another of your scheduled runs or a Darvas chat was still going. | | Economic calendar | `economic_calendar.reminder` | 30 minutes before a release that you set an alert on. | | Economic calendar | `economic_calendar.released` | The actual value of a release that you set an alert on comes out. | | Market and account | `etf_flows.updated` | Darvas stores a day of BTC or ETH ETF flows, or a new net flow for a day it stored before. | | Market and account | `venue.connection_ended` | A connection to OKX, Binance, Bybit, cTrader or a partner broker ends without you disconnecting it. | | Data | The 20 [data API events](/webhooks#events) | New earnings, financial statements, insider forms, filing items or macro releases arrive. | `venue.connection_ended` counts only connections that end after you add your first webhook with this type, so a new webhook gets no old ends. ### Alarm objects Every alarm event has these fields in `data.object`: | Field | Type | Meaning | | - | - | - | | `trigger_id` | string | The alarm's id. | | `symbol` | string | The market, such as `BTC-USDT-SWAP`. | | `exchange` | string | The exchange, such as `okx`. | | `market_type` | string or null | `spot`, `swap` or another market type. | | `price` | string or null | The last price the check saw, or null when it had none. | | `fired_at` | string | When the alarm fired, as an ISO 8601 time. | Each alarm type adds its own fields: | Type | Added fields | | - | - | | `alarm.price.triggered` | `op` (`GTE`, `LTE`, `CROSS_UP` or `CROSS_DOWN`), `threshold` and `note`, the note you wrote or null | | `alarm.condition.triggered` | `timeframe`, the bar of the condition or null for a condition on several bars, and `summary` | | `alarm.custom_indicator.triggered` | `indicator_id`, `indicator_name`, `timeframe`, `signal` (`ANY`, `BUY` or `SELL`), `alert`, `message` and `bar_time`, the bar's time in Unix seconds or null | | `alarm.footprint.triggered` | `timeframe`, `patterns`, `side` (`ANY`, `BUY` or `SELL`), `summary` and `bar_time` | In `alarm.custom_indicator.triggered`, `alert` is the `alertcondition()` title that fired, `alert` for an `alert()` call, or null for a mark. ### Other objects | Type | Fields | | - | - | | `alarm.paused` | `trigger_id`, `kind` (`price`, `condition`, `custom_indicator`, `footprint` or `schedule`), `reason`, `summary` (the notice you got, or null) and `paused_at` | | `schedule.completed` | `trigger_id`, `task`, `conversation_id`, `message_id`, `response`, `response_truncated` and `completed_at`. `response` holds at most 16,000 characters of the answer. | | `schedule.skipped` | `trigger_id`, `task`, `reason` (`busy`), `waited_minutes`, `next_run_at` and `skipped_at` | | `economic_calendar.reminder` | `event_id`, `title`, `currency`, `country`, `impact`, `scheduled_at`, `forecast`, `previous` and `lead_minutes` | | `economic_calendar.released` | The reminder's fields without `lead_minutes`, and `actual` | | `etf_flows.updated` | `asset` (`BTC` or `ETH`), `date` (`YYYY-MM-DD`), `net_flow_usd`, `funds` (each with `ticker` and `net_flow_usd`) and `updated_at` | | `venue.connection_ended` | `venue` (`okx`, `ctrader`, `binance`, `bybit` or `partner`), `name`, `broker` (the partner broker's slug, or null), `reason` and `ended_at` | The `reason` of `venue.connection_ended` is `expired` when the access ran out, and `ended` when it was revoked or the venue refused the key. The `reason` of `alarm.paused` is one of these: | Reason | Why the alarm paused | | - | - | | `custom_indicator_unavailable` | You no longer have the alarm's custom indicator. | | `custom_indicator_script_error` | The indicator's script failed on several closes in a row. | | `custom_indicator_script_too_slow` | The script ran past its time or memory limit on several closes in a row. | | `footprint_data_unavailable` | No footprint data arrived for several closes in a row. | | `plan_limit_reached` | Your plan has fewer alarms of this kind than you have on. | | `upgrade_required` | Your plan does not include alarms of this kind. | | `ai_provider_missing` | A scheduled task has no ChatGPT account to answer with. | | `ai_provider_expired` | The ChatGPT sign-in of a scheduled task expired. | | `ai_usage_limit` | The ChatGPT account of a scheduled task reached its usage limit. | ## Deliveries Each delivery is a POST of this JSON envelope: ```json theme={null} { "id": "evt_3f1c0b8e9a2d4c6b8e1f0a9b7c5d3e21", "type": "alarm.price.triggered", "api_version": "2026-11-26", "livemode": true, "created": 1795867200, "data": { "object": { "trigger_id": "6f1c2f53-2b7e-4bb5-9d1e-2f6a2a3c4d5e", "symbol": "BTC-USDT-SWAP", "exchange": "okx", "market_type": "swap", "price": "97012.5", "fired_at": "2026-11-28T14:00:00.000Z", "op": "GTE", "threshold": "97000", "note": null } } } ``` `created` is the Unix time in seconds when Darvas stored the event. The request has these headers: * `Content-Type: application/json` * `User-Agent: Darvas-Webhook/1.0` * `Darvas-Signature: t=,v1=` Answer with any 2xx status within ten seconds. Do slow work after you answer, such as from a queue. Darvas does not follow redirects. Each webhook receives its events one at a time, oldest first, so a slow endpoint delays only its own events. The same event can arrive twice, and a retry can arrive after a newer event. Use `id` to skip an event you have handled. ## Verify the signature `v1` is the HMAC-SHA256 of `.` under your signing secret, in hex. Before you trust a delivery: 1. Compute the HMAC over the raw body as you received it. A body that you parsed and serialized again does not match. 2. Compare it with `v1` in constant time. 3. Refuse a `t` that is more than five minutes away from your clock. ```ts theme={null} import { createHmac, timingSafeEqual } from "node:crypto"; export function verifyDarvasSignature(secret: string, header: string, body: string): boolean { const fields = new Map(); for (const part of header.split(",")) { const at = part.indexOf("="); if (at > 0) fields.set(part.slice(0, at), part.slice(at + 1)); } const t = fields.get("t") ?? ""; if (!/^\d+$/.test(t) || Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; const expected = createHmac("sha256", secret).update(`${t}.${body}`).digest(); const given = Buffer.from(fields.get("v1") ?? "", "hex"); return given.length === expected.length && timingSafeEqual(given, expected); } export async function POST(request: Request): Promise { const body = await request.text(); const header = request.headers.get("darvas-signature") ?? ""; if (!verifyDarvasSignature(process.env.DARVAS_WEBHOOK_SECRET ?? "", header, body)) { return new Response(null, { status: 401 }); } const event = JSON.parse(body) as { id: string; type: string; data: { object: unknown } }; // Keep event.id to skip a repeat, and do slow work after this answer. return new Response(null, { status: 204 }); } ``` In Python, pass the raw body as bytes, such as `request.get_data()` in Flask: ```python theme={null} import hashlib import hmac import time def verify_darvas_signature(secret: str, header: str, body: bytes) -> bool: fields = dict(part.split("=", 1) for part in header.split(",") if "=" in part) t = fields.get("t", "") if not (t.isascii() and t.isdigit()) or abs(time.time() - int(t)) > 300: return False expected = hmac.new(secret.encode(), t.encode() + b"." + body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected.encode(), fields.get("v1", "").encode()) ``` ## Retries and failures * A delivery fails when your endpoint does not answer with a 2xx within ten seconds, or cannot be reached. * Darvas tries a failed delivery again about a minute later, and once more about ten minutes after that. After the third failed attempt, the delivery is marked dead. * After 50 failed attempts in a row, Darvas turns the webhook off. Fix your endpoint, then turn the webhook on again in settings. Turning it on sets the failure count to 0. * Darvas keeps events and their deliveries for 30 days. ## Endpoint rules Darvas refuses a URL that breaks one of these rules when you add or change a webhook: * The URL uses `https`. * The URL has no user name or password. * The host is a public name with a dot, not a name that ends in `.local`, `.internal`, `.localhost`, `.test` or `.invalid`. * An IP address host is public. Private, loopback, link-local, shared, documentation, multicast and reserved ranges are refused, for IPv4 and IPv6. * The URL has at most 2,000 characters, and the name and the URL have no control characters. At each delivery, Darvas resolves the host again. If any address of the host is not public, the delivery fails, so a name that later points to a private address receives nothing. # Financial Data API Quickstart Guide in 5 Min Source: https://docs.darvas.app/quickstart Make your first authenticated REST request to api.darvas.app/v1 in under five minutes using curl, Python or TypeScript with your dvk_ API key. > [!TIP] > > Looking for custom chart indicators? Go to the [Pine Script quickstart](/pine-script/quickstart). **1. Get an API key** Sign in to [Darvas](https://darvas.app) on an active **Darvas Pro** (`$20/mo` or `$200/yr`, or free with an active OKX affiliate account generating positive commission in the trailing 180 days), **Max** (`$100/mo`), or **Ultra** (`$200/mo`) plan. Open **Settings → Data API** and create an API key. A key starts with `dvk_` followed by 43 characters and is shown once; Darvas stores only its hash. Every successful call costs `1 credit` (up to 1,000 rows per page); empty responses, errors, FINRA `/short-volume`, and own-account MCP at `https://darvas.app/mcp` cost `0` credits. **2. Send a request** Pass the key in the `X-API-KEY` header. ```bash cURL theme={null} curl "https://api.darvas.app/v1/company/facts?ticker=AAPL" \ -H "X-API-KEY: $DARVAS_API_KEY" ``` ```python Python theme={null} import os import requests response = requests.get( "https://api.darvas.app/v1/company/facts", headers={"X-API-KEY": os.environ["DARVAS_API_KEY"]}, params={"ticker": "AAPL"}, ) print(response.json()["company_facts"]["name"]) ``` ```typescript TypeScript theme={null} const response = await fetch("https://api.darvas.app/v1/company/facts?ticker=AAPL", { headers: { "X-API-KEY": process.env.DARVAS_API_KEY ?? "" }, }); const { company_facts } = (await response.json()) as { company_facts: { name: string } }; console.log(company_facts.name); ``` The answer is JSON. A list endpoint answers one page (up to 1,000 rows per page), with a `next_page_url` while more rows remain, as [Pagination](/pagination) explains. An error answers a stable `error` code from the table in [Errors](/authentication#errors). **3. Ask from an AI agent** Add `https://api.darvas.app/mcp` to Claude Code, Codex, Cursor or VS Code with the same key, as [MCP server](/mcp-server) shows. Each successful tool call costs `1 credit`, matching REST; empty responses, errors, and metadata calls (`tools/list`, `search_data_tools`, resources, prompts) cost `0` credits. ## Next steps > [card] [Find the endpoint](/ai-agents#which-endpoint-answers-which-question) > > The endpoint and MCP tool for each kind of question. > [card] [Connect an AI agent](/mcp-server) > > Use 128 data tools in Claude Code, Codex, Cursor, VS Code or Windsurf. > [card] [Rate limits and errors](/authentication) > > Unified plans, call credits, concurrency limits and error codes. > [card] [Webhooks](/webhooks) > > A signed POST when new filings, statements or macro releases arrive. ## Client compatibility Endpoints use predictable `snake_case` JSON fields, ISO `YYYY-MM-DD` dates, and cursor pagination under `https://api.darvas.app/v1`. When Darvas adds new fields to an existing response object, they appear alongside the established fields so strict clients can read only the keys they need. # SEC Form 8-K Material Events & Disclosures API Source: https://docs.darvas.app/sec-edgar/8k-events openapi.yaml GET /filings/events Filter SEC Form 8-K material events by type, ticker or CIK, such as executive changes, acquisitions, bankruptcies and auditor changes, or the last 30 days. ## Overview An 8-K reports its events as numbered items: 5.02 for a director or officer who leaves or arrives, 2.01 for an acquisition that closes, 1.03 for a bankruptcy, 4.01 for a change of auditor. SEC lists the item numbers of every 8-K since it began numbering them in August 2004, and this endpoint names each filing's events from them. [8-K Event Types](/sec-edgar/8k-event-types) lists the types with their items. **MCP tool:** `list_filing_events` on the [data API MCP server](/mcp-server). Without `ticker`, `cik` or a `filing_date` filter, the answer covers the last 30 days of every company, newest first. `type` keeps the filings that report one of the types named. Each row links the filing on sec.gov and the [/filings/items](/sec-edgar/filing-items) request that answers the items' text. ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/filings/events" changes = requests.get(url, headers=headers, params={"type": "executive_change,auditor_change", "limit": 50}).json() for event in changes["events"]: print(event["filing_date"], event["ticker"], event["events"]) ``` # Structured 8-K Events API: CEO, Auditor, Cyber Source: https://docs.darvas.app/sec-edgar/8k-structured-events openapi.yaml GET /events/8k-structured Read 8-K executive changes, shareholder votes, auditor changes, non-reliance notices and cyber incidents as structured fields with their source sentences. ## Overview This endpoint lists 8-Ks of every company that report one of five material events: an executive change (Item 5.02), a shareholder vote (5.07), an auditor change (4.01), non-reliance on financial statements (4.02) or a material cybersecurity incident (1.05). Each event carries fields read from the item's text, such as the person and role of an executive change, with the sentences they come from. A filing not read yet answers `extraction_status: reading`, and Darvas reads it within a minute. Without a company or `start_date`, the last 30 days. | Coverage | Details | | - | - | | Events | `executive_change`, `shareholder_vote`, `auditor_change`, `non_reliance`, `cybersecurity_incident` | | Coverage | 8-Ks of every SEC filer | | Pages | Up to 100 filings a page with `next_page_url` | | MCP tool | `list_structured_eight_k_events` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/events/8k-structured", headers=headers, params={ "category": "auditor_change", "limit": 25, }, ).json() for event in answer["events"]: print(event["filing_date"], event["ticker"], event["category"], event["details"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/events/8k-structured?category=auditor_change&limit=25" ``` # Corporate Bitcoin Treasury Holdings API Source: https://docs.darvas.app/sec-edgar/crypto-treasuries openapi.yaml GET /sec/crypto-treasuries List the bitcoin, ether and other crypto public companies hold from their 10-K and 10-Q XBRL: fair value, cost, unrealized gain and units, cited to each filing. ## Overview This endpoint lists the crypto assets public companies hold, from the us-gaap tags of FASB ASU 2023-08 in their 10-K and 10-Q XBRL: fair value, cost basis, unrealized gain and units by the asset each unit names, each value cited to its filing. Without a company, each company's latest period, largest fair value first; with a ticker or CIK, that company's history. | Coverage | Details | | - | - | | Assets | `BTC`, `ETH`, `SOL`, `XRP`, `USDC` and `USDT` | | Coverage | 10-K and 10-Q filers that tag crypto assets at fair value | | Results | Up to 50 companies or periods by default | | MCP tool | `list_crypto_treasuries` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/sec/crypto-treasuries", headers=headers, params={ "asset": "BTC", }, ).json() for period in answer["treasuries"]: print(period["ticker"], period["period_end"], period["fair_value_usd"], period["holdings"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/sec/crypto-treasuries?asset=BTC" ``` # SEC 10-K, 10-Q & 8-K Filing Sections API Source: https://docs.darvas.app/sec-edgar/filing-items openapi.yaml GET /filings/items Extract clean text for specific 10-K, 10-Q and 8-K sections such as Risk Factors, MD&A and Business overview by ticker, CIK or accession number. ## Overview A filing cut at its item headings: each item's number, its title as the filing prints it, and its text. An 8-K's exhibits, such as the press release 99.1 of an earnings 8-K, come with the items that name them; Item 9.01 lists them all. | Coverage | Details | | - | - | | Forms | 10-K (10-K405 included), 10-Q and 8-K, with their amendments by accession number | | History | Every such filing on EDGAR | | Updated | New filings within about a minute of acceptance; older ones read when a request asks for them | | MCP tool | `get_filing_items` on the [data API MCP server](/mcp-server) | A 10-K is found by `year`, a 10-Q by `year` and `quarter`: the fiscal year and quarter the filing's financial statements give, so Apple's 10-Q for the quarter ending in December 2025 is `year=2026&quarter=1`. A filing without statements uses the year and calendar quarter its period ends. An 8-K needs its `accession_number`, which `/filings` lists; an accession number also finds a 10-K or 10-Q, amendments included. Item names follow the forms: `Item-1A` for a 10-K, `Part-1,Item-2` for a 10-Q, `Item-2.02` for an 8-K. [Filing item types](/sec-edgar/filing-item-types) lists them. An 8-K filed before August 2004 uses the old numbering, such as `Item-5` for other events. ## Filings not read yet Darvas reads every new 10-K, 10-Q and 8-K as EDGAR lists it. An older filing is read when a request asks for it; the request waits up to 8 seconds, then answers `202` with a `result_url`. Poll it after `Retry-After` seconds, or send the same request again: once the filing is read, it answers at once. [Filing items requests](/sec-edgar/filing-items-requests) describes the answers. ## Errors | Status | `error` | Meaning | | - | - | - | | 400 | `FILING_TYPE_MISMATCH` | The accession number is another form; the message names it | | 400 | `FILING_COMPANY_MISMATCH` | The accession number is another company's; the message names its ticker | | 404 | `ITEMS_NOT_FOUND` | An `item` asked for is not in the filing; the message lists the items it has | | 404 | `NOT_FOUND` | No such filing, or Darvas found no items in it | ## Examples ```python theme={null} import os import time import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} def filing_items(params): response = requests.get( "https://api.darvas.app/v1/filings/items", headers=headers, params=params ) if response.status_code != 202: return response.json() result_url = response.json()["result_url"] while True: time.sleep(int(response.headers.get("Retry-After", 5))) response = requests.get(result_url, headers=headers) body = response.json() if body.get("status") != "processing": return body risks = filing_items({"ticker": "AAPL", "filing_type": "10-K", "year": 2025, "item": "Item-1A"}) print(risks["items"][0]["text"][:500]) # An earnings 8-K and its press release. release = filing_items( { "ticker": "AAPL", "filing_type": "8-K", "accession_number": "0000320193-26-000024", "include_exhibits": "true", } ) for item in release["items"]: print(item["number"], item["name"], [e["number"] for e in item.get("exhibits", [])]) ``` # Async SEC Filing Section Extraction Status API Source: https://docs.darvas.app/sec-edgar/filing-items-requests openapi.yaml GET /filings/items/requests/{request_id} Poll asynchronous SEC filing section extraction jobs returned with HTTP 202 when a requested 10-K, 10-Q or 8-K item is being parsed on demand. ## Overview A `/filings/items` request for a filing Darvas has not read yet answers `202` with a `request_id` and a `result_url`. Polling the `result_url` answers one of three bodies: **MCP tool:** `get_filing_items_request` on the [data API MCP server](/mcp-server). | `status` | Meaning | What to do | | - | - | - | | `processing` | Darvas is reading the filing | Poll again after `Retry-After` seconds | | none, the items | The filing is read | The body is the `/filings/items` answer for the first request's parameters | | `failed` | SEC EDGAR did not serve the filing, or 5 minutes passed | Send the first request again | Most filings are read within a few seconds. A request is kept for 30 days; its `result_url` then answers 404. ## Example ```python theme={null} import os import time import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} first = requests.get( "https://api.darvas.app/v1/filings/items", headers=headers, params={"ticker": "MSFT", "filing_type": "10-K", "year": 1998}, ) body = first.json() while body.get("status") == "processing": time.sleep(int(first.headers.get("Retry-After", 5))) body = requests.get(first.headers["Location"], headers=headers).json() if body.get("status") == "failed": print(body["message"]) else: print([item["number"] for item in body["items"]]) ``` # SEC EDGAR Filings API: 10-K, 10-Q, 8-K & More Source: https://docs.darvas.app/sec-edgar/filings openapi.yaml GET /filings List every SEC EDGAR filing of a company since 1994 by ticker or CIK, newest first: 10-K, 10-Q, 8-K, proxies and ownership forms, with SEC document links. ## Overview The filing list SEC keeps for a company: 10-K, 10-Q, 8-K, proxy statements, ownership forms and every other form, newest first. Each row links the primary document and the filing index on sec.gov. | Coverage | Details | | - | - | | Filings | 27 million since 1994, delisted companies included | | Updated | Within about a minute of SEC acceptance | | Page size | 100; `limit` counts across pages, up to 10,000 | | MCP tool | `list_filings` on the [data API MCP server](/mcp-server) | A filing with several parties, such as a Form 4 with its issuer and reporting owner, appears in the list of each. `items` holds the 8-K item numbers, such as `2.02` for results of operations. ## Filtering * `filing_type`: one or more forms. Repeat the parameter or separate forms with commas: `filing_type=10-K&filing_type=10-Q` or `filing_type=10-K,10-Q`. * `limit`: rows across all pages, 10 by default. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/filings" annual = requests.get(url, headers=headers, params={"ticker": "MSFT", "filing_type": "10-K", "limit": 5}).json() for filing in annual["filings"]: print(filing["filing_date"], filing["report_date"], filing["url"]) # Earnings releases are 8-Ks with item 2.02. recent = requests.get(url, headers=headers, params={"ticker": "MSFT", "filing_type": "8-K", "limit": 20}).json() print([f["filing_date"] for f in recent["filings"] if "2.02" in f["items"]]) ``` # Real-Time SEC Filings Feed API Source: https://docs.darvas.app/sec-edgar/filings-feed openapi.yaml GET /filings/feed Stream SEC filings of every company, newest first, with every party, filtered by form, 8-K item number and SEC sector, and a link to each filing's items. ## Overview This endpoint lists SEC filings of every company, newest first, one row per accession number with every party: filer, issuer, reporting owner and subject company. `forms` keeps the forms you name (SC 13D and SCHEDULE 13D find both names of a schedule), `items` keeps the 8-Ks that report one of the item numbers, and `sector` the companies an SEC office reviews. Without a company or `start_date`, the feed covers the last 30 days. Each 8-K links its item texts through `items_url`. | Coverage | Details | | - | - | | Coverage | Every form filed with SEC EDGAR | | Filters | Forms, 8-K item numbers, SEC sector, dates, ticker or CIK | | Pages | Up to 100 filings a page with `next_page_url` | | MCP tool | `list_filings_feed` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/filings/feed", headers=headers, params={ "forms": "8-K", "items": "5.02", "limit": 25, }, ).json() for filing in answer["filings"]: print(filing["accepted_at"], filing["ticker"], filing["form_type"], filing["item_codes"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/filings/feed?forms=8-K&items=5.02&limit=25" ``` # SEC Form D Private Offerings API Source: https://docs.darvas.app/sec-edgar/form-d-offerings openapi.yaml GET /filings/form-d Search SEC Form D notices of private offerings: startup rounds, venture and private equity funds, real estate and debt raises, with amounts sold and exemptions. ## Overview This endpoint lists SEC Form D notices of private offerings, newest filing first: startup funding rounds, venture and private equity fund raises, and real estate and debt offerings sold under Regulation D (Rules 504, 506(b) and 506(c)), Section 4(a)(5) or an Investment Company Act exclusion. Every Form D and D/A filed since 2008 is listed. `details_available` says whether a notice's details have been read: the amounts offered and sold, the exemptions claimed, the industry group and the related persons. Filters on those details match only notices already read. | Coverage | Details | | - | - | | Coverage | Every Form D and D/A filed since 2008 | | Filters | Issuer name, industry group or sector, state, exemption, amount sold, amendments and filing dates | | Pages | Up to 100 notices a page with `next_page_url` | | MCP tool | `list_sec_form_d_offerings` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/filings/form-d", headers=headers, params={ "industry_group": "technology", "exemption": "506c", "limit": 25, }, ).json() for offering in answer["form_d_offerings"]: print(offering["filing_date"], offering["issuer_name"], offering["form_type"], offering["details_available"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/filings/form-d?industry_group=technology&exemption=506c&limit=25" ``` # SEC EDGAR Full-Text Filing Search API Source: https://docs.darvas.app/sec-edgar/full-text-search openapi.yaml POST /search Search 10-K, 10-Q and 8-K items and 8-K press releases with a question, and get the best passages with citations and links into each SEC EDGAR filing. ## Overview Send a question; the answer is the filings that answer it, best first, each with its passages and a citation: the accession number, the day, the item or exhibit, and a link that opens the document with the passage highlighted. **MCP tool:** `search_documents` on the [data API MCP server](/mcp-server). The search reads the items of 10-K, 10-Q and 8-K filings and the press releases of 8-Ks. It matches the question's words, not their meaning: a filing that names more of them, more often, ranks first, and common words such as `what` or `the` are left out. Name the companies in `filters.identifiers` to search their filings of any year; without a company, the last two years are searched. Darvas reads every new 10-K, 10-Q and 8-K as it is filed, and older ones on request. A company in the filters with no filing read yet has its newest 10-K and 10-Q read at once; `warnings` says so, and the same search a minute later finds them. ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} body = requests.post( "https://api.darvas.app/v1/search", headers=headers, json={ "query": "What supply chain risks does Apple face?", "filters": {"identifiers": {"ticker": ["AAPL"]}, "document_types": ["10-K"]}, "limit": 3, }, ).json() for result in body["results"]: print(result["title"]) for excerpt in result["excerpts"]: print(" ", excerpt["citation"]["section"], "|", excerpt["text"][:160]) print(body.get("warnings")) ``` # IPO Filings API: SEC S-1, F-1 & 424B Tracker Source: https://docs.darvas.app/sec-edgar/ipo-filings openapi.yaml GET /ipos Track US IPO filings since January 2025: S-1 and F-1 registration statements, amendments and 424B final prospectuses, with proposed ticker and price range. ## Overview A company going public files a registration statement with SEC (S-1, or F-1 for a foreign issuer), amends it as the offering takes shape, and files a final prospectus (424B4 or 424B1) once it is priced. Each filing since January 2025 comes here, newest first, classified from its cover page. | Coverage | Details | | - | - | | Forms | S-1, S-1/A, F-1, F-1/A, 424B4, 424B1 | | History | Every such filing since January 2025 | | Updated | Within about a minute of acceptance | | Page size | 100; `limit` counts across pages, up to 10,000 | | MCP tool | `list_ipos` on the [data API MCP server](/mcp-server) | ## Classification | Class | Meaning | | - | - | | `ipo` | An underwritten initial public offering with an exchange listing; `is_ipo_grade` is true | | `spac` | A blank check company | | `shell_company` | A company that states it is a shell company | | `resale` | Selling holders offer shares the company receives no proceeds from | | `other` | Follow-on offerings, direct offerings without an underwriter, exchange-traded trusts and the rest | `ticker`, `exchange` and the price fields are what the cover page states. A first S-1 often leaves the price range blank; a later S-1/A fills it in, and the 424B4 states the final price. Financial statements of the prospectus are not extracted yet: `status` is `classified`, and `has_financial_statements` says whether the document holds them. ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/ipos" upcoming = requests.get( url, headers=headers, params={"classification": "ipo", "filing_date_gte": "2026-10-01", "limit": 50} ).json() for filing in upcoming["ipos"]: print(filing["filing_date"], filing["company_name"], filing["ticker"], filing["price_range_low"], filing["price_range_high"]) ``` # Rule 10b5-1 Trading Plan API Source: https://docs.darvas.app/sec-edgar/rule-10b5-1-plans openapi.yaml GET /sec/rule-10b5-1 Track insiders' Rule 10b5-1 trading plan adoptions and terminations from 10-K and 10-Q disclosures, Form 4 plan flags and Form 144 plan sales. ## Overview This endpoint lists insiders' Rule 10b5-1 and non-Rule 10b5-1 trading arrangements from three SEC sources, one row per filing, newest first: the adoptions and terminations 10-K Item 9B and 10-Q Part II Item 5 disclose under Regulation S-K Item 408(a), Forms 4 with the Rule 10b5-1(c) box checked, and Form 144 notices of sales under a plan. With a ticker or CIK, the first page adds the company's restatement flags: non-reliance 8-Ks (Item 4.02), restatement facts and amended reports. Without a company or `start_date`, the last 90 days. | Coverage | Details | | - | - | | Sources | `periodic_report`, `form_4` and `form_144` | | Arrangements | Adoptions, terminations and modifications with plan dates and share amounts | | Pages | Up to 100 filings a page with `next_page_url` | | MCP tool | `list_trading_arrangements` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/sec/rule-10b5-1", headers=headers, params={ "ticker": "NVDA", }, ).json() for filing in answer["filings"]: print(filing["filing_date"], filing["source"], filing["form_type"], filing["arrangements"]) print(answer["restatement_flags"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/sec/rule-10b5-1?ticker=NVDA" ``` # Stock Dividend History & Ex-Dividend Date API Source: https://docs.darvas.app/stocks/dividends openapi.yaml GET /dividends Query historical stock dividend payouts, ex-dividend dates, cash amounts and currency for US equities to compute total return and dividend yield. ## Overview Every cash dividend a US stock has paid since its first session, oldest first. `amount` is what one share received on the `ex_date`, in `currency`. `adjusted_amount` divides it by every split since then, so it compares with today's share and with [split-adjusted prices](/stocks/historical-prices): Apple's $0.82 of August 2020 is $0.205 after the 4-for-1 split that followed. A new dividend appears after its ex-dividend session closes. A stock that has never paid one answers an empty list. Amounts from before a split come back from split-scaled values, so the oldest can differ from the declared figure in their last digit. | Coverage | Details | | - | - | | Stocks | US equities covered by [Historical Stock Prices](/stocks/historical-prices) | | Fields | Ex-dividend date `ex_date`, cash `amount` in `currency` and split-adjusted `adjusted_amount` | | Filters | Required `ticker`; optional `start_date` and `end_date` (`YYYY-MM-DD`), oldest first | | MCP tool | `list_dividends` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} dividends = requests.get( "https://api.darvas.app/v1/dividends", headers=headers, params={"ticker": "AAPL", "start_date": "2025-01-01"}, ).json()["dividends"] print(sum(row["amount"] for row in dividends)) ``` # SEC Fails-to-Deliver (FTD) Stock Data API Source: https://docs.darvas.app/stocks/fails-to-deliver openapi.yaml GET /fails-to-deliver Query official SEC settlement Fails-to-Deliver (FTD) share quantities, closing prices and dollar values by US stock ticker or settlement date. ## Overview SEC publishes the shares of each security that failed to settle on each day, all clearing members together, twice a month: the first half of a month about two weeks after it ends, the second half about two weeks later. Darvas reads every file since 2009 and each new one within a day. | Ask with | Answer | | - | - | | `ticker` | The security's settlement days, newest first; `settlement_date_gte` and the other range filters narrow them | | `settlement_date` alone | That day's securities, largest `value` first | `price` is the security's closing price on the day before, as SEC gives it, and `value` is `quantity` times `price`. Since 16 September 2008 SEC lists every security with a balance of fails on a day, so a day missing from the answer had none; before that date only balances of 10,000 shares or more were listed, and the files Darvas reads begin in July 2009. `quantity` is the balance outstanding that day across the whole market, not the day's new fails: SEC notes that the age of fails cannot be read from it, and that fails are not necessarily the result of short selling. | Coverage | Details | | - | - | | History | Official SEC fails-to-deliver files since July 2009, updated twice a month within a day of publication | | Filters | `ticker`, `settlement_date`, and range bounds (`settlement_date_gte`, `settlement_date_lte`, `settlement_date_gt`, `settlement_date_lt`) | | Pagination | `limit` with `next_page_url` and `cursor` | | MCP tool | `list_fails_to_deliver` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/fails-to-deliver" for day in requests.get(url, headers=headers, params={"ticker": "GME", "limit": 20}).json()["fails_to_deliver"]: print(day["settlement_date"], day["quantity"], day["value"]) ``` # Financial & Stock Market News API by Ticker Source: https://docs.darvas.app/stocks/financial-news openapi.yaml GET /news Retrieve timestamped company 8-K press release headlines and US federal agency market news with source URLs, cursor pagination and up to 100 rows. ## Overview Darvas serves news from primary sources only, never from third-party news aggregators. * **Company news**, with `ticker` or `cik`: the company's SEC Form 8-K filings, newest first. Each row takes the headline of the press release it furnishes when Darvas has read it (done for every new 8-K), and the names of its items otherwise, such as `8-K: Results of Operations and Financial Condition`. `url` opens the press release or the filing. * **Market news**, without `ticker` or `cik`: public-domain press releases of the Federal Reserve Board, the SEC, the Bureau of Economic Analysis, and Bureau of Labor Statistics releases on employment, prices, job openings and employment costs, polled every ten minutes. | Coverage | Details | | - | - | | Company scope | SEC Form 8-K and 8-K/A filings by `ticker` or `cik`, newest first | | Market scope | Federal Reserve, SEC, BEA and BLS official press releases when `ticker` and `cik` are omitted | | Page size | `limit` from `1` to `100` rows per page (`5` by default) | | Pagination | Cursor pagination via `next_page_url` and `cursor` (`cursor` replaces other query parameters) | | Fields | `ticker` (`null` for market news), `title`, `source`, `date`, `url`, `published_at`, and `accession_number` (company news) | | MCP tool | `list_news` on the [data API MCP server](/mcp-server) | ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/news" # Company 8-K headlines with cursor pagination (up to 100 rows per page). params = {"ticker": "AAPL", "limit": 25} page = requests.get(url, headers=headers, params=params).json() for item in page["news"]: print(item["date"], item["title"], item["url"]) next_url = page.get("next_page_url") if next_url: older = requests.get(next_url, headers=headers).json() print("Next page count:", len(older["news"])) # Latest US federal agency releases without a ticker. for item in requests.get(url, headers=headers, params={"limit": 20}).json()["news"]: print(item["published_at"], item["source"], item["title"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/news?ticker=AAPL&limit=50" ``` # Historical Stock Prices API: Split-Adjusted Source: https://docs.darvas.app/stocks/historical-prices openapi.yaml GET /prices Fetch split-adjusted daily, weekly, monthly and yearly OHLCV US stock price history with dividend-adjusted close and cursor pagination by ticker. ## Overview Darvas covers every Nasdaq, NYSE, Cboe and OTC stock, each from its first session, and adds the latest bars after each session. A bar is a session's open, high, low, close and volume; `week`, `month` and `year` bars join the sessions of their period, and their `time` is the first session. Bars are adjusted for splits, so a price before a split compares with one after it. `adjusted_close` is also adjusted for dividends, the figure to use for returns. Today's bar appears after the session closes; the latest price during the session is at [`/prices/snapshot`](/stocks/price-snapshot). | Coverage | Details | | - | - | | Stocks | About 10,000 Nasdaq, NYSE, Cboe and OTC US stocks from each stock's first session | | Intervals | `day`, `week`, `month` or `year`, split-adjusted with dividend-adjusted `adjusted_close` | | Order | Newest bar first without `start_date`, oldest first with it; `order=asc` or `desc` sets either | | Pagination | 100 bars per page, up to 1,000 with `limit`; follow `next_page_url` with `cursor` | | MCP tool | `list_prices` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/prices" params = {"ticker": "AAPL", "interval": "day", "start_date": "2026-01-02", "end_date": "2026-11-25"} while url: page = requests.get(url, headers=headers, params=params).json() for bar in page["prices"]: print(bar["time"], bar["close"], bar["adjusted_close"]) url, params = page.get("next_page_url"), None ``` # US Stock Market Snapshot API (Multi-Ticker) Source: https://docs.darvas.app/stocks/market-snapshot openapi.yaml GET /prices/snapshot/market Fetch latest prices, daily changes and percent returns across about 10,000 active US stocks in one JSON snapshot for screens and market movers. ## Overview The latest price of every stock with a positive price and a bar in the last ten days, each as [`/prices/snapshot`](/stocks/price-snapshot) gives it, or of the stocks `tickers` names. Pages hold 100 stocks, or up to 1,000 with `limit`, in `sort` order: by ticker, or the biggest gain, loss or price first. Follow `next_page_url` for the rest; each page is one call and costs one credit. | Coverage | Details | | - | - | | Universe | About 10,000 US stocks with a daily bar in the last ten days, or up to 100 named in `tickers` | | Order | `ticker`, `day_change_percent_desc`, `day_change_percent_asc`, `price_desc` or `price_asc` | | Pages | 100 stocks a page, up to 1,000 with `limit`; follow `next_page_url` | | Fields | Each row matches [`/prices/snapshot`](/stocks/price-snapshot): `ticker`, `price`, `day_change`, `day_change_percent` and `time` | | MCP tool | `get_market_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} movers = requests.get( "https://api.darvas.app/v1/prices/snapshot/market", headers=headers, params={"sort": "day_change_percent_desc", "limit": 10}, ).json()["snapshots"] for row in movers: print(row["ticker"], row["day_change_percent"]) ``` # Latest US Stock Price Snapshot & Quote API Source: https://docs.darvas.app/stocks/price-snapshot openapi.yaml GET /prices/snapshot Get the latest US stock price, daily change, percent move and timestamp for one equity ticker, refreshed every 30 minutes during market hours. ## Overview During the US session Darvas reads every stock's latest price every half hour, so `price` is up to 30 minutes old. Outside the session it is the last close, and `time` is 16:00 New York time of that day. `day_change` compares `price` with the close of the session before. | Coverage | Details | | - | - | | Stocks | US stocks listed by [Snapshot Tickers](/stocks/snapshot-tickers) | | Freshness | Updated every 30 minutes during US market hours; last close at 16:00 New York time outside the session | | Fields | `ticker`, `price`, `day_change`, `day_change_percent`, `time` and `time_milliseconds` | | MCP tool | `get_price_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} snapshot = requests.get( "https://api.darvas.app/v1/prices/snapshot", headers=headers, params={"ticker": "AAPL"}, ).json()["snapshot"] print(snapshot["price"], snapshot["day_change_percent"]) ``` # Stock Beta, Sharpe & Drawdown Risk API Source: https://docs.darvas.app/stocks/risk-statistics openapi.yaml GET /prices/risk Compute a US stock's beta, alpha, correlation, volatility, Sharpe, Sortino, Treynor, max drawdown and 95% VaR against any benchmark over 6 months to 10 years. ## Overview This endpoint measures a US stock against a benchmark, SPY without one, over each lookback window you ask for. Each window carries raw and Blume-adjusted beta, Jensen's alpha, correlation and R², volatility and downside deviation, the Sharpe, Sortino and Treynor ratios, tracking error and the information ratio, the largest drawdown with its peak and trough, and 95% historical value at risk and expected shortfall. Returns are price returns of split-consistent daily closes, sampled daily, weekly or monthly. The risk-free rate is the window's average 3-month Treasury par yield. A window with too few returns answers `null` statistics and says why. | Coverage | Details | | - | - | | Stocks | Every US stock and fund with stored daily closes, as ticker and benchmark | | Windows | `6m`, `1y`, `2y`, `3y`, `5y` and `10y`; `1y,3y,5y` by default | | Sampling | `day`, `week` or `month` returns | | Units | `_pct` fields are percent; ratios and beta are plain numbers | | MCP tool | `get_price_risk` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/prices/risk", headers=headers, params={ "ticker": "NVDA", "benchmark": "QQQ", "lookback": "1y,3y", }, ).json() for window in answer["risk_statistics"]: print(window["lookback"], window["beta"], window["sharpe_ratio"], window["max_drawdown_pct"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prices/risk?ticker=NVDA&benchmark=QQQ&lookback=1y,3y" ``` # FINRA Daily Short Sale Volume & Ratio API Source: https://docs.darvas.app/stocks/short-volume openapi.yaml GET /short-volume Access FINRA daily Reg SHO short sale volume, short-exempt volume, total volume and short ratio for US stocks at 0 credits by ticker or date. ## Overview This endpoint returns FINRA's consolidated NMS daily short sale volume file for one trading day: per ticker, the shares sold short, the short-exempt shares, the total volume reported, and their ratio. Ask for one ticker, or rank a whole session by short volume, short ratio or total volume. | Coverage | Details | | - | - | | Securities | Every symbol in FINRA's consolidated NMS daily file for the session | | Session | `date` in `YYYY-MM-DD`; without it, the newest file of the last seven days | | Rows | `limit` from 1 to 200, 50 by default | | Sort | `short_volume` (default), `short_ratio` or `total_volume`, largest first | | Credits | `0` credits per row, served with FINRA source attribution | | MCP tool | `list_short_volume` on the [data API MCP server](/mcp-server) | ## Parameters | Parameter | Description | | - | - | | `ticker` | Keep only this symbol. Without it, the answer ranks every symbol of the session. | | `date` | The trading session. A day without a FINRA file, such as a weekend or market holiday, returns `404`. | | `min_short_ratio` | Keep rows whose `short_ratio` is at least this value, from `0` to `1`. Rows without a ratio drop out. | | `sort` | `short_volume`, `short_ratio` or `total_volume`, each largest first. | | `limit` | Rows returned, 1 to 200. | ## Reading the numbers `short_ratio` is `short_volume` divided by `total_volume`, so `0.7` means 70% of the reported volume was sold short. `markets` lists the FINRA reporting facilities that carried the trades. Top-level fields carry `date` (the trading session), `source` (`FINRA Reg SHO Daily Short Sale Volume`), `credits_charged` (`0`), `attribution` (`Data provided by FINRA; served at zero credit charge.`), `units` and `methodology`. FINRA daily short sale volume rows cost `0` credits. The file counts trades reported to FINRA's facilities, not every share traded on every exchange, so `total_volume` is usually below a stock's full daily volume in [Historical Stock Prices](/stocks/historical-prices). Daily short sale volume also differs from short interest, the open short position: it includes market makers selling short to fill buy orders, often covered the same day, so a high ratio alone does not show a growing short position. For settlement failures, see [Fails-to-Deliver](/stocks/fails-to-deliver). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} url = "https://api.darvas.app/v1/short-volume" # Symbols with at least 60% short volume in the newest session, busiest first. answer = requests.get( url, headers=headers, params={"min_short_ratio": 0.6, "sort": "total_volume", "limit": 20}, ).json() print("Session:", answer["date"]) for row in answer["short_volume"]: print(row["ticker"], f"{row['short_ratio']:.0%}", row["short_volume"], "of", row["total_volume"]) # One ticker on a given day. gme = requests.get(url, headers=headers, params={"ticker": "GME", "date": "2026-11-25"}).json() print(gme["short_volume"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/short-volume?sort=short_ratio&min_short_ratio=0.5&limit=50" ``` # Stock Splits History & Split Ratio API Source: https://docs.darvas.app/stocks/splits openapi.yaml GET /splits Retrieve historical stock split and reverse split dates and ratios for US equities to normalize historical share counts, prices and EPS series. ## Overview Each split of a US stock since its first session, oldest first. From `date` on, a holder has `numerator` shares for every `denominator` held: Apple's split of 31 August 2020 is 4 for 1. A reverse split has the smaller numerator, such as 1 for 10. [Prices](/stocks/historical-prices) are already adjusted for every split, and [dividends](/stocks/dividends) carry both the amount paid and the amount per today's share. A new split appears after its first session closes; a stock that has never split answers an empty list. | Coverage | Details | | - | - | | Stocks | US equities covered by [Historical Stock Prices](/stocks/historical-prices) | | Fields | Split `date`, `numerator` and `denominator` (forward splits and reverse splits) | | Filters | Required `ticker`; optional `start_date` and `end_date` (`YYYY-MM-DD`), oldest first | | MCP tool | `list_splits` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} splits = requests.get( "https://api.darvas.app/v1/splits", headers=headers, params={"ticker": "AAPL"}, ).json()["splits"] shares = 1.0 for split in splits: shares *= split["numerator"] / split["denominator"] print(shares) # what one share of the first session became ``` # Stock Technical Indicators API: RSI, MACD, EMA Source: https://docs.darvas.app/stocks/technical-indicators openapi.yaml GET /prices/technicals Compute server-side RSI, MACD, EMA, SMA, Bollinger Bands, ATR and momentum technical indicators on US stock price history in one API request. ## Overview This endpoint computes a snapshot of standard technical indicators for one US stock from the newest stored split-adjusted bars of [Historical Stock Prices](/stocks/historical-prices). Darvas does the math on the server, so a script or an AI agent gets RSI, MACD and moving averages without downloading bars and computing them itself. | Coverage | Details | | - | - | | Stocks | The US stocks listed by [Stock Price Tickers](/stocks/tickers) | | Intervals | `day` (default) or `week`; weeks start on Monday | | Bars analyzed | Up to the newest 280 bars; `bars_analyzed` gives the count | | Rounding | Prices and indicators to 4 decimals, percentages to 2 | | MCP tool | `get_stock_technicals` on the [data API MCP server](/mcp-server) | ## Parameters | Parameter | Description | | - | - | | `ticker` | The stock, in any case. Share classes accept a dot or a dash, such as `BRK.B` or `BRK-B`. A request without it returns `400`, and a ticker without stored bars returns `404`. | | `interval` | `day` or `week`. Any other value returns `400`. | ## Indicators | Field | Method | | - | - | | `sma_20`, `sma_50`, `sma_200` | Simple moving averages of the close | | `ema_12`, `ema_26` | Exponential moving averages seeded with a simple average | | `rsi_14` | 14-period Wilder RSI, 0 to 100 | | `macd`, `macd_signal`, `macd_histogram` | EMA 12 minus EMA 26, its 9-period EMA, and their difference | | `bollinger_upper`, `bollinger_middle`, `bollinger_lower` | 20-period simple average plus and minus 2 standard deviations | | `atr_14` | 14-period Wilder Average True Range | | `high_52w`, `low_52w`, `pct_from_52w_high` | High and low of the last 252 daily or 52 weekly bars, and the latest close's distance from the high in percent | | `avg_volume_20d`, `relative_volume` | Mean share volume of the last 20 bars, and the latest bar's volume as a multiple of it | | `return_1d_pct` to `return_1y_pct` | Trailing close-to-close returns in percent over 1, 5, 21, 63, 126 and 252 sessions; on `week`, `return_1w_pct` to `return_1y_pct` span 1, 4, 13, 25 and 50 weeks and `return_1d_pct` is `null` | An indicator is `null` while too few bars exist, such as `sma_200` for a stock with under 200 sessions. `latest_date` is the newest bar's date; on `week` it is the first session of the newest week, which may still be in progress. For crypto pairs, see [Crypto Technical Indicators](/crypto/technical-indicators); for one company's price, technicals and fundamentals together, see the [Company Dossier](/companies/dossier). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} answer = requests.get( "https://api.darvas.app/v1/prices/technicals", headers=headers, params={"ticker": "AAPL", "interval": "day"}, ).json() t = answer["technicals"] trend = "above" if t["sma_200"] is not None and t["latest_close"] > t["sma_200"] else "below" print(answer["ticker"], t["latest_date"], "close:", t["latest_close"], f"({trend} SMA 200)") print("RSI-14:", t["rsi_14"], "MACD histogram:", t["macd_histogram"], "ATR-14:", t["atr_14"]) print("From 52-week high %:", t["pct_from_52w_high"], "Relative volume:", t["relative_volume"]) print("Returns %: 1M", t["return_1m_pct"], "3M", t["return_3m_pct"], "1Y", t["return_1y_pct"]) ``` ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/prices/technicals?ticker=MSFT&interval=week" ``` # 24/7 Tokenized US Stocks Directory API Source: https://docs.darvas.app/tokenized-stocks/markets openapi.yaml GET /tokenized-stocks List every 24/7 tokenized US stock instrument across OKX stock perpetual swaps, Bybit xStocks spot tokens and Coinbase stock tokens on Base chain. ## Overview Every OKX stock perpetual swap and Bybit xStocks token the exchange lists, read hourly from its public instrument list, and every Coinbase stock token on Base with a price in the last day, by ticker. `stock` names the stock each one tracks. | Coverage | Details | | - | - | | Venues | OKX stock perpetual swaps, Bybit xStocks spot tokens and Coinbase stock tokens on Base with a price in the last day | | Refresh | Exchange instrument lists refresh hourly; sorted by `ticker` | | Credits | One credit per call that returns data, however many rows it lists | | MCP tool | `list_tokenized_stocks` on the [data API MCP server](/mcp-server) | ## Example ```bash theme={null} curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/tokenized-stocks" ``` # Tokenized Stock Historical Prices & NAV API Source: https://docs.darvas.app/tokenized-stocks/prices openapi.yaml GET /tokenized-stocks/prices Query historical price observations for Base stock tokens, OKX stock perpetuals and Bybit xStocks with per-share price, USDC depth and NAV spread. ## Overview This endpoint returns historical price observations for a tokenized US stock instrument, newest first in `prices`, with cursor pagination in `next_page_url`. Base stock tokens return pool pricing, USDC liquidity, and net asset value (NAV) spread history; OKX stock perpetual swaps and Bybit xStocks tokens return 1-minute candle closes scaled by `shares_per_token`. | Coverage | Details | | - | - | | Venues | Coinbase stock tokens on Base (`NVDAc` or `0x...` address), OKX stock perpetual swaps (`NVDA-USDT-SWAP`), and Bybit xStocks (`NVDAX`) | | Ticker rules | The instrument in any case (`NVDAx`), its pair (`NVDA-USDT`), a Base address, or the stock itself (`NVDA`), which picks OKX, then Bybit, then Base unless `venue` names one; `resolved_from` echoes what was sent | | Time bounds | Optional inclusive `start_time` and `end_time` as ISO 8601 date-time or `YYYY-MM-DD` date | | Pagination | `limit` from `1` to `1000` rows per page (default `200`); follow `next_page_url` (`cursor` replaces all other parameters) | | MCP tool | `list_tokenized_stock_prices` on the [data API MCP server](/mcp-server) | ## Venue fields and NAV spreads Every response includes resolved top-level metadata (`ticker`, `venue`, `market_type`, `instrument`, `chain`, `address`, `name`, and `isin`) followed by `prices`. * **Base stock tokens (`venue: "base"`).** Pass the exact token symbol (such as `NVDAc`) or its `0x` hex contract address (with or without a `base:` prefix). Each observation reports `price`, `shares_per_token`, `price_per_share` (`price / shares_per_token`), reference `nav_price`, `nav_updated_at`, `gap_percent` (percentage spread of `price_per_share` versus `nav_price`), `pool_address`, `pool_venue` (`aerodrome` or `uniswap_v3`), `pool_usdc`, and `pool_fee_percent`. * **OKX and Bybit instruments (`venue: "okx"` or `"bybit"`).** Each observation is a 1-minute close with `price`, `shares_per_token`, `price_per_share`, and `pool_venue` set to the exchange name. On-chain and NAV fields (`chain`, `address`, `name`, `isin`, `nav_price`, `nav_updated_at`, `gap_percent`, `pool_address`, `pool_usdc`, and `pool_fee_percent`) are `null`. * **Date-only bounds.** Passing `YYYY-MM-DD` expands `start_time` to `00:00:00.000Z` and `end_time` to `23:59:59.999Z`. Sending `end_time` before `start_time` returns `400`. * **Related endpoints.** List all instruments and mapped equities at [`/tokenized-stocks`](/tokenized-stocks/markets). Read the latest quote beside the underlying US stock price at [`/tokenized-stocks/prices/snapshot`](/tokenized-stocks/snapshot). Inspect individual swaps and fills at [`/tokenized-stocks/trades`](/tokenized-stocks/trades). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/tokenized-stocks/prices", headers=headers, params={ "ticker": "NVDAc", "start_time": "2026-11-25", "end_time": "2026-11-26", "limit": 100, }, ).json() print(resp["ticker"], resp["venue"], "ISIN:", resp["isin"], "rows:", len(resp["prices"])) for pt in resp["prices"][:5]: print(pt["time"], "per share:", pt["price_per_share"], "NAV:", pt["nav_price"], "gap %:", pt["gap_percent"], "USDC:", pt["pool_usdc"]) ``` ```bash theme={null} # Historical 1-minute closes for an OKX stock perpetual swap curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/tokenized-stocks/prices?ticker=NVDA-USDT-SWAP&start_time=2026-11-25T14:00:00Z&limit=50" ``` # Tokenized US Stock Price Snapshot & NAV API Source: https://docs.darvas.app/tokenized-stocks/snapshot openapi.yaml GET /tokenized-stocks/prices/snapshot Compare live 24/7 tokenized US stock prices on OKX, Bybit xStocks and Coinbase Base tokens side by side with underlying US equity reference prices. ## Overview Three kinds of instrument track a US stock and trade at any hour. Name one by its ticker as [`/tokenized-stocks`](/tokenized-stocks/markets) lists it. | Venue | Ticker | `price` | `stock` | | - | - | - | - | | OKX stock perpetual swaps | `NVDA-USDT-SWAP` | The last one-minute close | The stock's price from [`/prices/snapshot`](/stocks/price-snapshot) | | Bybit xStocks tokens | `NVDAX` | The last trade | The same | | Coinbase stock tokens on Base | `NVDAc` | The price of the token's deepest USDC pool, with its last swap in `last_trade` | The token's published net asset value per share, which pauses outside market hours | A token stands for `shares_per_token` shares, so `price_per_share` is `price` over it, and `gap_percent` compares that with the stock's price. The ticker may also be the instrument in any case (`NVDAx`), its pair (`NVDA-USDT`) or the stock itself (`NVDA`), which picks OKX, then Bybit, then Base unless `venue` names one; `resolved_from` then echoes what was sent. Base fields such as `pool` are `null` on an exchange. | Coverage | Details | | - | - | | Venues | OKX stock perpetual swaps (`NVDA-USDT-SWAP`), Bybit xStocks (`NVDAX`) and Coinbase stock tokens on Base (`NVDAc`) | | Ticker format | Exact case listed by [Supported Markets](/tokenized-stocks/markets); bare US stock tickers return `400` | | Comparison | Returns `price`, `shares_per_token`, `price_per_share`, underlying `stock` price and `gap_percent` | | MCP tool | `get_tokenized_stock_snapshot` on the [data API MCP server](/mcp-server) | ## Example ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} for ticker in ["NVDA-USDT-SWAP", "NVDAX"]: body = requests.get( "https://api.darvas.app/v1/tokenized-stocks/prices/snapshot", headers=headers, params={"ticker": ticker}, ).json()["snapshot"] print(ticker, body["price_per_share"], body["stock"]["price"], body["gap_percent"]) ``` # Tokenized Stock Trades & On-Chain Swaps API Source: https://docs.darvas.app/tokenized-stocks/trades openapi.yaml GET /tokenized-stocks/trades Retrieve historical exchange executions and on-chain DEX swaps for tokenized US stocks on OKX, Bybit xStocks and Base filtered by side and size. ## Overview This endpoint returns historical executions for a tokenized US stock instrument, newest first in `trades`: on-chain pool swaps for Coinbase stock tokens on Base, and order-book fills for OKX stock perpetual swaps and Bybit xStocks tokens. Filter by time range, trade `side`, and `min_size_usd`, and paginate backward with `next_page_url`. | Coverage | Details | | - | - | | Venues | Coinbase stock tokens on Base (`NVDAc` or `0x...` address), OKX stock perpetual swaps (`NVDA-USDT-SWAP`), and Bybit xStocks (`NVDAX`) | | Ticker rules | The instrument in any case (`NVDAx`), its pair (`NVDA-USDT`), a Base address, or the stock itself (`NVDA`), which picks OKX, then Bybit, then Base unless `venue` names one; crypto pairs such as `BTCUSDT` are under [`/crypto/trades`](/crypto/trades) | | Filters | Optional `start_time`, `end_time` (ISO 8601 or `YYYY-MM-DD`), `side` (`buy` or `sell`), and `min_size_usd` (non-negative USD floor) | | Pagination | `limit` from `1` to `1000` trades per page (default `200`); `cursor` from `next_page_url` replaces every other parameter | | MCP tool | `list_tokenized_stock_trades` on the [data API MCP server](/mcp-server) | ## Trade fields across Base and exchanges All three venues share a single `trades` row shape (`time`, `time_milliseconds`, `side`, `price`, `size_usd`, `pool_address`, `transaction`, `log_index`, and `block`), ordered newest execution first. * **Trade direction and notional.** `side` is `"buy"` when the trader acquired the stock token and `"sell"` when the trader sold it. `price` is the executed price per token in USD (six decimals), and `size_usd` is the trade notional in USD (two decimals). * **Base swap provenance.** On Base (`venue: "base"`), `pool_address` identifies the Aerodrome or Uniswap v3 pool, `transaction` holds the on-chain transaction hash, `log_index` gives the swap event index inside the transaction, and `block` records the Base block number. * **Exchange fill provenance.** On OKX (`venue: "okx"`) and Bybit (`venue: "bybit"`), `transaction` holds the exchange trade identifier while `pool_address`, `log_index`, and `block` return `null`. * **Related endpoints.** For historical pool pricing and NAV gaps, see [`/tokenized-stocks/prices`](/tokenized-stocks/prices). For live quotes against the underlying stock, see [`/tokenized-stocks/prices/snapshot`](/tokenized-stocks/snapshot). For available symbols, see [`/tokenized-stocks`](/tokenized-stocks/markets). ## Examples ```python theme={null} import os import requests headers = {"X-API-KEY": os.environ["DARVAS_API_KEY"]} resp = requests.get( "https://api.darvas.app/v1/tokenized-stocks/trades", headers=headers, params={ "ticker": "NVDAc", "side": "buy", "min_size_usd": 1000, "limit": 50, }, ).json() print(resp["ticker"], resp["venue"], "trades:", len(resp["trades"])) for trade in resp["trades"][:5]: print(trade["time"], trade["side"], trade["price"], f'${trade["size_usd"]}', "block:", trade["block"]) ``` ```bash theme={null} # Large Bybit xStocks NVDAX trades of $5,000 or more over one UTC day curl -H "X-API-KEY: $DARVAS_API_KEY" \ "https://api.darvas.app/v1/tokenized-stocks/trades?ticker=NVDAX&start_time=2026-11-25&end_time=2026-11-25&min_size_usd=5000&limit=100" ``` # Financial Data Webhooks & HMAC Verification Source: https://docs.darvas.app/webhooks Get HMAC-SHA256 signed HTTPS webhooks when new SEC filings, earnings, statements, insider forms or macro releases arrive, then fetch the rows with your key. A webhook destination is an HTTPS URL that receives an event each time Darvas stores new data of the types you choose. Darvas sends the event as soon as it stores the data, usually within a second. ## Create a destination ```bash theme={null} curl -X POST "https://api.darvas.app/v1/webhooks" \ -H "X-API-KEY: $DARVAS_API_KEY" -H "Content-Type: application/json" \ -d '{"url": "https://hooks.example.com/darvas", "events": ["earnings.created", "insider_trades.created"]}' ``` The answer carries the destination and its signing secret, `whsec_...`. The secret is shown this once; keep it with your server. `GET /webhooks` lists your destinations without secrets, `DELETE /webhooks/{webhook_id}` removes one, and `POST /webhooks/{webhook_id}/test` sends it a test event with `livemode: false` within a second. You can send one test event a minute. The account's unified plan sets how many destinations can be active: `0` on Darvas Free, `5` on Darvas Pro (`$20/mo`, or free with an active OKX affiliate account generating positive commission in the trailing 180 days), `25` on Darvas Max, and `100` on Darvas Ultra. A destination over the limit is refused with `400 LIMIT_REACHED`. The URL must use HTTPS and reach a public address: private, loopback and link-local addresses are refused when the destination is made and again at every delivery. ## Events | Family | Event types | `data.object` | | - | - | - | | Earnings | `earnings.created` | The filing: `ticker`, `cik`, `accession_number`, `form_type`, `filing_date`, `report_period`, `url` | | Financial statements | `income_statements.created`, `balance_sheets.created`, `cash_flow_statements.created`, `financial_metrics.created` | The same | | Segments | `income_statement_segments.created`, `balance_sheet_segments.created`, `cash_flow_statement_segments.created` | The same | | Earnings releases | `operating_kpis.created`, `forward_guidance.created`, `non_gaap_metrics.created` | The same, and `metrics`, the names read | | Insider activity | `insider_trades.created`, `insider_ownership.created`, `insider_sale_notices.created` | The same | | Filings | `filing_items.metadata.created` | The same, and `available_items` | | Macro | `yield_curve.created`, `inflation.created`, `labor.created`, `gdp.created`, `interest_rates.created` | `dataset`, `date`, `series` (or `banks`) and `url` | `url` is the API request that answers the new rows: an event tells you what changed, and you fetch the data with your key. Statement events come only for filings of the last three days, so the nightly rebuild of older statements sends nothing. [Darvas workspace webhooks](/pro/webhooks) (included in Darvas Pro, Max, and Ultra) receive these events too, along with alarm, schedule, economic calendar, ETF flow and connection events. ## Deliveries Each delivery is a POST of a JSON envelope: ```json theme={null} { "id": "evt_5f0c3a1b9d2e4f6a7b8c9d0e1f2a3b4c", "type": "income_statements.created", "api_version": "2026-11-26", "livemode": true, "created": 1795687200, "data": { "object": { "ticker": "AAPL", "cik": 320193, "accession_number": "0000320193-26-000106", "form_type": "10-Q", "filing_date": "2026-11-25", "report_period": "2026-09-27", "url": "https://api.darvas.app/v1/financials/income-statements?cik=320193&period=quarterly&limit=1" } } } ``` The headers are `Content-Type: application/json`, `User-Agent: Darvas-Webhook/1.0` and `Darvas-Signature: t=,v1=`. A delivery succeeds on any 2xx answer within ten seconds; redirects are not followed. Each destination receives its events one at a time, oldest first, so a slow server delays only its own events. A failed delivery is tried again about a minute later and about ten minutes after that, then given up. A destination whose last 50 attempts failed is disabled: delete it and make a new one once your server answers. The same event can arrive twice and in any order, so use `id` to skip one you have seen. ## Verify the signature `v1` is the HMAC-SHA256 of `{t}.{raw body}` under your secret. Compute it over the raw bytes you received, compare in constant time, and refuse a `t` more than five minutes from your clock. ```python theme={null} import hashlib import hmac import time def verify(secret: str, header: str, body: bytes) -> bool: parts = dict(part.split("=", 1) for part in header.split(",")) timestamp = int(parts["t"]) expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + body, hashlib.sha256).hexdigest() return abs(time.time() - timestamp) <= 300 and hmac.compare_digest(expected, parts["v1"]) ``` ```javascript theme={null} import { createHmac, timingSafeEqual } from "node:crypto"; export function verify(secret, header, body) { const parts = Object.fromEntries(header.split(",").map((part) => part.split("="))); const expected = createHmac("sha256", secret).update(`${parts.t}.${body}`).digest("hex"); const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) <= 300; const given = Buffer.from(parts.v1 ?? ""); return fresh && given.length === expected.length && timingSafeEqual(Buffer.from(expected), given); } ```