{
  "openapi": "3.0.1",
  "info": {
    "title": "Crypto Data API - Coin Metrics On-Chain Metrics and Market Data",
    "description": "Crypto data API for Coin Metrics: on-chain network metrics (active addresses, fees, supply, market cap, MVRV), reference rates, pair and market candles, trades, funding rates, open interest, liquidations and indexes. Free Community data with no key, or bring your own Pro key.",
    "version": "0.1",
    "x-build-id": "p3tv60uWEVI2H14Qo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nabeelbaghoor~crypto-onchain-market-data-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nabeelbaghoor-crypto-onchain-market-data-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-market-data-api/runs": {
      "post": {
        "operationId": "runs-sync-nabeelbaghoor-crypto-onchain-market-data-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-market-data-api/run-sync": {
      "post": {
        "operationId": "run-sync-nabeelbaghoor-crypto-onchain-market-data-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": [
              "assetMetrics",
              "pairCandles",
              "marketCandles",
              "marketTrades",
              "marketFundingRates",
              "marketOpenInterest",
              "marketLiquidations",
              "marketQuotes",
              "indexLevels",
              "exchangeMetrics",
              "assetMetricCatalog",
              "metricDefinitions",
              "assets",
              "exchanges",
              "markets",
              "indexes"
            ],
            "type": "string",
            "description": "Free without a key (Community API): asset metrics, pair candles, asset metric coverage, metric definitions, assets, exchanges, markets and indexes. Need your own Coin Metrics Pro API key: market candles, trades, funding rates, open interest, liquidations, quotes, index levels and exchange metrics.",
            "default": "assetMetrics"
          },
          "assets": {
            "title": "Assets",
            "type": "array",
            "description": "Asset metrics and asset metric coverage. Coin Metrics asset tickers, one per line: btc, eth, sol, usdc. Use * for every asset (asset metrics only). The assets mode lists every ticker.",
            "default": [
              "btc",
              "eth"
            ],
            "items": {
              "type": "string"
            }
          },
          "metrics": {
            "title": "Metrics",
            "type": "array",
            "description": "Asset metrics (required), exchange metrics (required) and asset metric coverage (optional filter). Metric IDs, one per line. Network data: PriceUSD, CapMrktCurUSD, AdrActCnt, TxCnt, TxTfrValAdjUSD, FeeTotUSD, HashRate, SplyCur, CapMVRVCur, FlowInExUSD, ReferenceRateUSD. Exchange metrics: volume_reported_spot_usd_1d, open_interest_reported_future_usd. The metric definitions mode lists every asset metric.",
            "default": [
              "PriceUSD",
              "CapMrktCurUSD",
              "AdrActCnt",
              "TxCnt"
            ],
            "items": {
              "type": "string"
            }
          },
          "markets": {
            "title": "Markets",
            "type": "array",
            "description": "Market candles, trades, funding rates, open interest, liquidations and quotes. Coin Metrics market IDs, one per line: coinbase-btc-usd-spot, binance-btc-usdt-spot, binance-BTCUSDT-future, deribit-BTC-PERPETUAL-future. Patterns work too: coinbase-*-spot, *USDT-future. The markets mode lists every ID.",
            "items": {
              "type": "string"
            }
          },
          "pairs": {
            "title": "Pairs",
            "type": "array",
            "description": "Pair candles. Asset pairs, one per line: btc-usd, eth-usd, sol-usd. Patterns such as btc-* work too.",
            "items": {
              "type": "string"
            }
          },
          "indexes": {
            "title": "Indexes",
            "type": "array",
            "description": "Index levels. Coin Metrics index tickers, one per line: CMBIBTC, CMBIETH, CMBI10. Patterns such as CMBI* work too. The indexes mode lists every ticker.",
            "items": {
              "type": "string"
            }
          },
          "exchanges": {
            "title": "Exchanges",
            "type": "array",
            "description": "Exchange metrics. Coin Metrics exchange names, one per line: coinbase, binance, kraken, deribit. Use * for every exchange. The exchanges mode lists every name.",
            "items": {
              "type": "string"
            }
          },
          "frequency": {
            "title": "Frequency",
            "enum": [
              "1d",
              "4h",
              "1h",
              "30m",
              "15m",
              "10m",
              "5m",
              "1m",
              "15s",
              "1s",
              "1b",
              "1d-ny-close",
              "1d-sg-close"
            ],
            "type": "string",
            "description": "Asset metrics: 1d, 1h, 10m, 5m, 1m, 1s, 1b (block by block) or 1d-ny-close. Candles: 1m to 1d. Index levels: 1s, 15s, 1h, 1d, 1d-ny-close or 1d-sg-close. Exchange metrics: 1h or 1d. The free Community tier serves most asset metrics daily only (reference rates also intraday for the last few points).",
            "default": "1d"
          },
          "granularity": {
            "title": "Granularity",
            "enum": [
              "raw",
              "1m",
              "1h",
              "1d"
            ],
            "type": "string",
            "description": "Open interest and quotes. Raw returns every snapshot; 1m, 1h or 1d keeps one real snapshot per interval.",
            "default": "raw"
          },
          "startTime": {
            "title": "Start time",
            "type": "string",
            "description": "Inclusive start of the window, as YYYY-MM-DD or a UTC time such as 2026-01-31T12:00:00Z. Left empty, the window starts at the beginning of the history."
          },
          "endTime": {
            "title": "End time",
            "type": "string",
            "description": "Inclusive end of the window, as YYYY-MM-DD or a UTC time. Left empty, the window ends now."
          },
          "sortOrder": {
            "title": "Which end first",
            "enum": [
              "end",
              "start"
            ],
            "type": "string",
            "description": "Newest first keeps the most recent rows when the maximum results cap is reached; oldest first reads the window forward from its start.",
            "default": "end"
          },
          "limitPerEntity": {
            "title": "Latest rows per entity",
            "minimum": 1,
            "type": "integer",
            "description": "Time series modes. Caps the rows each asset, market, pair, index or exchange contributes. 1 with newest first returns the latest value for every entity in one request."
          },
          "exchange": {
            "title": "Exchange filter",
            "type": "string",
            "description": "Markets mode. Only markets on this exchange, such as coinbase, binance or deribit."
          },
          "marketType": {
            "title": "Market type",
            "enum": [
              "any",
              "spot",
              "future",
              "option"
            ],
            "type": "string",
            "description": "Markets mode. Only spot, future or option markets.",
            "default": "any"
          },
          "baseAsset": {
            "title": "Base asset",
            "type": "string",
            "description": "Markets mode. Only markets with this base asset, such as btc."
          },
          "quoteAsset": {
            "title": "Quote asset",
            "type": "string",
            "description": "Markets mode. Only markets with this quote asset, such as usd or usdt."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "The most rows this run returns (and, with a Pro key, charges for). Also the page size, up to the documented 10,000.",
            "default": 500
          },
          "requestsPerMinute": {
            "title": "Requests per minute",
            "minimum": 1,
            "maximum": 18000,
            "type": "integer",
            "description": "Pacing. The Community API allows 10 requests per 6 seconds per IP address, Pro keys 6000 per 20 seconds; the actor also waits and retries when the provider answers 429.",
            "default": 90
          },
          "apiKey": {
            "title": "API key",
            "type": "string",
            "description": "Optional. Your own Coin Metrics Pro API key. Left empty, the actor reads the free Coin Metrics Community API, which needs no key. Sent as the documented api_key parameter and 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}