Providers

BlockCypher

Bitcoin, Litecoin and Dogecoin through BlockCypher. No key, a hundred requests an hour, and the Litecoin fallback when litecoinspace.org stalls.
IDblockcypher23 / 23keyless
Provider

BlockCypher

  • bitcoin
  • litecoin
  • dogecoin
Chains
3
Auth
none
Operations
5 of 12
served 5 / 12

Operations

  • balancegetBalanceserved
  • historygetTxHistoryserved
  • tx detailgetTxDetailserved
  • outspendsgetOutspendsabsent
  • tx hexgetTxHexabsent
  • utxosgetUtxosserved
  • pubkeygetPubkeyabsent
  • contractgetContractInfoabsent
  • tokensgetTokenBalancesabsent
  • transfersgetTokenTransfersabsent
  • gasgetGasDataabsent
  • blockgetBlockInfoserved

Access

Createcreate("blockcypher")
Import@agntn/explorers/providers/blockcypher
Hostapi.blockcypher.com/v1
Statusproviders on the docs worker

Address it

ts
import { BlockCypher } from "@agntn/explorers/providers/blockcypher";

const cypher = new BlockCypher(); // or create("blockcypher")
await cypher.getBalance("LPo6JkP8usUMayqvVHQWdCZSDPTH3fhYrv", "litecoin");
await cypher.getUtxos("DR7EKP5k7x29XWPwSPFtyJNVzuBRHhqcZh", "dogecoin");

BlockCypher reads Bitcoin, Litecoin and Dogecoin without a key, and the provider never sends one. The catch is the budget. A hundred requests an hour, where other explorers hand out thousands a day. So it's the second opinion, not the crawler.

Litecoin starts on Mempool at litecoinspace.org. When that read times out, gets a 5xx or hits a limit, it moves here. Blockchair comes after it, and keyless Blockchair likes to block the IP asking. Two doors that can shut on the same day. This is the third.

Dogecoin starts here and falls back to Blockchair. With BLOCKCHAIR_API_KEY set, the order flips. Bitcoin doesn't change at all, Mempool first and Blockstream after. BlockCypher answers Bitcoin only when you name it, with -p blockcypher or create("blockcypher").

What it reads

OperationRoute
balance/addrs/{address}/balance
history/addrs/{address}/full
one transaction/txs/{hash}
unspent outputs/addrs/{address}?unspentOnly=true
block/blocks/{height}

No gas, outspends, public keys, tokens or contracts. BlockCypher quotes fees per kilobyte, with nothing to turn them into sat/vB. A spent output names the transaction that spent it, but not the input or the block. Half an answer, so getOutspends stays out. Public keys aren't read yet.

Gotchas

  • The keyless budget is 3 requests per second and 100 per hour. It resets at the top of the hour UTC. Exceed it and HTTP 429 becomes a RateLimitError.
  • baseUrl defaults to https://api.blockcypher.com/v1. The provider adds btc/main, ltc/main or doge/main. Without a chain or an address that identifies one, it reads Bitcoin. Other chains throw UnsupportedChainError.
  • @agntn/chains checks addresses before a request. A typo costs none of that hourly budget. Uppercase bech32 goes out lowercase. Litecoin 3... addresses are refused: Litecoin writes P2SH as M....
  • History is newest first. sort: "asc" throws before a request. startBlock and endBlock are inclusive. BlockCypher's bounds are exclusive, so the provider sends after = startBlock - 1 and before = endBlock + 1. Negative or reversed ranges throw.
  • limit goes up to 50, and page * limit up to 200. A /full page counts the address's inputs and outputs, not transactions. One sweep with 217 inputs fills a page on its own. Asked for three and got one? That's why, and the page may not even mention there's more.
  • The provider walks below the previous page's lowest block. It makes at most four requests per call. A busy address can return fewer rows than limit. A page those requests can't reach throws ExplorerError.
  • Transaction reads request up to 1000 inputs and outputs. BlockCypher otherwise stops at 20. A bigger one throws an ExplorerError with its hash, because half a list counts the wrong amount.
  • From an address, a transaction is a send when an input spent from it. value is what went to everyone else. to is the first of them. Otherwise, it's a receive and value is what landed there. A transaction read without an address takes the first paying output.
  • balance is confirmed. unconfirmed is the signed mempool change, negative while a spend waits. funded is total received and spent total sent. The endpoint sends no height, so blockNumber is null.
  • BlockCypher puts mempool transactions at height -1. They read as pending at block 0, without a timestamp. A mempool one that lost a double spend reads as failed.
  • Unspent outputs come in pages of 2000, with three pages at most. More throws instead of silently cutting the list short. Mempool outputs come first and have null blockNumber. blockHash is always null.
  • Blocks include version, merkle root, bits, nonce and size. BlockCypher sends no difficulty, median time or weight. miner is empty. A block past the tip throws NotFoundError. A missing transaction does too, naming the hash.
  • OP_RETURN pushes go into opReturn from output scripts. Ordinals inscriptions come from input witnesses.

Where it lives

src/providers/blockcypher.ts.