Glossary

Block Explorer API

A block explorer API provides programmatic access to blockchain data including transactions, addresses, blocks, and mempool state.

Key Takeaways

  • A block explorer API is a programmatic interface that exposes indexed blockchain data (transactions, addresses, UTXOs, blocks, and mempool state) over HTTP, allowing applications to query on-chain information without running their own full node and indexer.
  • Popular Bitcoin explorer APIs include Blockstream's Esplora (open source, MIT license), Mempool.space (open source, AGPL-3.0), Blockchair (proprietary, multi-chain), and BlockCypher (proprietary, multi-chain): each offers different rate limits, endpoint coverage, and trust tradeoffs.
  • Using a third-party block explorer API introduces privacy and trust risks: the API operator sees your IP address, every address you query, and every transaction you look up. Self-hosting an open-source explorer eliminates this leak entirely.

What Is a Block Explorer API?

A block explorer API is a RESTful (and sometimes WebSocket-based) interface that provides programmatic access to blockchain data. Where a blockchain explorer renders this data in a web interface for humans to browse, a block explorer API returns the same data as structured JSON for applications to consume. Think of it as the machine-readable backend behind the human-readable explorer frontend.

Block explorer APIs sit on top of a blockchain indexer: a service that reads raw data from a full node, organizes it into queryable databases, and exposes it through HTTP endpoints. Without an indexer, answering a simple question like "what is the balance of this address?" would require scanning every block in the chain. The API layer abstracts this complexity, turning millisecond database lookups into simple HTTP GET requests.

Developers building wallets, payment processors, analytics dashboards, and compliance tools rely on block explorer APIs as their primary interface to blockchain data. For many applications, they are the first (and sometimes only) connection to the Bitcoin network.

How It Works

A block explorer API follows a standard request-response pattern. The client sends an HTTP request to a specific endpoint with parameters (a transaction ID, an address, a block height), and the server returns structured JSON containing the requested data. Most APIs follow RESTful conventions with predictable URL patterns.

Common Endpoints

While each provider has its own URL structure, most block explorer APIs expose a consistent set of core endpoints:

CategoryEndpoint PatternReturns
Transaction lookup/tx/{txid}Inputs, outputs, fee, confirmation status, size
Address info/address/{address}Balance, total received/sent, transaction count
Address UTXOs/address/{address}/utxoList of unspent outputs with values and confirmation status
Address transactions/address/{address}/txsPaginated transaction history for the address
Fee estimation/v1/fees/recommendedSuggested fee rates for different confirmation targets
Block data/block/{hash}Header fields, transaction list, size, weight
Mempool stats/mempoolUnconfirmed transaction count, total size, fee distribution
Transaction broadcastPOST /txBroadcasts a raw signed transaction to the network

Request and Response Example

A typical API call to look up an address's UTXOs follows this pattern:

# Query UTXOs for an address using the Esplora API
curl https://blockstream.info/api/address/bc1q.../utxo

# Response (JSON array of unspent outputs)
[
  {
    "txid": "7b1c3a...",
    "vout": 0,
    "status": {
      "confirmed": true,
      "block_height": 850000,
      "block_hash": "00000000..."
    },
    "value": 50000
  }
]

The response includes the transaction ID, output index, confirmation status, and value in satoshis for each unspent output. A wallet application would use this data to calculate the address balance and select inputs for new transactions using a coin selection algorithm.

REST vs WebSocket Interfaces

Most block explorer APIs provide a REST interface for on-demand queries: the client sends a request and receives a response. This works well for lookups like checking a balance or fetching transaction details.

For real-time data, some APIs also offer WebSocket connections. Mempool.space, for example, exposes a WebSocket endpoint at wss://mempool.space/api/v1/ws that supports subscriptions to live data including new blocks, mempool updates, and address activity. This is useful for applications that need instant notifications when a transaction confirms or when network conditions change, without the overhead of repeatedly polling REST endpoints.

Blockstream Esplora

Blockstream's Esplora is an open-source block explorer (MIT license) with a well-documented REST API available at blockstream.info/api/. The backend uses esplora-electrs, a Rust-based indexer, to process data from Bitcoin Core.

Esplora supports Bitcoin mainnet, testnet, signet, and the Liquid Network, with network-specific API paths (for example, /testnet/api/ for testnet). Its public instance applies rate limiting of approximately 50 requests per second with a burst allowance of 100 requests. The API is designed with privacy in mind: it does not track users or maintain persistent logs.

Because Esplora is fully open source, anyone can self-host it alongside their own full node, eliminating reliance on Blockstream's infrastructure entirely.

Mempool.space

Mempool.space provides both a REST API and a WebSocket interface, with its defining strength being real-time mempool and fee data. The /v1/fees/recommended endpoint returns fee rate estimates for different confirmation targets (fastest, half-hour, hour, economy, minimum), making it the go-to source for fee estimation in many wallet applications.

The public API enforces rate limits (approximately 10 requests per second), returning HTTP 429 errors when exceeded. Repeated violations can result in IP bans. Enterprise users can sponsor the project for higher limits.

Like Esplora, mempool.space is open source (AGPL-3.0 license) and can be self-hosted on platforms like Umbrel and RaspiBlitz. Self-hosted instances have no rate limits, making them ideal for applications that need high query throughput.

Blockchair

Blockchair is a proprietary multi-chain explorer API supporting over 17 blockchains including Bitcoin, Ethereum, Litecoin, and several others. Its API is accessed at api.blockchair.com and provides SQL-like query capabilities for filtering and aggregating blockchain data.

