{
  "openapi": "3.0.1",
  "info": {
    "title": "Crypto On-Chain Data API - CryptoQuant Exchange Flows, MVRV",
    "description": "Pull CryptoQuant on-chain and market data into a dataset: BTC, ETH, XRP, stablecoin and ERC20 exchange and miner flows, reserves, MVRV, SOPR, NUPL, whale ratio, funding rates, open interest, ETF fund data, mempool and Lightning stats. Bring your own API key.",
    "version": "0.1",
    "x-build-id": "QoxfkIpOVG25QOUfx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~crypto-onchain-data-exchange-flows-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-crypto-onchain-data-exchange-flows-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/nabeelbaghoor~crypto-onchain-data-exchange-flows-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-crypto-onchain-data-exchange-flows-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/nabeelbaghoor~crypto-onchain-data-exchange-flows-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-crypto-onchain-data-exchange-flows-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "What to read",
            "enum": [
              "metricSeries",
              "researchIndicator",
              "dataLatency",
              "entityList",
              "endpointList"
            ],
            "type": "string",
            "description": "Metric time series reads each CryptoQuant v1 endpoint (exchange flows, miner flows, network data, market data, flow, market and network indicators, fund, ETH staking, mempool, Lightning, XRP DEX and AMM, TRON DeFi) once per exchange, miner, token or symbol you list, newest data first. Research indicator reads the curated v2 bitcoin indicators. Data latency shows how long after a block each endpoint's data is ready. Entity list reads the exchanges, miners and banks an asset's flow data covers. Endpoint list returns every endpoint your key can call with its parameters.",
            "default": "metricSeries"
          },
          "endpoints": {
            "title": "Endpoints",
            "type": "array",
            "description": "Endpoint paths as the CryptoQuant docs list them below /v1, one per line, for example btc/exchange-flows/reserve, btc/exchange-flows/netflow, btc/miner-flows/outflow, btc/market-indicator/mvrv, btc/market-indicator/sopr, btc/network-indicator/nupl, btc/flow-indicator/exchange-whale-ratio, eth/market-data/funding-rates, stablecoin/exchange-flows/inflow or btc/lightning/stats-in-total. The endpoint list mode lists all 236.",
            "items": {
              "type": "string"
            }
          },
          "exchanges": {
            "title": "Exchanges",
            "type": "array",
            "description": "For endpoints that take an exchange: exchange flows, flow indicators, open interest, funding rates, liquidations, taker volume and leverage ratio. Names such as binance, coinbase_advanced, okx, bybit, or the aggregates all_exchange, spot_exchange and derivative_exchange, one per line. Each exchange is its own request. Left off endpoints that take none.",
            "items": {
              "type": "string"
            }
          },
          "miners": {
            "title": "Miners",
            "type": "array",
            "description": "For miner flow endpoints and miner supply ratio: mining pools such as f2pool, antpool, viabtc or all_miner. For btc/miner-data/companies: listed mining companies such as mara, riot, clsk, core or iren. One per line; each is its own request.",
            "items": {
              "type": "string"
            }
          },
          "tokens": {
            "title": "Tokens",
            "type": "array",
            "description": "For stablecoin, ERC20 and altcoin endpoints: tokens such as usdt_eth, usdc, all_token, link, uni or aave, one per line; each is its own request. The stablecoin and ERC20 entity lists read the first token.",
            "items": {
              "type": "string"
            }
          },
          "symbols": {
            "title": "Symbols",
            "type": "array",
            "description": "For price OHLCV and liquidations: pair symbols such as btc_usd, btc_usdt or all_symbol. For fund data: fund tickers such as gbtc, ibit or ethe. One per line; each is its own request.",
            "items": {
              "type": "string"
            }
          },
          "amms": {
            "title": "AMM pairs",
            "type": "array",
            "description": "For XRP AMM endpoints only: AMM pairs from the XRP AMM table in the CryptoQuant docs, one per line.",
            "items": {
              "type": "string"
            }
          },
          "market": {
            "title": "Market",
            "enum": [
              "spot",
              "perpetual"
            ],
            "type": "string",
            "description": "For price OHLCV only. Spot or perpetual prices; the provider defaults to spot."
          },
          "metricType": {
            "title": "Mempool metric type",
            "enum": [
              "tx_count",
              "total_size",
              "total_fee"
            ],
            "type": "string",
            "description": "For the two BTC mempool endpoints only. The provider defaults to the transaction count."
          },
          "fromEntity": {
            "title": "From entity",
            "type": "string",
            "description": "For BTC inter-entity flows only: the sending exchange or mining pool, such as binance or f2pool (for exchange-to-exchange, exchange-to-miner, miner-to-exchange and miner-to-miner)."
          },
          "toEntity": {
            "title": "To entity",
            "type": "string",
            "description": "For BTC inter-entity flows only: the receiving exchange or mining pool. For exchange-to-exchange it must differ from the from entity."
          },
          "indicators": {
            "title": "Research indicators",
            "type": "array",
            "description": "Research indicator mode. The curated v2 (beta) bitcoin indicators to read.",
            "items": {
              "type": "string",
              "enum": [
                "bitcoin-mvrv-z-score",
                "bitcoin-pnl-index",
                "bitcoin-bull-bear-indicator",
                "bitcoin-apparent-demand",
                "bitcoin-etf-demand",
                "bitcoin-trader-realized-price",
                "bitcoin-trader-unrealized-profit-margin",
                "bitcoin-realized-profit-loss",
                "bitcoin-metcalfe-price",
                "bitcoin-satoshi-era-miner",
                "bitcoin-op-return-count"
              ],
              "enumTitles": [
                "MVRV Z-score",
                "PnL Index (MVRV, NUPL, LTH/STH SOPR)",
                "Bull-Bear market cycle indicator",
                "Apparent demand growth (30 days and 1 year)",
                "US spot ETF bitcoin demand",
                "On-chain trader realized price bands",
                "On-chain trader unrealized profit margin",
                "Realized net profit and loss",
                "Metcalfe's law price bands",
                "Satoshi-era miner flows and reserves",
                "OP_RETURN count"
              ]
            }
          },
          "window": {
            "title": "Window",
            "enum": [
              "day",
              "hour",
              "10min",
              "min",
              "block"
            ],
            "type": "string",
            "description": "Aggregation interval. Every endpoint offers day; hour, 10min, min and block depend on the endpoint and on your plan (on-chain data is daily on Professional, all windows on Premium).",
            "default": "day"
          },
          "since": {
            "title": "Since",
            "type": "string",
            "description": "Start of the window, UTC: a date such as 2025-01-01 or 20250101, a date and time such as 2025-01-01T12:00:00Z, or a block height with the block window. Leave empty to read the newest rows up to the maximum results."
          },
          "until": {
            "title": "Until",
            "type": "string",
            "description": "End of the window, in the same forms as Since. Leave empty for the latest data point."
          },
          "entityAsset": {
            "title": "Entity list asset",
            "enum": [
              "btc",
              "eth",
              "stablecoin",
              "erc20",
              "xrp"
            ],
            "type": "string",
            "description": "Entity list mode. Which asset's supported entities to list.",
            "default": "btc"
          },
          "entityType": {
            "title": "Entity type",
            "enum": [
              "exchange",
              "miner",
              "bank",
              "builder",
              "team",
              "foundation",
              "custody",
              "otc",
              "bridge"
            ],
            "type": "string",
            "description": "Entity list mode. BTC lists exchanges, miners and banks; ETH, stablecoins and ERC20 list exchanges; XRP lists exchanges, builders, teams, foundations, custody, OTC desks, banks and bridges.",
            "default": "exchange"
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The most rows this run returns and charges for, across all endpoints and entities. Each request asks the provider only for the rows still left, which also limits the API credits used.",
            "default": 200
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 800,
            "type": "integer",
            "description": "Pacing. CryptoQuant allows 10 requests a minute on Basic, 60 on Advanced, 120 on Professional and 800 on Premium, and answers 429 above it, which the actor waits out and retries.",
            "default": 20
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Your own CryptoQuant API key (access token), from the API tab of your settings at cryptoquant.com/settings/api. Stored as a secret and sent only in the Authorization header; it is never logged. You can instead set the DATA_API_KEY environment secret."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}