BlockCypher
BlockCypher
- bitcoin
- litecoin
- dogecoin
- Chains
- 3
- Auth
- none
- Operations
- 5 of 12
Operations
- balance
getBalanceserved - history
getTxHistoryserved - tx detail
getTxDetailserved - outspends
getOutspendsabsent - tx hex
getTxHexabsent - utxos
getUtxosserved - pubkey
getPubkeyabsent - contract
getContractInfoabsent - tokens
getTokenBalancesabsent - transfers
getTokenTransfersabsent - gas
getGasDataabsent - block
getBlockInfoserved
Access
- Create
create("blockcypher") - Import
@agntn/explorers/providers/blockcypher - Host
api.blockcypher.com/v1 - Statusproviders on the docs worker
Address it
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
| Operation | Route |
|---|---|
| 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. baseUrldefaults tohttps://api.blockcypher.com/v1. The provider addsbtc/main,ltc/mainordoge/main. Without a chain or an address that identifies one, it reads Bitcoin. Other chains throwUnsupportedChainError.@agntn/chainschecks addresses before a request. A typo costs none of that hourly budget. Uppercase bech32 goes out lowercase. Litecoin3...addresses are refused: Litecoin writes P2SH asM....- History is newest first.
sort: "asc"throws before a request.startBlockandendBlockare inclusive. BlockCypher's bounds are exclusive, so the provider sendsafter = startBlock - 1andbefore = endBlock + 1. Negative or reversed ranges throw. limitgoes up to 50, andpage * limitup to 200. A/fullpage 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 throwsExplorerError. - Transaction reads request up to 1000 inputs and outputs. BlockCypher otherwise stops at 20. A bigger one throws an
ExplorerErrorwith its hash, because half a list counts the wrong amount. - From an address, a transaction is a send when an input spent from it.
valueis what went to everyone else.tois the first of them. Otherwise, it's a receive andvalueis what landed there. A transaction read without an address takes the first paying output. balanceis confirmed.unconfirmedis the signed mempool change, negative while a spend waits.fundedis total received andspenttotal sent. The endpoint sends no height, soblockNumberis null.- BlockCypher puts mempool transactions at height -1. They read as
pendingat block 0, without a timestamp. A mempool one that lost a double spend reads asfailed. - 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.blockHashis always null. - Blocks include version, merkle root, bits, nonce and size. BlockCypher sends no difficulty, median time or weight.
mineris empty. A block past the tip throwsNotFoundError. A missing transaction does too, naming the hash. - OP_RETURN pushes go into
opReturnfrom output scripts. Ordinals inscriptions come from input witnesses.
Where it lives
src/providers/blockcypher.ts.