Statistics of the World On Chain API

The On Chain API from Statistics of the World — 6 operation(s) for on chain.

GitHub OpenAPI

Operations 6

GET /api/v1/onchain/history Read forward sampled pool or perpetual quote histories #
GET /api/v1/onchain/quotes Read SOTW-calculated public pool prices in USDC #
GET /api/v1/onchain/assets List reviewed onchain instruments and pool addresses #
GET /api/v1/onchain/stream Stream shared onchain snapshots with server-sent events #
GET /api/v1/onchain/derivatives Read qualified onchain perpetual order-book midpoints #
GET /api/v1/onchain/derivatives/assets List reviewed perpetual contracts and reference units #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/statisticsoftheworld-com:statisticsoftheworld-com-on-chain-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

statisticsoftheworld-com-on-chain-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Statistics of the World Onchain API
  description: REST API for global statistics. Every tier retains the 335-indicator public read catalog for 218 countries. Paid keys add higher request limits; bulk redistribution remains limited to source-cleared datasets, including the 281-indicator reviewed World Bank bundle. See https://statisticsoftheworld.com/pricing.
  version: 2.9.0
  contact:
    name: Statistics of the World
    url: https://statisticsoftheworld.com
    email: api@statisticsoftheworld.com
servers:
- url: https://statisticsoftheworld.com
  description: Production
