# Taoswap API > Free Bittensor data as JSON, with no key and no account: subnets and alpha prices, validators and yields, accounts and portfolios, trades, blocks, extrinsics and events. Bittensor network data as JSON: subnets and their prices, validators and their yields, accounts and portfolios, trades, blocks, extrinsics and events. It is the API taoswap.org runs on, open to anyone building a dashboard, a bot, a wallet, a tax report or research on Bittensor. ## Quickstart The base URL is `https://api.taoswap.org`. There is no key, no account and no sign-up: send a plain `GET`. One call to `/v2/subnets/` returns every subnet: read lists whole rather than looping over netuids. ``` curl "https://api.taoswap.org/subnet-price-history/?netuid=64&resolution=D&limit=2" ``` ```json { "netuid": 64, "resolution": "D", "count": 2, "results": [ {"time": 1792627200, "open": 0.067109159, "high": 0.068240326, "low": 0.067109083, "close": 0.067867348, "volume": 6549.837576187999}, {"time": 1792713600, "open": 0.067867348, "high": 0.068061833, "low": 0.067867272, "close": 0.068039508, "volume": 398.21830664600003} ] } ``` Two daily candles of subnet 64's alpha price in TAO per alpha, each starting at a UNIX time in seconds, with the TAO swapped in the subnet's pool that day. The reference gives every operation its parameters, its rate limit and its response, with an example on the most used ones. ## Units Amounts use three units, and each amount field's description names its own: - **rao**, the chain's base unit: 1 TAO is 10⁹ rao. As a rule an integer amount is in rao, even under a `_tao` name such as `total_tao` on `/accounts/`. - **TAO**: a floating-point amount of TAO, such as a market cap, is in whole TAO. - **alpha**, each subnet's own token: whole alpha as a floating-point number, or alpha rao (10⁻⁹ alpha) as an integer such as `alpha_rao`. Prices are in TAO per alpha, and `_usd` fields in US dollars. A few exact figures come as decimal strings, such as the stakes on `/validators/`, the USD values on the portfolio routes and `burn_tao` on `/subnets/{netuid}/registrations/`. ## Time Datetimes are ISO 8601 in UTC, with fractional seconds only when they are not zero, and end in `Z` or `+00:00` depending on the route: parse the offset rather than match a suffix. Dates are UTC days, `YYYY-MM-DD`, and candles use UNIX seconds. Date bounds are inclusive, except `date_to` on `/trades/` and `/trades/summary/`, which ends the window at 00:00 UTC that day. A block lands about every 12 seconds. ## Pagination Lists page in one of five ways, and each operation says which: - **`page` and `page_size`**, `page` counting from 1, with a `pagination` object beside `results` that carries `has_next` and, on most lists, the totals. Its fields vary a little from route to route, as each documents. A page deeper than 10,000 rows answers `400`. - **`before`**, the cursor `/trades/` hands out as `pagination.next_before`, reads on past that depth. - **`after`**, the cursor handed out as `next_cursor`, does the same for the delegators of `/v2/subnets/{netuid}/` and `/v2/validators/{hotkey}/` and for a fund's swaps and deposits under `/v1/beta-baskets/`. - **`limit` and `offset`** on `/account-transactions/`, which pages two lists at once and carries no totals: a list shorter than `limit` is the last page. - **`limit` alone** keeps the most recent rows of a series, such as `/price-history/` and `/subnet-price-history/`. The other lists answer whole: `/subnets/`, `/validators/`, `/identities/`, `/metagraph/{netuid}/`, and the daily histories, which `days` or a date range bound. ## Errors Every error the API itself returns is JSON, in one envelope: ```json {"error": true, "code": "VALIDATION_ERROR", "message": "netuid is required", "detail": null} ``` | Status | `code` | Meaning | | ------ | -------------------- | ------------------------------------------------------------------------------------------- | | 400 | `VALIDATION_ERROR` | A parameter is missing or malformed, or the page is too deep. `detail` may name the fields. | | 404 | `RESOURCE_NOT_FOUND` | No such route or object. Cached for 15 seconds: a new block is indexed within a minute. | | 405 | `METHOD_NOT_ALLOWED` | The route exists, but not for this HTTP method. | | 410 | `ENDPOINT_REMOVED` | The route was retired. `detail.replacement` names its successor, when it has one. | | 429 | `RATE_LIMITED` | Over the operation's rate limit. Retry after the `Retry-After` header's seconds. | | 500 | `INTERNAL_ERROR` | A server fault. | | 503 | `QUERY_TIMEOUT` | The query ran past its time budget. Narrow the filters or the window. | Other client errors carry the framework's code in capitals, such as `PARSE_ERROR`, and the testnet faucet lists its own codes on its operation. The proxy in front of the API answers its own `429` in this envelope too, and `502` or `504` as HTML when the API is unreachable. ## Browsers and CORS A web page on any origin can call the GET operations from the browser: their answers, errors and redirects included, carry `Access-Control-Allow-Origin: *`, and a script reads their `Retry-After`, `Deprecation`, `Sunset` and `Link` headers. Send no credentials, as `fetch` does by default: no operation reads a cookie, and a browser refuses a `*` answer to a request made with `credentials: "include"`. Send no custom header on a GET either, `Content-Type: application/json` included: the browser then sends a preflight first for each distinct URL, and each one counts against the proxy's 10 requests a second. Each visitor's browser spends the limits of its own address. ## Rate limits Limits are per IP address, and no key raises them. Each operation states its own, and this table groups them: | Scope | Limit | Applies to | | -------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `anon` | 600/minute | Every route without a tighter scope, the metagraph, network stats and TAO price among them. | | `subnet_price` | 2000/minute | The subnet candles, `/subnet-price-history/`, which charts call in bursts. | | `explore` | 300/minute | Subnets, validators, blocks, events, extrinsics, trades, gamma, accounts, identities, search, beta baskets, multisigs, the network metrics, the history before Finney, and the portfolio balance, ledger, PnL, root dividends and transactions. | | `og` | 30/minute | The Open Graph share images under `/og/`. | | `faucet` | 3/minute | The testnet faucet claim, `POST /testnet-faucet/`; its reads count against `anon`. | Over a limit, the API answers `429` with a `Retry-After` header in seconds. The proxy in front of it also caps each address at 10 requests a second, and an address it refuses 300 times within 10 minutes is blocked for 5 minutes, then for twice as long after fewer refusals at each repeat, up to 1 hour, so back off at the first `429`. [Both layers in full](https://api.taoswap.org/changelog/#rate-limits). ## Versions Every bare path of the reference is version 1, and `/v1/` aliases it: `/subnets/` and `/v1/subnets/` are the same route, listed here under the bare path. Newer resources exist under `/v1/` only, such as `/v1/account-ledger/` and `/v1/beta-baskets/`. `/v2/` carries a newer shape of `subnets`, `validators` and `extrinsics`, described on each operation: prefer it where it exists. New fields appear without notice, so ignore the keys you do not know; a value found wrong is fixed in place, and a shape change gets a new version. ## Deprecations A route on its way out answers as before for at least 7 days with `Deprecation`, `Sunset` and `Link` headers, marked deprecated in the reference with its date, then answers `410`. A stable operation, and each of its fields, leaves only after at least 180 days: the schema marks it `x-stability: stable`, the reference and `/llms.txt` say Stable, and a `/v1/` alias shares the stability of its bare route. Build a package or a recipe meant to last on those. The [deprecations page](https://api.taoswap.org/changelog/) lists what is on its way out with the removal dates and an Atom feed. ## Support Questions, and every deprecation as it is announced: the [Kusanagi Discord](https://discord.gg/kusanagi-ventures). ## Operations Every live public operation, grouped as the interactive reference groups them, with its query parameters and rate limit, and `Stable` on the operations that leave only after 180 days of notice. Path parameters sit in braces in the route. Routes on their way out are left out: the changelog lists them. ### Subnets Subnets: prices, emissions, pools, daily history, registrations and validators. - `GET /subnets/`: Every subnet. Limit 300/minute. Prefer `/v2/subnets/`. - `GET /subnets/{netuid}/`: One subnet, with its metagraph. Query: `account`, `after`, `delegators`, `group_by`, `mechid`, `page`, `page_size`, `parents`, `search`, `sort_by`, `sort_dir`. Limit 300/minute. Prefer `/v2/subnets/{netuid}/`. - `GET /subnets/{netuid}/history/`: A subnet's daily history. Query: `date_from`, `date_to`, `days`. Limit 300/minute. Prefer `/v2/subnets/{netuid}/history/`. - `GET /subnets/{netuid}/registrations/`: A subnet's registration and ownership history. Limit 300/minute. Prefer `/v2/subnets/{netuid}/registrations/`. - `GET /subnets/{netuid}/validators/`: The validators of one subnet, with their yields. Query: `mechid`, `page`, `page_size`, `parents`, `sort_by`, `sort_dir`. Limit 300/minute. Prefer `/v2/subnets/{netuid}/validators/`. - `GET /subnets/network-reg-cost/`: What registering a new subnet cost, per day or block by block. Query: `date_from`, `date_to`, `granularity`. Limit 300/minute. Prefer `/v2/subnets/network-reg-cost/`. - `GET /v2/subnets/`: Every subnet. Limit 300/minute. Stable. - `GET /v2/subnets/{netuid}/`: One subnet, with its metagraph. Query: `account`, `after`, `delegators`, `group_by`, `mechid`, `omit`, `page`, `page_size`, `parents`, `search`, `sort_by`, `sort_dir`. Limit 300/minute. Stable. - `GET /v2/subnets/{netuid}/history/`: A subnet's daily history. Query: `date_from`, `date_to`, `days`. Limit 300/minute. Stable. - `GET /v2/subnets/{netuid}/registrations/`: A subnet's registration and ownership history. Limit 300/minute. - `GET /v2/subnets/{netuid}/validators/`: The validators of one subnet, with their yields. Query: `mechid`, `page`, `page_size`, `parents`, `sort_by`, `sort_dir`. Limit 300/minute. Stable. - `GET /v2/subnets/network-reg-cost/`: What registering a new subnet cost, per day or block by block. Query: `date_from`, `date_to`, `granularity`. Limit 300/minute. ### Prices Candles of a subnet's alpha price, from one minute to one week, and the daily TAO price in USD or EUR. - `GET /price-history/`: Daily TAO price. Query: `currency`, `date_from`, `date_to`, `limit`, `order`. Limit 600/minute. Stable. - `GET /subnet-price-history/`: OHLCV candles for one subnet. Query: `from`, `limit`, `netuid` (required), `resolution`, `to`. Limit 2000/minute. Stable. ### Metagraph A subnet's metagraph, and its validators' weight vectors. - `GET /metagraph/{netuid}/`: The full metagraph of one subnet. Query: `mechid`. Limit 600/minute. Stable. - `GET /metagraph/{netuid}/weights/`: Who votes what, on one subnet. Query: `mechid`, `top`, `uid`. Limit 600/minute. ### Validators Validators: stake, yields, delegators and daily history. - `GET /v2/validators/`: Every validator, with its yields and stake. Query: `sort_by`, `sort_dir`. Limit 300/minute. Stable. - `GET /v2/validators/{hotkey}/`: One validator, with its subnets and delegators. Query: `account`, `after`, `group_by`, `omit`, `page`, `page_size`, `search`, `sort_by`, `sort_dir`. Limit 300/minute. Stable. - `GET /v2/validators/{hotkey}/history/`: A validator's daily stake history. Query: `days`. Limit 300/minute. Stable. - `GET /validators/`: Every validator, with its yields and stake. Query: `sort_by`, `sort_dir`. Limit 300/minute. Prefer `/v2/validators/`. - `GET /validators/{hotkey}/history/`: A validator's daily stake history. Query: `days`. Limit 300/minute. Prefer `/v2/validators/{hotkey}/history/`. ### Portfolio One coldkey: its balance history, profit and loss, ledger, transactions, idle stake and bridge orders. - `GET /account-transactions/`: Stake transfers and TAO transfers of one coldkey. Query: `account` (required), `limit`, `offset`. Limit 300/minute. Stable. - `GET /idle-stakes/lookup/`: One coldkey's under-performing delegations. Query: `coldkey` (required). Limit 600/minute. - `GET /portfolio-balance/`: Balance history for one coldkey, or a summed basket of them. Query: `account`, `accounts`, `date_from`, `date_to`, `days`, `granularity`, `subnets`. Limit 300/minute. Stable. - `GET /portfolio-pnl-apy/`: Portfolio APY and PnL for one coldkey. Query: `account` (required), `include_subnets`. Limit 300/minute. Stable. - `GET /portfolio-root-yield/`: Root dividends per validator for one coldkey. Query: `account` (required). Limit 300/minute. - `GET /swaps/bridge/`: A wallet's bridge orders opened through Taoswap, newest first. Query: `coldkey`, `evm_address`. Limit 600/minute. - `GET /v1/account-ledger/`: Every τ and α movement of one coldkey, whatever wrapped it. Query: `account` (required), `include_rewards`, `kinds`, `min_value_rao`, `netuid`, `page`, `page_size`, `success`. Limit 300/minute. Stable. ### Trades Buys and sells of alpha on every subnet, and the stake flow they add up to. - `GET /trades/`: Stake legs, newest first. Query: `before`, `coldkey`, `date_from`, `date_to`, `hotkey`, `max_value_rao`, `min_value_rao`, `netuid`, `operation`, `page`, `page_size`, `previous_subnets`, `side`, `success`, `validator`. Limit 300/minute. Stable. - `GET /trades/stats/`: Stake-flow stats over a date range. Query: `date_from`, `date_to`. Limit 300/minute. - `GET /trades/stats/rolling/`: Rolling stake-flow window. Query: `hours`. Limit 300/minute. - `GET /trades/summary/`: One coldkey's trading, raw or bucketed. Query: `coldkey` (required), `date_from`, `date_to`, `hotkey`, `netuid`, `resolution`. Limit 300/minute. ### Chain Blocks, extrinsics and events, as lists or one by one. - `GET /blocks/`: Blocks, newest first. Query: `from_block`, `page`, `page_size`, `to_block`. Limit 300/minute. - `GET /blocks/{block}/`: One block. Limit 300/minute. - `GET /blocks/{block}/events/`: Events of one block. Query: `extrinsic_idx`, `method`, `page`, `page_size`, `section`. Limit 300/minute. - `GET /blocks/{block}/extrinsics/`: Every extrinsic of one block. Query: `success`. Limit 300/minute. - `GET /events/`: Chain events, newest first. Query: `block`, `from_block`, `method`, `page`, `page_size`, `section`, `to_block`. Limit 300/minute. - `GET /events/{event_id}/`: One event. Limit 300/minute. - `GET /extrinsics/`: Extrinsics, newest first. Query: `account`, `action`, `block`, `call`, `category`, `exclude_batches`, `from_block`, `max_value_rao`, `min_value_rao`, `module`, `netuid`, `ordering`, `page`, `page_size`, `signer`, `success`, `target`, `to_block`. Limit 300/minute. Prefer `/v2/extrinsics/`. - `GET /extrinsics/{extrinsic_id}/`: One extrinsic. Limit 300/minute. Prefer `/v2/extrinsics/{extrinsic_id}/`. - `GET /extrinsics/counts/`: Extrinsic counts per category. Query: `account`, `action`, `max_value_rao`, `min_value_rao`, `netuid`, `success`. Limit 300/minute. Prefer `/v2/extrinsics/counts/`. - `GET /v1/gamma/`: Gamma mints and spends of one coldkey's deposits, one subnet's, one hotkey's or one service's. Query: `account`, `changes`, `hotkey`, `netuid`, `page`, `page_size`, `search`, `service`. Limit 300/minute. - `GET /v1/gamma/services/`: The services subnets list for their gamma, each with what was spent at it. Query: `hotkey`, `netuid`. Limit 300/minute. - `GET /v1/multisig-operations/`: Multisig operations, newest activity first. Query: `member`, `multisig`, `page`, `page_size`, `status`. Limit 300/minute. - `GET /v1/multisigs/`: Multisig accounts, newest activity first. Query: `member`, `page`, `page_size`, `search`. Limit 300/minute. - `GET /v1/multisigs/{address}/`: One multisig account. Limit 300/minute. - `GET /v1/pre-finney/extrinsics/`: One account's extrinsics before Finney, newest first. Query: `account` (required), `call`, `category`, `chain`, `from_block`, `module`, `page`, `page_size`, `to_block`. Limit 300/minute. - `GET /v1/pre-finney/summary/`: What one account did before Finney, in one call. Query: `account` (required), `chain`. Limit 300/minute. - `GET /v1/pre-finney/weights/`: The set_weights one hotkey signed before Finney, per UTC day. Query: `account` (required), `chain`. Limit 300/minute. - `GET /v2/extrinsics/`: Extrinsics, newest first. Query: `account`, `action`, `block`, `call`, `category`, `exclude_batches`, `from_block`, `max_value_rao`, `min_value_rao`, `module`, `netuid`, `ordering`, `page`, `page_size`, `signer`, `success`, `target`, `to_block`. Limit 300/minute. - `GET /v2/extrinsics/{extrinsic_id}/`: One extrinsic. Limit 300/minute. - `GET /v2/extrinsics/counts/`: Extrinsic counts per category. Query: `account`, `action`, `max_value_rao`, `min_value_rao`, `netuid`, `success`. Limit 300/minute. ### Accounts Every coldkey ranked by total value, and how wealth spreads across them. - `GET /accounts/`: Accounts ranked by total TAO. Query: `max_value_rao`, `min_value_rao`, `page`, `page_size`, `q`. Limit 300/minute. - `GET /accounts/wealth-distribution/`: How TAO is spread across accounts. Limit 300/minute. ### Beta baskets Every validator's fund: its holdings, share price, rebalances and share purchases. - `GET /v1/beta-baskets/`: Every validator beta basket. Query: `page`, `page_size`, `sort_by`, `sort_dir`. Limit 300/minute. - `GET /v1/beta-baskets/{hotkey}/`: One validator's beta basket, with its holdings and series. Query: `days`, `resolution`. Limit 300/minute. - `GET /v1/beta-baskets/{hotkey}/cost-basis/`: What one coldkey paid for the shares of a fund it still holds. Query: `coldkey` (required). Limit 300/minute. - `GET /v1/beta-baskets/{hotkey}/deposits/`: Purchases of one fund's shares, newest first. Query: `after`, `coldkey`, `page`, `page_size`. Limit 300/minute. - `GET /v1/beta-baskets/{hotkey}/swaps/`: One fund's rebalances, newest first. Query: `after`, `netuid`, `page`, `page_size`. Limit 300/minute. - `GET /v1/beta-baskets/{hotkey}/swaps/summary/`: What one fund's rebalances bought and sold, netted per subnet. Query: `days`. Limit 300/minute. - `GET /v1/beta-baskets/composition/`: What the largest funds hold, as shares of their NAV. Query: `min_share_pct`, `top`. Limit 300/minute. - `GET /v1/beta-baskets/market/`: The funds' market line, the average each fund's share price is read against. Query: `days`, `resolution`. Limit 300/minute. - `GET /v1/beta-baskets/subnets/`: Every fund's holdings, folded per subnet. Limit 300/minute. ### Network How the network's TAO splits between root, subnet pools and free balances. - `GET /network-metrics/`: Network metrics header. Limit 300/minute. - `GET /network-metrics/history/`: Network metrics over time. Query: `date_from`, `date_to`, `resolution`. Limit 300/minute. - `GET /network-stats/`: Latest network snapshot. Query: `date`. Limit 600/minute. Stable. - `GET /network-stats/history/`: Daily network stake breakdown. Query: `date_from`, `date_to`, `limit`, `order`. Limit 600/minute. ### Search Search across blocks, subnets, validators and accounts, and every on-chain identity. - `GET /identities/`: Every on-chain identity, in one response. Limit 300/minute. - `GET /search/`: Search blocks, extrinsics, subnets, validators and accounts. Query: `limit`, `q`, `type`. Limit 300/minute. Stable. ### Testnet faucet Test TAO on the Bittensor testnet. - `GET /testnet-faucet/`: Faucet balance and recent claims. Limit 600/minute. - `POST /testnet-faucet/`: Claim testnet TAO. Query: `env`. Limit 3/minute. ## Links - [Quickstart](https://docs.taoswap.org/developers/api-quickstart/): a first request, then units, timestamps, pagination and errors. - [Endpoint pages](https://docs.taoswap.org/developers/endpoints/): every operation on a page of its own, with its parameters and response fields, readable without JavaScript. - [Interactive reference](https://api.taoswap.org/docs/): every operation with its response schema, in Swagger UI, which needs JavaScript. - [OpenAPI schema](https://api.taoswap.org/schema/): OpenAPI 3.0 in YAML, or JSON with `?format=json`. - [Changelog](https://api.taoswap.org/changelog/): deprecations and removals with their dates, and an Atom feed.