The free tier is limited to 1,440 calls per day with a soft limit of 5 requests per second and a hard limit of 30 requests per minute. Some endpoints have higher request costs, meaning a single complex query can consume multiple API credits. Paid tiers range from a pay-as-you-go model for short-term projects to enterprise plans with dedicated infrastructure and SLAs.

BlockCypher

BlockCypher offers a multi-chain API supporting Bitcoin, Litecoin, Dogecoin, Dash, and Ethereum. Its free tier allows up to 3 requests per second, 100 requests per hour, and 2,000 queries per day.

A distinguishing feature of BlockCypher is its confidence factor for unconfirmed transactions: the API returns a probability estimate of whether a zero-confirmation transaction will be included in the next block, based on double-spend detection heuristics. Paid plans start at $119 per month, with a 10% discount for Bitcoin payments.

Self-Hosted vs Third-Party APIs

The choice between running your own block explorer API and relying on a third-party service involves tradeoffs across privacy, reliability, cost, and operational complexity.

FactorSelf-HostedThird-Party
PrivacyNo data leakage: queries stay localAPI operator sees your IP and every query
Trust modelYou verify data against your own nodeYou trust the provider returns accurate data
Rate limitsNone: limited only by hardwareVaries by provider and pricing tier
UptimeDepends on your infrastructureTypically 99.9%+ with redundancy
Storage600 GB+ for full index (Esplora) or ~35 GB (electrs)Zero: data is stored by the provider
Setup timeHours to days for initial syncMinutes: generate an API key
MaintenanceNode upgrades, disk monitoring, reorg handlingNone: managed by the provider

For production applications handling user funds, running your own indexer is the recommended approach. It eliminates the risk of a third-party provider returning incorrect data, going offline, or censoring certain transactions. Open-source options like Esplora and mempool.space make self-hosting practical even for small teams. For prototyping, testing, and low-volume applications, third-party APIs offer a fast path to getting started.

A hybrid approach is also common: use your own node and indexer as the primary data source, and fall back to a third-party API for redundancy. This pattern is especially useful during initial block download, when a fresh node is still syncing and cannot serve queries.

Use Cases

  • Wallet backends: lightweight wallets query block explorer APIs for address balances, UTXO sets, and transaction history. This is how mobile wallets display your balance without running a full node on your phone.
  • Payment verification: merchants and payment processors monitor incoming transactions and track confirmation status through API calls, triggering order fulfillment once a payment reaches sufficient depth.
  • Fee optimization: applications query fee estimation endpoints to set appropriate fee rates for transactions based on current mempool conditions. The fee estimation algorithm comparison covers how different providers calculate their estimates.
  • Chain analysis and compliance: chain analysis tools query explorer APIs to trace fund flows, identify address clusters, and flag suspicious activity for regulatory compliance.
  • Transaction broadcasting: applications use the POST endpoint to submit signed transactions to the Bitcoin network without running their own node. The API relays the raw transaction to connected peers.
  • Developer tooling: block explorer APIs power testnet and signet faucets, transaction decoders, and debugging tools that help developers inspect on-chain state during development.

Why It Matters

Block explorer APIs are the connective tissue between applications and the Bitcoin blockchain. Nearly every Bitcoin application that is not a full node depends on some form of explorer API to read chain state. When a wallet shows your balance, when a payment processor confirms a deposit, when an analytics tool charts network activity: all of these rely on indexed blockchain data exposed through an API.

For developers building on Bitcoin Layer 2 solutions like Spark, block explorer APIs remain relevant for monitoring on-chain entry and exit transactions. While most activity within Spark happens off-chain for speed and privacy, the bridge transactions that move funds between Layer 1 and Layer 2 are visible on-chain and can be tracked through standard explorer APIs. For a deeper look at how different indexer backends compare in performance and resource requirements, see the article on Electrum server architecture.

Risks and Considerations

Privacy and IP Correlation

Every API request reveals information to the service operator. When you query an address, the operator learns that someone at your IP address is interested in that address. Over time, these queries build a profile: the operator can correlate your IP with the addresses you check, the transactions you look up, and the fee estimates you request (which hint at when you are about to send a transaction).

This metadata is valuable for chain analysis. Even without knowing your identity directly, an IP-to-address mapping can be combined with other data sources (exchange KYC records, ISP logs) to deanonymize users. Mitigations include routing API requests through Tor, using a VPN, or self-hosting an explorer. Both Esplora and mempool.space support Tor access on their public instances.

Trust and Data Integrity

When you query a third-party API, you trust that the operator is running an honest node and returning accurate data. A malicious or compromised API could lie about transaction confirmations, omit UTXOs from address queries, or return incorrect fee estimates. For applications handling significant funds, this is a meaningful risk.

Unlike querying your own Bitcoin RPC interface, where you control the node and can verify data against the consensus rules yourself, a third-party API is an opaque intermediary. Querying multiple independent APIs and cross-checking results can mitigate this risk, but it adds complexity. Running an Electrum server alongside your own node is a more robust solution.

Rate Limits and Availability

Free tiers on third-party APIs impose strict rate limits: BlockCypher caps at 3 requests per second, Blockchair at 30 requests per minute, and mempool.space at approximately 10 requests per second. These limits are fine for personal projects but can become a bottleneck for production applications with many users.

Exceeding rate limits returns HTTP 429 errors, and repeated violations can result in temporary or permanent IP bans. Applications that depend on a single third-party API also face availability risk: if the provider experiences downtime, the application loses access to blockchain data entirely. Production systems should either self-host or implement fallback logic across multiple providers.

Censorship and Filtering

Third-party API operators can choose to filter or censor certain transactions, addresses, or blocks from their responses. While this is rare among established providers, it remains a structural risk of relying on an intermediary. A self-hosted explorer connected to your own full node is the only way to guarantee unfiltered access to blockchain data.

This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.