security:
- {}
- ApiKeyAuth: []
tags:
- name: On Chain
paths:
  /api/v1/onchain/history:
    get:
      operationId: getSampledMarketHistory
      summary: Read forward sampled pool or perpetual quote histories
      description: Exact case-sensitive symbols, market=pools|derivatives and UTC from/to required; maximum 31 days. Samples preserve cadence, quiet/unavailable states and separate definition versions. No source readings before collection, trades, OHLC, exchange cash prices or independent raw-upstream archive are inferred. Missing scheduled slots and conservative storage pauses remain visible.
      parameters:
      - name: market
        in: query
        required: true
        schema:
          type: string
          enum:
          - pools
          - derivatives
      - name: symbol
        in: query
        required: true
        schema:
          type: string
      - name: from
        in: query
        required: true
        schema:
          type: string
          format: date-time
        description: UTC timestamp ending Z, optional three fractional digits
      - name: to
        in: query
        required: true
        schema:
          type: string
          format: date-time
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 5000
          default: 5000
      - name: format
        in: query
        schema:
          type: string
          enum:
          - json
          - csv
          default: json
      responses:
        '200':
          description: Instrument acquisition bounds, definitions and bounded sampled points; empty pre-collection selections remain explicit.
          content:
            application/json:
              schema:
                type: object
                required:
                - instrument
                - definitions
                - data
                - count
                - capTruncated
                - before_archive_start
                properties:
                  instrument:
                    type: object
                  definitions:
                    type: array
                    items:
                      type: object
                  count:
                    type: integer
                  capTruncated:
                    type: boolean
                  before_archive_start:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
                      required:
                      - market
                      - symbol
                      - sample_slot
                      - sampled_at
                      - cadence_seconds
                      - definition_hash
                      - snapshot_sha256
                      - price
                      - price_text
                      - status
                      - attributes
                      properties:
                        market:
                          type: string
                        symbol:
                          type: string
                        sample_slot:
                          type: string
                          format: date-time
                        sampled_at:
                          type: string
                          format: date-time
                        cadence_seconds:
                          type: integer
                          enum:
                          - 60
                          - 300
                        definition_hash:
                          type: string
                        snapshot_sha256:
                          type: string
                        price:
                          type:
                          - number
                          - 'null'
                        price_text:
                          type:
                          - string
                          - 'null'
                        status:
                          type: string
                        attributes:
                          type: object
            text/csv:
              schema:
                type: string
        '400':
          description: Invalid or oversized window
        '404':
          description: Unknown reviewed or archived instrument
        '409':
          description: Row cap prevents complete CSV
        '429':
          description: Request allowance exhausted
        '503':
          description: Required archive read failed; no-store
      tags:
      - On Chain
  /api/v1/onchain/quotes:
    get:
      operationId: getOnchainQuotes
      summary: Read SOTW-calculated public pool prices in USDC
      description: Crypto, stablecoins, gold tokens and tokenized stocks/ETFs are distinct instruments from native coins, bullion benchmarks and cash securities. Reads hash-pinned Ethereum/BNB and confirmed Solana contract state. Ethereum/Solana quote Circle USDC; BNB quotes Binance-Peg USD Coin with same-block USDT conversions. Unknown or repeated selectors fail. Failed reads and low active liquidity return null prices; quiet pools retain oracle observation timestamps. No historical archive or licence to underlying exchange/index data is asserted.
      parameters:
      - name: category
        in: query
        schema:
          type: string
          enum:
          - crypto
          - stablecoin
          - tokenized-gold
          - tokenized-equity
          - tokenized-etf
      - name: symbols
        in: query
        schema:
          type: string
        description: Comma-separated case-sensitive token symbols, e.g. PAXG,AAPLx.
      responses:
        '200':
          description: One or more selected observations available; inspect partial, status and timestamps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnchainSnapshot'
        '400':
          description: Invalid or repeated selector
        '429':
          description: Existing API request allowance exhausted
        '503':
          description: No selected price available; returned snapshot retains source errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OnchainSnapshot'
      tags:
      - On Chain
  /api/v1/onchain/assets:
    get:
      operationId: listOnchainAssets
      summary: List reviewed onchain instruments and pool addresses
      responses:
        '200':
          description: Reviewed static catalog; issuance alone does not imply pool coverage.
          content:
            application/json:
              schema:
                type: object
                required:
                - reviewedAt
                - count
                - categories
                - quoteCurrency
                - assets
                properties:
                  reviewedAt:
                    type: string
                    format: date-time
                  count:
                    type: integer
                  categories:
                    type: array
                    items:
                      type: string
                      enum:
                      - crypto
                      - stablecoin
                      - tokenized-gold
                      - tokenized-equity
                      - tokenized-etf
                  quoteCurrency:
                    const: USDC
                  assets:
                    type: array
                    items:
                      type: object
                      required:
                      - symbol
                      - name
                      - category
                      - chain
                      - poolAddress
                      - tokenAddress
                      properties:
                        symbol:
                          type: string
                        name:
                          type: string
                        category:
                          type: string
                          enum:
                          - crypto
                          - stablecoin
                          - tokenized-gold
                          - tokenized-equity
                          - tokenized-etf
                        chain:
                          type: string
                          enum:
                          - Ethereum
                          - Solana
                          - BNB Chain
                        poolAddress:
                          type: string
                        tokenAddress:
                          type: string
                        quoteTokenAddress:
                          type: string
                        quoteTokenName:
                          type: string
        '429':
          description: Existing API request allowance exhausted
      tags:
      - On Chain
  /api/v1/onchain/stream:
    get:
      operationId: streamOnchainQuotes
      summary: Stream shared onchain snapshots with server-sent events
      description: snapshot events contain OnchainSnapshot JSON (market=pools, default) or DerivativeSnapshot JSON (market=derivatives). Refresh cadence is five seconds; pool prices change with blocks. A ten-minute connection ends with a reconnect event. One connection consumes one metered API request. Clients should disconnect hidden views and stop unbounded retries after failures.
      parameters:
      - name: market
        in: query
        schema:
          type: string
          enum:
          - pools
          - derivatives
          default: pools
      responses:
        '200':
          description: Server-sent snapshot, reconnect or unavailable events
          content:
            text/event-stream:
              schema:
                type: string
        '429':
          description: API request allowance exhausted
        '503':
          description: Stream capacity reached; Retry-After applies
      tags:
      - On Chain
  /api/v1/onchain/derivatives:
    get:
      operationId: getOnchainDerivatives
      summary: Read qualified onchain perpetual order-book midpoints
      description: Stock, ETF, metal, energy, currency, index and yield-linked perpetuals. Each row retains its reference units. Delisted, stale, empty, malformed, wide-spread and low-depth books are withheld. Oracle, mark and last-trade fallback prices are excluded. Source access is free and shared across viewers; no cash-market or underlying feed licence is asserted.
      parameters:
      - name: category
        in: query
        schema:
          type: string
          enum:
          - equities
          - etfs
          - commodities
          - currencies
          - indices
          - rates
      - name: symbols
        in: query
        schema:
          type: string
        description: Comma-separated exact contract IDs, e.g. xyz:SILVER,xyz:CL,para:10Y.
      responses:
        '200':
          description: At least one selected qualified book; inspect status and timestamps.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DerivativeSnapshot'
        '400':
          description: Invalid or repeated selector
        '429':
          description: API allowance exhausted
        '503':
          description: No selected qualified book
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DerivativeSnapshot'
      tags:
      - On Chain
  /api/v1/onchain/derivatives/assets:
    get:
      operationId: listOnchainDerivatives
      summary: List reviewed perpetual contracts and reference units
      responses:
        '200':
          description: Static reviewed catalog, including excluded candidates with reasons
          content:
            application/json:
              schema:
                type: object
                required:
                - reviewedAt
                - count
                - categories
                - instrumentType
                - assets
                - excluded
                - notice
                properties:
                  reviewedAt:
                    type: string
                    format: date-time
                  count:
                    type: integer
                  categories:
                    type: array
                    items:
                      type: string
                      enum:
                      - equities
                      - etfs
                      - commodities
                      - currencies
                      - indices
                      - rates
                  instrumentType:
                    const: perpetual
                  assets:
                    type: array
                    items:
                      $ref: '#/components/schemas/DerivativeAsset'
                  excluded:
                    type: array
                    items:
                      type: object
                      properties:
                        symbol:
                          type: string
                        reason:
                          type: string
                  notice:
                    type: string
        '429':
          description: API allowance exhausted
      tags:
      - On Chain
