{
  "openapi": "3.0.1",
  "info": {
    "title": "Bitcoin Scraper — Fees, Mempool, Blocks, Address Balance",
    "description": "Bitcoin on-chain data for agents: recommended fees, mempool size and congestion, latest blocks, block height, hashrate and difficulty, address balance and transactions, transaction status. Powered by mempool.space. No API key.",
    "version": "0.1",
    "x-build-id": "1oxw3Df3FCAIcfVF3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/yadroo~bitcoin-mempool/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-yadroo-bitcoin-mempool",
        "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/yadroo~bitcoin-mempool/runs": {
      "post": {
        "operationId": "runs-sync-yadroo-bitcoin-mempool",
        "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/yadroo~bitcoin-mempool/run-sync": {
      "post": {
        "operationId": "run-sync-yadroo-bitcoin-mempool",
        "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": "Mode",
            "enum": [
              "overview",
              "fees",
              "mempool",
              "blocks",
              "block",
              "address",
              "tx",
              "mining",
              "lightning",
              "price"
            ],
            "type": "string",
            "description": "`overview` = one item: fees, congestion, mempool size, next-block projections, difficulty epoch, hashrate, price, last 10 blocks. `fees` = compact fee item for payment routing / alerts. `mempool` = mempool composition + newest txs + RBF replacements. `blocks` = one item per recent block (or from `startHeight`). `block` = specific blocks by height or hash. `address` = balance, history and net flows per address. `tx` = status, confirmations, fee rate, inputs/outputs, RBF info per txid. `mining` = pool market share, hashrate, difficulty. `lightning` = network stats + top nodes (+ node search). `price` = BTC price now and on given dates.",
            "default": "overview"
          },
          "network": {
            "title": "Network",
            "enum": [
              "mainnet",
              "testnet4",
              "testnet",
              "signet"
            ],
            "type": "string",
            "description": "Bitcoin network. Lightning stats and prices exist only on mainnet.",
            "default": "mainnet"
          },
          "addresses": {
            "title": "Addresses",
            "type": "array",
            "description": "Bitcoin addresses: bc1q… (segwit), bc1p… (taproot), 1… (legacy), 3… (P2SH); tb1…/m…/n…/2… on test networks. Invalid or failed addresses are not saved and not charged: they are listed in the run's SUMMARY record under `errors`.",
            "items": {
              "type": "string"
            }
          },
          "txLimit": {
            "title": "Recent transactions per address",
            "minimum": 0,
            "maximum": 200,
            "type": "integer",
            "description": "How many transactions to list per address, newest first (0 = only balances). With dates, only transactions inside the dates count toward it. Pages of 25 are read until the limit, `sinceDate` or the end of the history is reached.",
            "default": 25
          },
          "sinceDate": {
            "title": "Since date",
            "type": "string",
            "description": "Keep only transactions / blocks on or after this date (YYYY-MM-DD = from 00:00 UTC, or ISO 8601). Paging stops at the first older transaction or block, which keeps runs short. Applies to address and blocks modes."
          },
          "untilDate": {
            "title": "Until date",
            "type": "string",
            "description": "Keep only transactions / blocks on or before this date (YYYY-MM-DD = the whole day, UTC; or ISO 8601). Blocks mode starts at the block mined at that time (today or a later date: at the chain tip). Address mode skips newer transactions while paging, reading about 1,000 confirmed transactions per address at most to reach the window (`windowComplete: false` beyond that)."
          },
          "includeMempoolTxs": {
            "title": "Include unconfirmed transactions",
            "type": "boolean",
            "description": "Include the address's unconfirmed (mempool) transactions in `recentTxs` (they have `confirmed:false`, `confirmations:0`).",
            "default": true
          },
          "includeUtxos": {
            "title": "Include UTXOs",
            "type": "boolean",
            "description": "Attach the unspent outputs list (`utxos`, up to 500). mempool.space refuses addresses with more than 500 UTXOs — a warning is recorded in that case.",
            "default": false
          },
          "txids": {
            "title": "Transaction ids",
            "type": "array",
            "description": "64-hex transaction ids. Each yields: confirmed/unconfirmed, confirmations, `status` (unconfirmed / confirmed / final ≥ 6 conf), fee, fee rate, vsize, inputs and outputs with addresses and amounts, RBF replacement info.",
            "items": {
              "type": "string"
            }
          },
          "includeRbf": {
            "title": "Include RBF info",
            "type": "boolean",
            "description": "Look up whether the transaction replaced or was replaced by another (Replace-By-Fee) → `replacedBy`, `replaces`.",
            "default": true
          },
          "blocks": {
            "title": "Blocks (block mode)",
            "type": "array",
            "description": "Block heights (e.g. \"900000\") and/or block hashes for mode=block.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "blocksLimit": {
            "title": "Number of blocks (blocks mode)",
            "minimum": 1,
            "maximum": 150,
            "type": "integer",
            "description": "How many blocks to return in mode=blocks (15 per page; ~144 blocks = one day).",
            "default": 15
          },
          "startHeight": {
            "title": "Start height (blocks mode)",
            "minimum": 0,
            "type": "integer",
            "description": "Walk backwards starting at this height instead of the chain tip."
          },
          "includeBlockTxids": {
            "title": "Include block txids (block mode)",
            "type": "boolean",
            "description": "Attach the block's transaction ids (`txids`, first `blockTxidsLimit`) and the total count.",
            "default": false
          },
          "blockTxidsLimit": {
            "title": "Max txids per block",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound for `txids` in mode=block.",
            "default": 25
          },
          "projectedBlocks": {
            "title": "Projected blocks",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many upcoming mempool blocks to include in `projectedBlocks` (each with tx count, median fee, fee range) — overview, fees and mempool modes.",
            "default": 3
          },
          "recentTxLimit": {
            "title": "Newest mempool transactions",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "mode=mempool: how many of the newest unconfirmed transactions to list (txid, fee rate, value).",
            "default": 10
          },
          "includeReplacements": {
            "title": "Include RBF replacements",
            "type": "boolean",
            "description": "mode=mempool: include the latest fee-bump replacements seen in the mempool (`replacements`).",
            "default": false
          },
          "interval": {
            "title": "Interval",
            "enum": [
              "24h",
              "3d",
              "1w",
              "1m",
              "3m",
              "6m",
              "1y",
              "2y",
              "3y",
              "all"
            ],
            "type": "string",
            "description": "Time window for pool ranking, hashrate series and difficulty-adjustment history.",
            "default": "1w"
          },
          "poolsLimit": {
            "title": "Top pools",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many mining pools to include in `pools` (ranked by blocks found in the interval).",
            "default": 20
          },
          "lightningRanking": {
            "title": "Node ranking",
            "enum": [
              "capacity",
              "connectivity",
              "age"
            ],
            "type": "string",
            "description": "Which top-node list to attach to the stats item.",
            "default": "capacity"
          },
          "lightningLimit": {
            "title": "Top nodes",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "How many nodes to include in `topNodes` (0 = stats only). Also caps alias-search results per query.",
            "default": 20
          },
          "lightningQueries": {
            "title": "Node lookups",
            "type": "array",
            "description": "Node aliases to search (e.g. \"ACINQ\", \"Kraken\") or 66-hex node public keys for full node details. One `lightning_node` item per match.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "currency": {
            "title": "Currency",
            "enum": [
              "USD",
              "EUR",
              "GBP",
              "CAD",
              "CHF",
              "AUD",
              "JPY"
            ],
            "type": "string",
            "description": "Fiat currency for `price`. Current prices for all seven currencies are always included in `prices`.",
            "default": "USD"
          },
          "dates": {
            "title": "Historical dates",
            "type": "array",
            "description": "Dates (YYYY-MM-DD) for historical BTC prices — one item per date (daily granularity, mempool.space price index).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "title": "Only these output fields",
            "type": "array",
            "description": "Keep only these top-level fields in each item, in this order (kind, id, network, found, sourceUrl, fetchedAt are always kept and come first unless you list them). Letter case is forgiven; names this mode never outputs are ignored with a note in the status, and a list with none of the mode's fields is refused. A row that has none of the listed fields is not saved (not charged). Empty = full item. Example: [\"fastestFee\",\"congestion\",\"mempoolTxCount\"].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 5000,
            "type": "integer",
            "description": "Minimum gap between the starts of two mempool.space requests; all requests of the run share one lane, at most 2 at a time. After an HTTP 429 the gap doubles (at least 1 s) for the rest of the run and Retry-After is respected. Raise it for long lists.",
            "default": 100
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}