components:
  schemas:
    DerivativeQuote:
      allOf:
      - type: object
        required:
        - symbol
        - displaySymbol
        - name
        - category
        - chain
        - venue
        - instrumentType
        - collateralAsset
        - unit
        - referenceDescription
        - sourceUrl
        properties:
          symbol:
            type: string
            description: Exact venue-qualified contract ID, e.g. xyz:SILVER.
          displaySymbol:
            type: string
          name:
            type: string
          category:
            type: string
            enum:
            - equities
            - etfs
            - commodities
            - currencies
            - indices
            - rates
          chain:
            const: Hyperliquid
          venue:
            type: string
          instrumentType:
            const: perpetual
          collateralAsset:
            const: USDC
          unit:
            type: string
            description: Contract reference units; collateral does not determine quote units.
          referenceDescription:
            type: string
          metadataSource:
            type: string
            format: uri
          sourceUrl:
            type: string
            format: uri
      - type: object
        required:
        - price
        - status
        - observedAt
        - sourceTime
        - bestBid
        - bestAsk
        - spreadBps
        - bidDepth
        - askDepth
        properties:
          price:
            type:
            - number
            - 'null'
          status:
            type: string
            enum:
            - ok
            - unavailable
            - stale
            - empty-book
            - wide-spread
            - low-depth
          observedAt:
            type:
            - string
            - 'null'
            format: date-time
          sourceTime:
            type:
            - string
            - 'null'
            format: date-time
          bestBid:
            type:
            - object
            - 'null'
            required:
            - price
            - size
            - orders
            properties:
              price:
                type: number
              size:
                type: number
              orders:
                type: integer
          bestAsk:
            type:
            - object
            - 'null'
            required:
            - price
            - size
            - orders
            properties:
              price:
                type: number
              size:
                type: number
              orders:
                type: integer
          spreadBps:
            type:
            - number
            - 'null'
          bidDepth:
            type:
            - number
            - 'null'
          askDepth:
            type:
            - number
            - 'null'
          error:
            type: string
    DerivativeAsset:
      type: object
      required:
      - symbol
      - displaySymbol
      - name
      - category
      - chain
      - venue
      - instrumentType
      - collateralAsset
      - unit
      - referenceDescription
      - sourceUrl
      properties:
        symbol:
          type: string
          description: Exact venue-qualified contract ID, e.g. xyz:SILVER.
        displaySymbol:
          type: string
        name:
          type: string
        category:
          type: string
          enum:
          - equities
          - etfs
          - commodities
          - currencies
          - indices
          - rates
        chain:
          const: Hyperliquid
        venue:
          type: string
        instrumentType:
          const: perpetual
        collateralAsset:
          const: USDC
        unit:
          type: string
          description: Contract reference units; collateral does not determine quote units.
        referenceDescription:
          type: string
        metadataSource:
          type: string
          format: uri
        sourceUrl:
          type: string
          format: uri
    OnchainQuote:
      type: object
      required:
      - symbol
      - name
      - category
      - chain
      - price
      - quoteCurrency
      - status
      - observedAt
      - chainTime
      - poolObservationAt
      - poolAddress
      - sourceUrl
      - tokenAddress
      properties:
        symbol:
          type: string
        name:
          type: string
        category:
          type: string
          enum:
          - crypto
          - stablecoin
          - tokenized-gold
          - tokenized-equity
          - tokenized-etf
        chain:
          type: string
          enum:
          - Ethereum
          - Solana
          - BNB Chain
        price:
          type:
          - number
          - 'null'
        quoteCurrency:
          const: USDC
        quoteTokenAddress:
          type: string
        quoteTokenName:
          type: string
          description: BNB uses Binance-Peg USD Coin; Ethereum/Solana use Circle USDC.
        status:
          type: string
          enum:
          - ok
          - quiet-pool
          - low-liquidity
          - unavailable
        observedAt:
          type: string
          format: date-time
          description: SOTW retrieval time; never advanced for failed-source rows.
        chainTime:
          type:
          - string
          - 'null'
          format: date-time
        poolObservationAt:
          type:
          - string
          - 'null'
          format: date-time
          description: Recorded pool oracle observation time; not a guarantee of last trade time.
        poolAddress:
          type: string
        tokenAddress:
          type: string
        sourceUrl:
          type: string
          format: uri
        error:
          type: string
        proof:
          type: object
          required:
          - height
          - sqrtPrice
          - sqrtBits
          properties:
            height:
              type: string
            blockHash:
              type: string
            sqrtPrice:
              type: string
            sqrtBits:
              type: integer
              enum:
              - 64
              - 96
            multiplier:
              type: number
            route:
              type: array
              items:
                type: string
    OnchainSnapshot:
      type: object
      required:
      - generatedAt
      - count
      - available
      - partial
      - refreshSeconds
      - quoteCurrency
      - quotes
      - sourceErrors
      - methodology
      - rights
      properties:
        generatedAt:
          type: string
          format: date-time
        count:
          type: integer
        available:
          type: integer
        partial:
          type: boolean
        refreshSeconds:
          type: number
        quoteCurrency:
          const: USDC
        quotes:
          type: array
          items:
            $ref: '#/components/schemas/OnchainQuote'
        sourceErrors:
          type: array
          items:
            type: string
        methodology:
          type: string
        rights:
          type: object
          required:
          - source
          - notice
          - termsUrl
          properties:
            source:
              type: string
            notice:
              type: string
            termsUrl:
              type: string
              format: uri
    DerivativeSnapshot:
      type: object
      required:
      - generatedAt
      - count
      - available
      - partial
      - refreshSeconds
      - quotes
      - sourceErrors
      - methodology
      - quality
      - rights
      properties:
        generatedAt:
          type: string
          format: date-time
        count:
          type: integer
        available:
          type: integer
        partial:
          type: boolean
        refreshSeconds:
          type: number
        quotes:
          type: array
          items:
            $ref: '#/components/schemas/DerivativeQuote'
        sourceErrors:
          type: array
          items:
            type: string
        methodology:
          type: string
        quality:
          type: object
          properties:
            maxAgeSeconds:
              const: 15
            maxSpreadBps:
              const: 100
            minTwoSidedDepth:
              const: 1000
            depthBandPercent:
              const: 1
            depthUnit:
              type: string
        rights:
          type: object
          required:
          - source
          - notice
          - termsUrl
          properties:
            source:
              type: string
            notice:
              type: string
            termsUrl:
              type: string
              format: uri
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Optional. Without a key, requests are limited to 1,000/day per IP. A free key adds a usage dashboard. Paid keys increase throughput without removing public sources. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-RateLimit-Tier headers.