NAV
cURL JavaScript Ruby Python Go PHP

Introduction

Copy to Clipboard
# _ _ # |_) | _ _ | / ._ |_ _ ._ # |_) | (_) (_ |< \_ \/ |_) | | (/_ | # / |

Welcome to BlockCypher's API documentation! BlockCypher is a simple, mostly RESTful JSON API for interacting with blockchains, accessed over HTTP or HTTPS from the api.blockcypher.com domain. Currently, BlockCypher supports Bitcoin, Ethereum, Litecoin, Dash, Dogecoin, Bitcoin Testnet3, and BlockCypher's Test Chain (more about BlockCypher's Test Chain below).

BlockCypher's API provides a superset of the endpoints you'd find in reference implementations, in addition to some special features that make BlockCypher uniquely powerful, like our unconfirmed transaction Confidence Factor, dependable WebHook or WebSockets-based Events, and Address Forwarding.

Consequently, if you're familiar with a blockchain's reference implementation, you'll feel at home using BlockCypher, but without worrying about scaling or implementation challenges. And if you're not familiar---with the reference implementations or blockchains in general---BlockCypher's API is a great way to dip your toes into blockchain development, without a lengthy setup process. In either case, BlockCypher has 99.99% up-time, and maintains an expressive, logical API that you'll love.

Documentation Structure

Copy to Clipboard
man curl | grep -A 3 "DESCRIPTION" DESCRIPTION curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP). The command is designed to work without user interaction.

In these docs you'll find everything you need to leverage BlockCypher for your applications. For all officially supported languages, you'll see code samples, in addition to basic cURL requests/responses for every endpoint. You can switch between cURL/language samples via the selector in the upper right. We're working on supporting more languages, but if you're working on your own language library, definitely let us know: we'd love to add more community supported libraries here.

Section Summaries

In-Browser Code Examples

We know many learn more from code examples than specific reference documentation, which is why we have code samples in our official languages. In addition, we have a number of in-browser code examples for particular use cases, which you can see here:

Changelog and Errors

Our documentation is powered by GitHub Pages and Slate, which makes viewing changes as simple as checking the git commit history. If there's an error or you'd like to suggest a change, please consider submitting a pull request to benefit the broader BlockCypher community.

API Versions

All API calls are versioned, and the current BlockCypher API is v1. We will never introduce any breaking changes within v1, but we may add new, non-breaking features from time to time.

BlockCypher Supported Language SDKs

BlockCypher has client SDKs for the following languages:

If you're using these languages, we strongly encourage you to use an official SDK. Of course, all our API calls are standard HTTP endpoints using JSON formatted responses, so any language (or cURL from the command-line) will work just fine.

Deprecated SDKs

Due to the lack of usage, the following SDKs have been deprecated and as such will not be updated:

You can still use them but beware that there might be some bugs or missing features.

Unofficial Libraries

This client SDK was made by the community, and is not officially supported by BlockCypher. As such, BlockCypher cannot guarantee that it's fully up to date, but we hope it will provide a nice jumping-off point for developers using this language. We'll endeavor to keep this list updated, if any of these prove obsolete. If there's enough support for a particular language, we'll work with the community to turn it into an officially supported SDK.

Postman Collection

If your favorite language is not listed above or if you prefers using raw queries, be sure to check our Postman Collection documentation.

RESTful Resources

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main { "name": "BTC.main", "height": 360060, "hash": "000000000000000000bf56ff4a81e399374a68344a64d6681039412de78366b8", "time": "2015-06-08T22:57:08.260165627Z", "latest_url": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000000bf56ff4a81e399374a68344a64d6681039412de78366b8", "previous_hash": "000000000000000011c9511ae1265d34d3c16fff6e8f94380425833b3d0ae5d8", "previous_url": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000011c9511ae1265d34d3c16fff6e8f94380425833b3d0ae5d8", "peer_count": 239, "unconfirmed_count": 617, "high_fee_per_kb": 46086, "medium_fee_per_kb": 29422, "low_fee_per_kb": 12045, "last_fork_height": 359865, "last_fork_hash": "00000000000000000aa6462fd9faf94712ce1b5a944dc666f491101c996beab9" }

Almost all resources exist under a given blockchain, and follow this pattern:

https://api.blockcypher.com/$API_VERSION/$COIN/$CHAIN/

Currently, there's only one version of the API (v1). Thus, here's an exhaustive list of blockchains and their corresponding resources:

Coin Chain Resource
Bitcoin Main api.blockcypher.com/v1/btc/main
Bitcoin Testnet3 api.blockcypher.com/v1/btc/test3
Dash Main api.blockcypher.com/v1/dash/main
Dogecoin Main api.blockcypher.com/v1/doge/main
Litecoin Main api.blockcypher.com/v1/ltc/main
BlockCypher Test api.blockcypher.com/v1/bcy/test

Rate Limits and Tokens

Copy to Clipboard
# Adding your token as URL parameter curl https://api.blockcypher.com/v1/btc/main?token=$YOURTOKEN # Checking your token's limits curl https://api.blockcypher.com/v1/tokens/$YOURTOKEN { "token": "YOURTOKEN", "limits": { "api/hour": 10000, "api/second": 500, "hooks/hour": 5000, "confidence/hour": 1000, "hooks": 5000, "payments": 5000 }, "hits": { "api/hour": 280, "hooks/hour": 240, "confidence/hour": 100 }, "hits_history": { { "api/hour": 253, "confidence/hour": 50, "time": "2016-06-15T07:00:00-00:00", "hooks": 358, }, { "api/hour": 2, "hooks/hour": 30, "time": "2016-06-15T06:00:00-00:00" "hooks": 358, }, ... } } # These are quite above the default limits, but if you'd like them, reach out at contact@blockcypher.com ;)

We want everyone to try BlockCypher with as little friction as possible, which is why you don't need a token for any read-only GET calls. Please register for a user token if you want to use POST and DELETE calls. Once you have your token, you can append it to all your requests like any other URL parameter if you're using cURL, or through the appropriate method in the language SDK you're using.

We do rate-limit our free tier, with or without a token (though tokens are required for Confidence lookups, WebHooks/Sockets, Payments, and any POST or DELETE calls):

The hourly rate limits reset on the top of the hour UTC. For example, if you're under the free tier, and you have used 100 regular requests by 03:58 UTC, you'll hit a rate limit until it resets at 04:00 UTC.

On the accounts page, you'll find paid plans starting at $119 a month (with a 10% discount if you pay with Bitcoin). To request higher limits or SLAs beyond what's offered on the accounts page, please email us.

You can check your current limits and usage via a GET on the following endpoint, outside of our normal coin/chain pattern:

https://api.blockcypher.com/v1/tokens/$YOURTOKEN

Within that return object, you'll also find hits_history array, which shows your token's last 48 hours of usage, while hits shows the current hour's usage.

You can even see information about your remaining limits by checking the X-Ratelimit-Remaining attribute in the HTTP header in normal API calls. Keep in mind the X-Ratelimit-Remaining attribute corresponds to the hourly rate limit associated with the endpoint you call (e.g., if it's from a WebHook, that corresponds to the Hooks/Hour; if it's a normal call, the number corresponds to the normal Requests/Hour limit).

Batching

Copy to Clipboard
# Batching blocks 5, 6, and 7 curl 'https://api.blockcypher.com/v1/btc/main/blocks/5;6;7' [{ "hash": "000000003031a0e73735690c5a1ff2a4be82553b2a12b776fbd3a215dc8f778d", "height": 6, "chain": "BTC.main", "total": 0, "fees": 0, "ver": 1, "time": "2009-01-09T03:29:49Z", ..., }, { "hash": "000000009b7262315dbf071787ad3656097b892abffd1f95a1a022f896f533fc", "height": 5, "chain": "BTC.main", "total": 0, "fees": 0, "ver": 1, "time": "2009-01-09T03:23:48Z", ..., }, { "hash": "0000000071966c2b1d065fd446b1e485b2c9d9594acd2007ccbd5441cfc89444", "height": 7, "chain": "BTC.main", "total": 0, "fees": 0, "ver": 1, "time": "2009-01-09T03:39:29Z", ..., }]

All endpoints that can retrieve a single Object can be batched to return multiple objects. If you're cURLing the API directly, batching simply requires appending each identifier to the previous one using a semicolon (check the code pane for an example). The results are aggregated in a JSON array. The other supported client SDKs batch differently, but each idiomatic to their respective language (check the code pane examples in each library).

When cURLing BlockCypher, batching also works when the identifiers aren't the last part of the URL; e.g., this URL will return the balances of three separate addresses:

https://api.blockcypher.com/v1/btc/main/addrs/1J38WorKngZLJvA7qMin9g5jqUfTQUBZNE;1JP8FqoXtCMrR1sZc2McLWmHxENox1Y1PV;1ENn7XmqXNnReiQEFHhBGzfiv5gAyBj7r1/balance

Testing

We offer an automated faucets for BlockCypher's Test Chain. We recommend using BlockCypher's Test Chain for a variety of reasons:

In case you missed the Resources section, the BlockCypher Test Chain is accessible from this resource:

https://api.blockcypher.com/v1/bcy/test

Copy to Clipboard
# Note resource change to bcy/test instead of btc/main # Make new address; returns private key/public key/address curl -X POST https://api.blockcypher.com/v1/bcy/test/addrs?token=$YOURTOKEN { "private": "26415016a2fb49f51aef161cb35bd537be07b75a6ac1e297d3b7a370cc85433b", "public": "02c572d062fefcc8c3e1bf5016450addcedb89cd7e4507d8a323f327b4ad1018e0", "address": "CFqoZmZ3ePwK5wnkhxJjJAQKJ82C7RJdmd" } # Fund prior address with faucet curl -d '{"address": "CFqoZmZ3ePwK5wnkhxJjJAQKJ82C7RJdmd", "amount": 100000}' https://api.blockcypher.com/v1/bcy/test/faucet?token=$YOURTOKEN { "tx_ref": "02dbf5585d438a1cba82a9041dd815635a6b0df684225cb5271e11397a759479" }

Test Faucets

To help facilitate automated testing in your applications, a faucet endpoint is available on BlockCypher's Test Chain. Calling the faucet endpoint, along with passing a valid address, will automatically create---and propagate---a new transaction funding the address with the amount you provide.

This example shows how to leverage the faucet to programmatically fund addresses, to test your applications.

Objects

Copy to Clipboard
# All cURL'd Objects are JSON: { key: value, key: value, }

Before diving into BlockCypher's endpoints, this section details all the Objects exposed and expected by the API. Some of you might be more interested in the endpoints themselves, in which case, feel free to skip to the next section. But for others, a section dedicated to all of BlockCypher's Objects might prove a useful overview, especially if you're new to Blockchain development in general. And in either case, this section provides a comprehensive reference for Objects in the API. For each Object there's a description and a link to a germane API endpoint.

Blockchain

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main { "name": "BTC.main", "height": 360060, "hash": "000000000000000000bf56ff4a81e399374a68344a64d6681039412de78366b8", "time": "2015-06-08T22:57:08.260165627Z", "latest_url": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000000bf56ff4a81e399374a68344a64d6681039412de78366b8", "previous_hash": "000000000000000011c9511ae1265d34d3c16fff6e8f94380425833b3d0ae5d8", "previous_url": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000011c9511ae1265d34d3c16fff6e8f94380425833b3d0ae5d8", "peer_count": 239, "unconfirmed_count": 617, "high_fee_per_kb": 46086, "medium_fee_per_kb": 29422, "low_fee_per_kb": 12045, "last_fork_height": 359865, "last_fork_hash": "00000000000000000aa6462fd9faf94712ce1b5a944dc666f491101c996beab9" }

A Blockchain represents the current state of a particular blockchain from the Coin/Chain resources that BlockCypher supports. Typically returned from the Chain API endpoint.

Attribute Type Description
name string The name of the blockchain represented, in the form of $COIN.$CHAIN.
height integer The current height of the blockchain; i.e., the number of blocks in the blockchain.
hash string The hash of the latest confirmed block in the blockchain; in Bitcoin, the hashing function is SHA256(SHA256(block)).
time time The time of the latest update to the blockchain; typically when the latest block was added.
latest_url url The BlockCypher URL to query for more information on the latest confirmed block; returns a Block.
previous_hash string The hash of the second-to-latest confirmed block in the blockchain.
previous_url url The BlockCypher URL to query for more information on the second-to-latest confirmed block; returns a Block.
peer_count integer N/A, will be deprecated soon.
high_fee_per_kb integer A rolling average of the fee (in satoshis) paid per kilobyte for transactions to be confirmed within 1 to 2 blocks.
medium_fee_per_kb integer A rolling average of the fee (in satoshis) paid per kilobyte for transactions to be confirmed within 3 to 6 blocks.
low_fee_per_kb integer A rolling average of the fee (in satoshis) paid per kilobyte for transactions to be confirmed in 7 or more blocks.
unconfirmed_count integer Number of unconfirmed transactions in memory pool (likely to be included in next block).
last_fork_height integer Optional The current height of the latest fork to the blockchain; when no competing blockchain fork present, not returned with endpoints that return Blockchains.
last_fork_hash string Optional The hash of the latest confirmed block in the latest fork of the blockchain; when no competing blockchain fork present, not returned with endpoints that return Blockchains.

Block

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000003dc20b868d17121303308f6bba329302e75913f0790db { "hash": "000000000000000000058b0392acad50a141c980a0137fa381eed4bb9da2266b", "height": 670850, "chain": "BTC.main", "total": 2666972965896, "fees": 131055032, "size": 1337178, "vsize": 999378, "ver": 939515904, "time": "2021-02-16T14:30:47Z", "received_time": "2021-02-16T14:30:50.082Z", "coinbase_addr": "", "relayed_by": "100.19.55.173:8333", "bits": 386736569, "nonce": 3721541004, "n_tx": 3238, "prev_block": "00000000000000000007d284fb11be7e6adcc81d05177f05ff5ba6b906f151d2", "mrkl_root": "67ebfe25f76df77fe4c46e9474a4bcdaeb71034da6fc3509fdd2c6d0817b9de8", "txids": [ "67f0821545bbfd815d2fc37dd24b945b76dcebb7b78f7dafbe55c5d09418a63e", "c537f4241a77391e3fb39c9d42157b0c040542ef3f08f5bd1903d5dc87175691", ..., ], "depth": 292, "prev_block_url": "https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000007d284fb11be7e6adcc81d05177f05ff5ba6b906f151d2", "tx_url": "https://api.blockcypher.com/v1/btc/main/txs/", "next_txids": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000000058b0392acad50a141c980a0137fa381eed4bb9da2266b?txstart=20\u0026limit=20" }

A Block represents the current state of a particular block from a Blockchain. Typically returned from the Block Hash and Block Height endpoints.

Attribute Type Description
hash string The hash of the block; in Bitcoin, the hashing function is SHA256(SHA256(block))
height integer The height of the block in the blockchain; i.e., there are height earlier blocks in its blockchain.
depth integer The depth of the block in the blockchain; i.e., there are depth later blocks in its blockchain.
chain string The name of the blockchain represented, in the form of $COIN.$CHAIN
total integer The total number of satoshis transacted in this block.
fees integer The total number of fees---in satoshis---collected by miners in this block.
size integer Optional Raw size of block (including header and all transactions) in bytes. Not returned for bitcoin blocks earlier than height 389104.
vsize integer Optional Raw size of block (including header and all transactions) in virtual bytes. Not returned for bitcoin blocks earlier than height 670850.
ver integer Block version.
time time Recorded time at which block was built. Note: Miners rarely post accurate clock times.
received_time time The time BlockCypher's servers receive the block. Our servers' clock is continuously adjusted and accurate.
relayed_by string Address of the peer that sent BlockCypher's servers this block.
bits integer The block-encoded difficulty target.
nonce integer The number used by a miner to generate this block.
n_tx integer Number of transactions in this block.
prev_block string The hash of the previous block in the blockchain.
prev_block_url url The BlockCypher URL to query for more information on the previous block.
tx_url url The base BlockCypher URL to receive transaction details. To get more details about specific transactions, you must concatenate this URL with the desired transaction hash(es).
mrkl_root string The Merkle root of this block.
txids array[string] An array of transaction hashes in this block. By default, only 20 are included.
next_txids url Optional If there are more transactions that couldn't fit in the txids array, this is the BlockCypher URL to query the next set of transactions (within a Block object).

TX

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449 { "block_hash": "0000000000000000c504bdea36e531d80...", "block_height": 293000, "hash": "f854aebae95150b379cc1187d848d58225f3c41...", "addresses": [ "13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy", "19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L", "1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy", "1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq", "1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV" ], "total": 70320221545, "fees": 0, "size": 636, "vsize": 636, "preference": "low", "relayed_by": "", "confirmed": "2014-03-29T01:29:19Z", "received": "2014-03-29T01:29:19Z", "ver": 1, "lock_time": 0, "double_spend": false, "vin_sz": 4, "vout_sz": 1, "confirmations": 63171, "inputs": [ { "prev_hash": "583910b7bf90ab802e22e5c25a89...", "output_index": 1, "script": "4830450220504b1ccfddf508422bdd8...", "output_value": 16450000, "sequence": 4294967295, "addresses": [ "1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq" ], "script_type": "pay-to-pubkey-hash" }, ..., ..., ], "outputs": [ { "value": 70320221545, "script": "76a914e6aad9d712c419ea8febf009a...", "spent_by": "35832d6c70b98b54e9a53ab2d5117...", "addresses": [ "1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV" ], "script_type": "pay-to-pubkey-hash" } ] }

A TX represents the current state of a particular transaction from either a Block within a Blockchain, or an unconfirmed transaction that has yet to be included in a Block. Typically returned from the Unconfirmed Transactions and Transaction Hash endpoints.

Attribute Type Description
block_height integer Height of the block that contains this transaction. If this is an unconfirmed transaction, it will equal -1.
hash string The hash of the transaction. While reasonably unique, using hashes as identifiers may be unsafe.
addresses array[string] Array of bitcoin public addresses involved in the transaction.
total integer The total number of satoshis exchanged in this transaction.
fees integer The total number of fees---in satoshis---collected by miners in this transaction.
size integer The size of the transaction in bytes.
vsize integer The virtual size of the transaction in bytes.
preference string The likelihood that this transaction will make it to the next block; reflects the preference level miners have to include this transaction. Can be high, medium or low.
relayed_by string Address of the peer that sent BlockCypher's servers this transaction.
received time Time this transaction was received by BlockCypher's servers.
ver integer Version number, typically 1 for Bitcoin transactions.
lock_time integer Time when transaction can be valid. Can be interpreted in two ways: if less than 500 million, refers to block height. If more, refers to Unix epoch time.
double_spend bool true if this is an attempted double spend; false otherwise.
vin_sz integer Total number of inputs in the transaction.
vout_sz integer Total number of outputs in the transaction.
confirmations integer Number of subsequent blocks, including the block the transaction is in. Unconfirmed transactions have 0 confirmations.
inputs array[TXInput] TXInput Array, limited to 20 by default.
outputs array[TXOutput] TXOutput Array, limited to 20 by default.
opt_in_rbf bool Optional Returns true if this transaction has opted in to Replace-By-Fee (RBF), either true or not present. You can read more about Opt-In RBF here.
confidence float Optional The percentage chance this transaction will not be double-spent against, if unconfirmed. For more information, check the section on Confidence Factor.
confirmed time Optional Time at which transaction was included in a block; only present for confirmed transactions.
receive_count integer Optional Number of peers that have sent this transaction to BlockCypher; only present for unconfirmed transactions.
change_address string Optional Address BlockCypher will use to send back your change, if you constructed this transaction. If not set, defaults to the address from which the coins were originally sent.
block_hash string Optional Hash of the block that contains this transaction; only present for confirmed transactions.
block_index integer Optional Canonical, zero-indexed location of this transaction in a block; only present for confirmed transactions.
double_of string Optional If this transaction is a double-spend (i.e. double_spend == true) then this is the hash of the transaction it's double-spending.
data_protocol string Optional Returned if this transaction contains an OP_RETURN associated with a known data protocol. Data protocols currently detected: blockchainid ; openassets ; factom ; colu ; coinspark ; omni
hex string Optional Hex-encoded bytes of the transaction, as sent over the network.
next_inputs url Optional If there are more transaction inptus that couldn't fit into the TXInput array, this is the BlockCypher URL to query the next set of TXInputs (within a TX object).
next_outputs url Optional If there are more transaction outputs that couldn't fit into the TXOutput array, this is the BlockCypher URL to query the next set of TXOutputs(within a TX object).

TXInput

Copy to Clipboard
{ "prev_hash": "e5c9be87798b0fa8ad55a22b5d731d6f50d72bffaa6179f9999499e57388cc33", "output_index": 1, "script": "004730440220689409a16c98fa1659cae4c20...", "output_value": 2450698356, "sequence": 4294967295, "addresses": [ "34ch2jrhYXDFsLK1FZQ3SjqgFRnX8mGC5W" ], "script_type": "pay-to-script-hash", "age": 5 }

A TXInput represents an input consumed within a transaction. Typically found within an array in a TX. In most cases, TXInputs are from previous UTXOs, with the most prominent exceptions being attempted double-spend and coinbase inputs.

Attribute Type Description
prev_hash string The previous transaction hash where this input was an output. Not present for coinbase transactions.
output_index integer The index of the output being spent within the previous transaction. Not present for coinbase transactions.
output_value integer The value of the output being spent within the previous transaction. Not present for coinbase transactions.
script_type string The type of script that encumbers the output corresponding to this input.
script string Raw hexadecimal encoding of the script.
addresses array[string] An array of public addresses associated with the output of the previous transaction.
sequence integer Legacy 4-byte sequence number, not usually relevant unless dealing with locktime encumbrances.
age integer Optional Number of confirmations of the previous transaction for which this input was an output. Currently, only returned in unconfirmed transactions.
wallet_name string Optional Name of Wallet or HDWallet from which to derive inputs. Only used when constructing transactions via the Creating Transactions process.
wallet_token string Optional Token associated with Wallet or HDWallet used to derive inputs. Only used when constructing transactions via the Creating Transactions process.

TXOutput

Copy to Clipboard
{ "value": 70320221545, "script": "76a914e6aad9d712c419ea8febf009a3f3bfdd8d222fac88ac", "spent_by": "35832d6c70b98b54e9a53ab2d51176eb19ad11bc4505d6bb1ea6c51a68cb92ee", "addresses": [ "1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV" ], "script_type": "pay-to-pubkey-hash" }

A TXOutput represents an output created by a transaction. Typically found within an array in a TX.

Attribute Type Description
value int Value in this transaction output, in satoshis.
script string Raw hexadecimal encoding of the encumbrance script for this output.
addresses array[string] Addresses that correspond to this output; typically this will only have a single address, and you can think of this output as having "sent" value to the address contained herein.
script_type string The type of encumbrance script used for this output.
spent_by string Optional The transaction hash that spent this output. Only returned for outputs that have been spent. The spending transaction may be unconfirmed.
data_hex string Optional A hex-encoded representation of an OP_RETURN data output, without any other script instructions. Only returned for outputs whose script_type is null-data.
data_string string Optional An ASCII representation of an OP_RETURN data output, without any other script instructions. Only returned for outputs whose script_type is null-data and if its data falls into the visible ASCII range.

TXConfidence

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/txs/43fa951e1bea87c282f6725cf8bdc08bb48761396c3af8dd5a41a085ab62acc9/confidence { "age_millis": 12725, "receive_count": 666, "confidence": 0.9901509730004237, "txhash": "43fa951e1bea87c282f6725cf8bdc08bb48761396c3af8dd5a41a085ab62acc9", "txurl": "https://api.blockcypher.com/v1/btc/main/txs/43fa951e1bea87c282f6725cf8bdc08bb48761396c3af8dd5a41a085ab62acc9" }

A TXConfidence represents information about the confidence that an unconfirmed transaction will make it into the next block. Typically used as a return object from the Transaction Confidence Endpoint.

Attribute Type Description
age_millis integer The age of the transaction in milliseconds, based on the earliest time BlockCypher saw it relayed in the network.
receive_count integer Number of peers that have sent this transaction to BlockCypher; only positive for unconfirmed transactions. -1 for confirmed transactions.
confidence float A number from 0 to 1 representing BlockCypher's confidence that the transaction won't be double-spent against.
txhash string The hash of the transaction. While reasonably unique, using hashes as identifiers may be unsafe.
txurl url The BlockCypher URL one can use to query more detailed information about this transaction.

TXRef

Copy to Clipboard
{ "tx_hash": "14b1052855bbf6561bc4db8aa501762e7cc1e86994dda9e782a6b73b1ce0dc1e", "block_height": 302013, "tx_input_n": -1, "tx_output_n": 0, "value": 20213, "ref_balance": 4433416, "spent": false, "confirmations": 54405, "confirmed": "2014-05-22T03:46:25Z", "double_spend": false }

A TXRef object represents summarized data about a transaction input or output. Typically found in an array within an Address object, which is usually returned from the standard Address Endpoint.

Attribute Type Description
address string Optional The address associated with this transaction input/output. Only returned when querying an address endpoint via a wallet/HD wallet name.
block_height integer Height of the block that contains this transaction input/output. If it's unconfirmed, this will equal -1.
tx_hash string The hash of the transaction containing this input/output. While reasonably unique, using hashes as identifiers may be unsafe.
tx_input_n integer Index of this input in the enclosing transaction. It's a negative number for an output.
tx_output_n integer Index of this output in the enclosing transaction. It's a negative number for an input.
value integer The value transfered by this input/output in satoshis exchanged in the enclosing transaction.
preference string The likelihood that the enclosing transaction will make it to the next block; reflects the preference level miners have to include the enclosing transaction. Can be high, medium or low.
spent bool true if this is an output and was spent. If it's an input, or an unspent output, it will be false.
double_spend bool true if this is an attempted double spend; false otherwise.
confirmations integer Number of subsequent blocks, including the block the transaction is in. Unconfirmed transactions have 0 confirmations.
script string Optional Raw, hex-encoded script of this input/output.
ref_balance integer Optional The past balance of the parent address the moment this transaction was confirmed. Not present for unconfirmed transactions.
confidence float Optional The percentage chance this transaction will not be double-spent against, if unconfirmed. For more information, check the section on Confidence Factor.
confirmed time Optional Time at which transaction was included in a block; only present for confirmed transactions.
spent_by string Optional The transaction hash that spent this output. Only returned for outputs that have been spent. The spending transaction may be unconfirmed.
received time Optional Time this transaction was received by BlockCypher's servers; only present for unconfirmed transactions.
receive_count integer Optional Number of peers that have sent this transaction to BlockCypher; only present for unconfirmed transactions.
double_of string Optional If this transaction is a double-spend (i.e. double_spend == true) then this is the hash of the transaction it's double-spending.

TXSkeleton

Copy to Clipboard
# Note resource change to bcy/test instead of btc/main curl -d '{"inputs":[{"addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"]}],"outputs":[{"addresses": ["C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn"], "value": 1000000}]}' https://api.blockcypher.com/v1/bcy/test/txs/new { "tx": { "block_height": -1, "block_index": 0, "hash": "4d6e32d71313fb548232642fd...", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9", "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "total": 5419600, "fees": 12500, "size": 119, ... }, "tosign": [ "97d81abd54cae1648951f49..." ], "errors": [ { "error": "..." } ], "signatures": [], "pubkeys": [] }

A TXSkeleton is a convenience/wrapper Object that's used primarily when Creating Transactions through the New and Send endpoints.

Attribute Type Description
tx TX A temporary TX, usually returned fully filled but missing input scripts.
tosign array[string] Array of hex-encoded data for you to sign, one for each input.
signatures array[string] Array of signatures corresponding to all the data in tosign, typically provided by you.
pubkeys array[string] Array of public keys corresponding to each signature. In general, these are provided by you, and correspond to the signatures you provide.
tosign_tx array[string] Optional Array of hex-encoded, work-in-progress transactions; optionally returned to validate the tosign data locally.
errors array["error":string] Optional Array of errors in the form "error":"description-of-error". This is only returned if there was an error in any stage of transaction generation, and is usually accompanied by a HTTP 400 code.

WitnessToSignTx

Copy to Clipboard
curl -d '{"witness_tosign_tx":"01000000d0fe2d3feb5f3a5b6a99c244f21924b0249e2bc65c5745bdb618b1799066a80a3bb13029ce7b1f559ef5e747fcac439f1455a2ec7c5f09b72290795e706650448b3658589c258fb4b44180f158ae73d4dbaaf26d64c43a97a5cd78d9577f786d010000001976a9141b80a938a784abe7cdee8fdaf95f5f7e0b8cd0b988ac40420f0000000000ffffffff5fa4537c4c565583f8d32a36c3510808d38acc0ad18cc7e637be6523ebb39ff30000000001000000"}' https://api.blockcypher.com/v1/bcy/test/txs/decodeWitnessToSign?token=YOURTOKEN { "version": 1, "hash_prevouts": "0aa8669079b118b6bd45575cc62b9e24b02419f244c2996a5b3a5feb3f2dfed0", "hash_sequence": "445066705e799022b7095f7ceca255149f43acfc47e7f59e551f7bce2930b13b", "outpoint": "6d787f57d978cda5973ac4646df2aadbd473ae58f18041b4b48f259c5858368b", "outpoint_index": 1, "script_code": "76a9141b80a938a784abe7cdee8fdaf95f5f7e0b8cd0b988ac", "value": 1000000, "sequence": 4294967295, "hash_outputs": "f39fb3eb2365be37e6c78cd10acc8ad3080851c3362ad3f88355564c7c53a45f", "lock_time": 0, "sighash_type": 1 } }

A WitnessToSignTx is created when creating a transaction which spend a P2WPKH input and includeToSignTx is set to true.

Attribute Type Description
version integer Version of the transaction.
hash_prevouts string Hash of the previous output.
hash_sequence string Hash sequence.
outpoint string Hash of the outpoint.
outpoint_index integer Outpoint index.
script_code string Script code of the input.
value integer Value of the output spent by this input.
sequence integer Sequence number of the input.
hash_outputs string Hash of the output.
lock_time integer Lock time of the transaction.
sighash_type integer sighash type of the signature.

Address

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/addrs/1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD { "address": "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD", "total_received": 4433416, "total_sent": 0, "balance": 4433416, "unconfirmed_balance": 0, "final_balance": 4433416, "n_tx": 7, "unconfirmed_n_tx": 0, "final_n_tx": 7, "txrefs": [ ... ], "unconfirmed_txrefs": [ ... ] }

An Address represents a public address on a blockchain, and contains information about the state of balances and transactions related to this address. Typically returned from the Address Balance, Address, and Address Full Endpoint.

Attribute Type Description
address string Optional The requested address. Not returned if querying a wallet/HD wallet.
wallet Wallet Optional The requested wallet object. Only returned if querying by wallet name instead of public address.
hd_wallet HDWallet Optional The requested HD wallet object. Only returned if querying by HD wallet name instead of public address.
total_received integer Total amount of confirmed satoshis received by this address.
total_sent integer Total amount of confirmed satoshis sent by this address.
balance integer Balance of confirmed satoshis on this address. This is the difference between outputs and inputs on this address, but only for transactions that have been included into a block (i.e., for transactions whose confirmations > 0).
unconfirmed_balance integer Balance of unconfirmed satoshis on this address. Can be negative (if unconfirmed transactions are just spending outputs). Only unconfirmed transactions (haven't made it into a block) are included.
final_balance integer Total balance of satoshis, including confirmed and unconfirmed transactions, for this address.
n_tx integer Number of confirmed transactions on this address. Only transactions that have made it into a block (confirmations > 0) are counted.
unconfirmed_n_tx integer Number of unconfirmed transactions for this address. Only unconfirmed transactions (confirmations == 0) are counted.
final_n_tx integer Final number of transactions, including confirmed and unconfirmed transactions, for this address.
tx_url url Optional To retrieve base URL transactions. To get the full URL, concatenate this URL with a transaction's hash.
txs array[TX] Optional Array of full transaction details associated with this address. Usually only returned from the Address Full Endpoint.
txrefs array[TXRef] Optional Array of transaction inputs and outputs for this address. Usually only returned from the standard Address Endpoint.
unconfirmed_txrefs array[TXRef] Optional All unconfirmed transaction inputs and outputs for this address. Usually only returned from the standard Address Endpoint.
hasMore bool Optional If true, then the Address object contains more transactions than shown. Useful for determining whether to poll the API for more transaction information.

AddressKeychain

Copy to Clipboard
curl -X POST https://api.blockcypher.com/v1/btc/test3/addrs { "private": "86751cb880a9a1addcc3b67979976158dd800afe9d14b68349921299b20c94dd", "public": "03866586fbe3652eb219c5ed99c3fc72d125472248183f966e0673be08a1c543de", "address": "n1ucSDLByN5GLLQuE7BMrtTWHwHtkaVkfA", "wif": "cS64ygfjWjN73S78oUbJQeikDn9uS7KNWS1PL7NqeBUuF4UobnAy" }

An AddressKeychain represents an associated collection of public and private keys alongside their respective public address. Generally returned and used with the Generate Address Endpoint.

Attribute Type Description
address string Standard address representation.
public string Hex-encoded Public key.
private string Hex-encoded Private key.
wif string Wallet import format, a common encoding for the private key.
pubkeys array[string] Optional Array of public keys to provide to generate a multisig address.
script_type string Optional If generating a multisig address, the type of multisig script; typically "multisig-n-of-m", where n and m are integers.
original_address string Optional If generating an OAP address, this represents the parent blockchain's underlying address (the typical address listed above).
oap_address string Optional The OAP address, if generated using the Generate Asset Address Endpoint.

Wallet

Copy to Clipboard
curl -d '{"name": "alice","addresses": ["1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e"]}' https://api.blockcypher.com/v1/btc/main/wallets?token=YOURTOKEN { "token":"YOURTOKEN", "name": "alice", "addresses": ["1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e"] }
Attribute Type Description
token string User token associated with this wallet.
name string Name of the wallet.
addresses array[string] List of addresses associated with this wallet.

A Wallet contains a list of addresses associated by its name and the user's token. It can be used interchangeably with all the Address API endpoints, and in many places that require addresses, like when Creating Transactions.

The name of a wallet must be 1-25 characters long and cannot start with any characters that start an address for the currency contained in the wallet. For example, bitcoin wallet names cannot start with '1' or '3'.

HDWallet

Copy to Clipboard
curl -d '{"name": "bob", "extended_public_key": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8"}' https://api.blockcypher.com/v1/btc/main/wallets/hd?token=YOURTOKEN {"token": "YOURTOKEN", "name": "bob", "hd": true, "extended_public_key": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8", "chains": [ {"chain_addresses": [ { "address": "1FHz8bpEE5qUZ9XhfjzAbCCwo5bT1HMNAc", "path": "m/0" }, { "address": "1J8QDN1u7iDMbJktbqXPSrAqruNjkmRFmT", "path": "m/1" }, { "address": "1MWNKnYfE2LVdvAzFUioF3F3JXFpRfDCQb", "path": "m/2" } ]} ]}

An HDWallet contains addresses derived from a single seed. Like normal wallets, it can be used interchangeably with all the Address API endpoints, and in many places that require addresses, like when Creating Transactions.

Attribute Type Description
token string User token associated with this HD wallet.
name string Name of the HD wallet.
chains array[HDChain] List of HD chains associated with this wallet, each containing HDAddresses. A single chain is returned if the wallet has no subchains.
hd bool true for HD wallets, not present for normal wallets.
extended_public_key string The extended public key all addresses in the HD wallet are derived from. It's encoded in BIP32 format
subchain_indexes array[integer] optional returned for HD wallets created with subchains.

The name of a wallet must be 1-25 characters long and cannot start with any characters that start an address for the currency contained in the wallet. For example, bitcoin wallet names cannot start with '1' or '3'.

HDChain

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/wallet/hd/bob/addresses?token=YOURTOKEN {"chains": [ {"chain_addresses": [ { "address": "1FHz8bpEE5qUZ9XhfjzAbCCwo5bT1HMNAc", "path": "m/0" }, { "address": "1J8QDN1u7iDMbJktbqXPSrAqruNjkmRFmT", "path": "m/1" }, { "address": "1MWNKnYfE2LVdvAzFUioF3F3JXFpRfDCQb", "path": "m/2" }] } ]}

An array of HDChains are included in every HDWallet and returned from the Get Wallet, Get Wallet Addresses and Derive Address in Wallet endpoints.

Attribute Type Description
chain_addresses array[HDAddress] Array of HDAddresses associated with this subchain.
index integer optional Index of the subchain, returned if the wallet has subchains.

HDAddress

Attribute Type Description
address string Standard address representation.
path string The BIP32 path of the HD address.
public string optional Contains the hex-encoded public key if returned by Derive Address in Wallet endpoint.

An HD Address object contains an address and its BIP32 HD path (location of the address in the HD tree). It also contains the hex-encoded public key when returned from the Derive Address in Wallet endpoint.

OAPIssue

Copy to Clipboard
{ "from_private": "0eb369746401c3369517239...", "to_address": "1C3nrGhUDxBbr393u2Wq4PiE8T6oEYjYhrK", "amount": 200, "metadata": "1a2b3c4d5e6f" }

An OAPIssue represents a request for either issuance or transfer of new assets, as detailed in the Asset API.

Attribute Type Description
from_private string The private key being used to issue or transfer assets.
to_address string The target OAP address assets for issue or transfer.
amount int The amount of assets being issued or transfered.
metadata string Optional Hex-encoded metadata that can optionally be encoded into the issue or transfer transaction.

OAPTX

Copy to Clipboard
{ "ver": 1, "assetid": "1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui", "hash": "022e05bdfa2e148bc1882cb7a81506b8316fee6957b11625126d075a8cf8791b", "confirmed": "2015-10-25T04:50:06Z", "received": "2015-10-25T04:49:32.37Z", "oap_meta": "1a2b3c4d5e6f", "double_spend": false, "inputs": [ { "prev_hash": "56253cffa1b3508d106391da3646cda2aee0bd080db427321c77ad11739e4239", "output_index": 0, "address": "1ByJUiocpifLPaYVTALpA7JYa9DxpGxXKKP", "output_value": 1000 } ], "outputs": [ { "address": "1C3nrGhUDxBbr393u2Wq4PiE8T6oEYjYhrK", "value": 200, "original_output_index": 1 } ] }

An OAPTX represents an Open Assets Protocol transaction, generated when issuing or transfering assets.

Attribute Type Description
ver int Version of Open Assets Protocol transaction. Typically 1.
assetid string Unique indentifier associated with this asset; can be used to query other transactions associated with this asset.
hash string This transaction's unique hash; same as the underlying transaction on the asset's parent blockchain.
confirmed time Optional Time this transaction was confirmed; only returned for confirmed transactions.
received time Time this transaction was received.
oap_meta string Optional Associated hex-encoded metadata with this transaction, if it exists.
double_spend bool true if this is an attempted double spend; false otherwise.
inputs array[...] Array of input data, which can be seen explicitly in the cURL example. Very similar to array of TXInputs, but with values related to assets instead of satoshis.
outputs array[...] Array of output data, which can be seen explicitly in the cURL example. Very similar to array of TXOutputs, but with values related to assets instead of satoshis.

Event

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/hooks/399d0923-e920-48ee-8928-2051cbfbc369 { "id": "399d0923-e920-48ee-8928-2051cbfbc369" "event": "unconfirmed-tx", "address": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "token": "YOURTOKEN", "url": "https://my.domain.com/callbacks/new-tx", "callback_errors": 0 }

An Event represents a WebHooks or WebSockets-based notification request, as detailed in the Events & Hooks section of the documentation.

Attribute Type Description
id string Identifier of the event; generated when a new request is created.
event string Type of event; can be unconfirmed-tx, new-block, confirmed-tx, tx-confirmation, double-spend-tx, tx-confidence.
hash string optional Only objects with a matching hash will be sent. The hash can either be for a block or a transaction.
wallet_name string optional Only transactions associated with the given wallet will be sent; can use a regular or HD wallet name. If used, requires a user token.
token string optional Required if wallet_name is used, though generally we advise users to include it (as they can reach API throttling thresholds rapidly).
address string optional Only transactions associated with the given address will be sent. A wallet name can also be used instead of an address, which will then match on any address in the wallet.
confirmations integer optional Used in concert with the tx-confirmation event type to set the number of confirmations desired for which to receive an update. You'll receive an updated TX for every confirmation up to this amount. The maximum allowed is 10; if not set, it will default to 6.
confidence float optional Used in concert with the tx-confidence event type to set the minimum confidence for which you'll receive a notification. You'll receive a TX once this threshold is met. Will accept any float between 0 and 1, exclusive; if not set, defaults to 0.99.
script string optional Only transactions with an output script of the provided type will be sent. The recognized types of scripts are: pay-to-pubkey-hash, pay-to-multi-pubkey-hash, pay-to-pubkey, pay-to-script-hash, null-data (sometimes called OP_RETURN), empty or unknown.
url url optional Callback URL for this Event's WebHook; not applicable for WebSockets usage.
callback_errors int Number of errors when attempting to POST to callback URL; not applicable for WebSockets usage.

AddressForward

Copy to Clipboard
curl -d '{"destination":"15qx9ug952GWGTNn7Uiv6vode4RcGrRemh","callback_url": "https://my.domain.com/callbacks/new-pay","process_fees_address": "1LWw6FdzNUcX8bnekMMZ7eofcGF7SXmbrL", "process_fees_percent": 0.1,"token":"YOURTOKEN"}' https://api.blockcypher.com/v1/btc/main/forwards { "input_address": "16uKw7GsQSzfMaVTcT7tpFQkd7Rh9qcXWX", "destination": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "callback_url": "https://my.domain.com/callbacks/new-pay" "process_fees_address": "1LWw6FdzNUcX8bnekMMZ7eofcGF7SXmbrL", "process_fees_percent": 0.1, "token": "YOURTOKEN" }

A AddressForward object represents a request set up through the Address Forwarding service.

Attribute Type Description
id string Identifier of the orwarding request; generated when a new request is created.
token string The mandatory user token.
destination string The required destination address to forward to.
input_address string The address which will automatically forward to destination; generated when a new request is created.
process_fees_address string Optional Address to forward processing fees, if specified. Allows you to receive a fee for your own services.
process_fees_satoshis int Optional Fixed processing fee amount to be sent to the fee address. A fixed satoshi amount or a percentage is required if a process_fees_address has been specified.
process_fees_percent float Optional Percentage of the transaction to be sent to the fee address. A fixed satoshi amount or a percentage is required if a process_fees_address has been specified.
callback_url url Optional The URL to call anytime a new transaction is forwarded.
enable_confirmations bool Optional Whether to also call the callback_url with subsequent confirmations of the forwarding transactions. Automatically sets up a WebHook.
mining_fees_satoshis int Optional Mining fee amount to include in the forwarding transaction, in satoshis. If not set, defaults to 10,000.
txs array[string] Optional History of forwarding transaction hashes for this forward; not present if this request has yet to forward any transactions.

AddressForwardCallback

Copy to Clipboard
{ "value": 100000000, "input_address": "16uKw7GsQSzfMaVTcT7tpFQkd7Rh9qcXWX", "destination": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "input_transaction_hash": "39bed5d...", "transaction_hash": "1aa6103..." }

A AddressForwardCallback object represents the payload delivered to the optional callback_url in a AddressForward request.

Attribute Type Description
value int Amount sent to the destination address, in satoshis.
input_address string The intermediate address to which the transaction was originally sent.
destination string The final destination address to which the forward will eventually be sent.
input_transaction_hash string The transaction hash representing the initial transaction to the input_address.
transaction_hash string The transaction hash of the generated transaction that forwards from the input_address to the destination.

Blockchain API

The first component---and highest level---of the BlockCypher API allows you to query general information about blockchain and blocks based on the coin/chain resource you've selected for your endpoints.

If you're new to blockchains, you can think of the blockchain itself as an immutable, distributed ledger. Each block in the blockchain is like a "page" in the ledger containing information about transactions between parties. A great place to start understanding the mechanics behind blockchains is the original Bitcoin whitepaper.

Chain Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main { "name": "BTC.main", "height": 360060, "hash": "000000000000000000bf56ff4a81e399374a68344a64d6681039412de78366b8", "time": "2015-06-08T22:57:08.260165627Z", "latest_url": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000000bf56ff4a81e399374a68344a64d6681039412de78366b8", "previous_hash": "000000000000000011c9511ae1265d34d3c16fff6e8f94380425833b3d0ae5d8", "previous_url": "https://api.blockcypher.com/v1/btc/main/blocks/000000000000000011c9511ae1265d34d3c16fff6e8f94380425833b3d0ae5d8", "peer_count": 239, "unconfirmed_count": 617, "high_fee_per_kb": 46086, "medium_fee_per_kb": 29422, "low_fee_per_kb": 12045, "last_fork_height": 359865, "last_fork_hash": "00000000000000000aa6462fd9faf94712ce1b5a944dc666f491101c996beab9" }

General information about a blockchain is available by GET-ing the base resource.

Resource Method Return Object
/ GET Blockchain

The returned object contains a litany of information about the blockchain, including its height, the time/hash of the latest block, and more.

For more detailed information about the data returned, check the Blockchain object.

Block Hash Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000003dc20b868d17121303308f6bba329302e75913f0790db { "hash": "00000000000000000003dc20b868d17121303308f6bba329302e75913f0790db", "height": 671142, "chain": "BTC.main", "total": 2928942845838, "fees": 135268918, "size": 1448143, "vsize": 998941, "ver": 1073725440, "time": "2021-02-18T16:01:12Z", "received_time": "2021-02-18T16:02:17.341Z", "coinbase_addr": "", "relayed_by": "68.168.176.51:8333", "bits": 386736569, "nonce": 3270005482, "n_tx": 2025, "prev_block": "00000000000000000001245ac74971793689be7924cd0b031302661e806deb0d", "mrkl_root": "5283c26fb8d64d2284ffda76af6cd584292b76f265932cd121ac16fb475d7a8a", "txids": [ "39dec39382157569b809446037c6d5658d490e38907060112c16d8de49aeab0b", "ce0a8256a459ba14feb48931a2344ff7af3af4f9aa2b5acb795a1b0b9fd8806e", ..., ], "depth": 5, "prev_block_url": "https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000001245ac74971793689be7924cd0b031302661e806deb0d", "tx_url": "https://api.blockcypher.com/v1/btc/main/txs/", "next_txids": "https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000003dc20b868d17121303308f6bba329302e75913f0790db?txstart=20\u0026limit=20" }

If you want more data on a particular block, you can use the Block Hash endpoint.

Resource Method Return Object
/blocks/$BLOCK_HASH GET Block
Flag Type Effect
txstart integer Filters response to only include transaction hashes after txstart in the block.
limit integer Filters response to only include a maximum of limit transactions hashes in the block. Maximum value allowed is 500.

BLOCK_HASH is a string representing the hash of the block you're interested in querying, for example:

0000000000000000189bba3564a63772107b5673c940c16f12662b3e8546b412

The returned object contains information about the block, including its height, the total amount of satoshis transacted within it, the number of transactions in it, transaction hashes listed in the canonical order in which they appear in the block, and more. For more detail on the data returned, check the Block object.

Block Height Endpoint

Copy to Clipboard
curl 'https://api.blockcypher.com/v1/btc/main/blocks/671142?txstart=1&limit=1' { "hash": "00000000000000000003dc20b868d17121303308f6bba329302e75913f0790db", "height": 671142, "chain": "BTC.main", "total": 2928942845838, "fees": 135268918, "size": 1448143, "vsize": 998941, "ver": 1073725440, "time": "2021-02-18T16:01:12Z", "received_time": "2021-02-18T16:02:17.341Z", "coinbase_addr": "", "relayed_by": "68.168.176.51:8333", "bits": 386736569, "nonce": 3270005482, "n_tx": 2025, "prev_block": "00000000000000000001245ac74971793689be7924cd0b031302661e806deb0d", "mrkl_root": "5283c26fb8d64d2284ffda76af6cd584292b76f265932cd121ac16fb475d7a8a", "txids": [ "39dec39382157569b809446037c6d5658d490e38907060112c16d8de49aeab0b" ], "depth": 5, "prev_block_url": "https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000001245ac74971793689be7924cd0b031302661e806deb0d", "tx_url": "https://api.blockcypher.com/v1/btc/main/txs/", "next_txids": "https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000003dc20b868d17121303308f6bba329302e75913f0790db?txstart=20\u0026limit=20" }

You can also query for information on a block using its height, using the same resource but with a different variable type.

Resource Method Return Object
/blocks/$BLOCK_HEIGHT GET Block
Flag Type Effect
txstart integer Filters response to only include transaction hashes after txstart in the block.
limit integer Filters response to only include a maximum of limit transactions hashes in the block. Maximum value allowed is 500.

BLOCK_HEIGHT is an integer representing the height of the block you're interested in querying, for example:

294322

As above, the returned object contains information about the block, including its hash, the total amount of satoshis transacted within it, the number of transactions in it, transaction hashes listed in the canonical order in which they appear in the block, and more. For more detail on the data returned, check the Block object.

Feature Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/feature/bip65?token=YOURTOKEN { "name": "bip65", "state": "EXCLUSIVE", "last_transition_height": 388380, "last_transition_hash": "000000000000000009f886db2c7c12a497603e86378bace3ead93d350be3f38c" }
Resource Method
/feature/$NAME GET

If you're curious about the adoption of upgrade features on a blockchain, you can use this endpoint to get some information about its state on the network. For example, for bip65 on bitcoin, you could check its state via this URL: https://api.blockcypher.com/v1/btc/main/feature/bip65?token=YOURTOKEN. Generally speaking, for bitcoin, this will follow the form of tracking bipXX (where XX = a number), but the list of features we're tracking is always changing.

Address API

BlockCypher's Address API allows you to look up information about public addresses on the blockchain, generate single-use, low-value key pairs with corresponding addresses, help generate multisig addresses, and collect multiple addresses into a single shortcut for address viewing, all based on the coin/chain resource you've selected for your endpoints.

If you're new to blockchains, you can think of public addresses as similar to bank account numbers in a traditional ledger. The biggest differences:

Address Balance Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/addrs/1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD/balance { "address": "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD", "total_received": 4433416, "total_sent": 0, "balance": 4433416, "unconfirmed_balance": 0, "final_balance": 4433416, "n_tx": 7, "unconfirmed_n_tx": 0, "final_n_tx": 7 }

The Address Balance Endpoint is the simplest---and fastest---method to get a subset of information on a public address.

Resource Method Return Object
/addrs/$ADDRESS/balance GET Address
Flag Type Effect
omitWalletAddresses bool If omitWalletAddresses is true and you're querying a Wallet or HDWallet, the response will omit address information (useful to speed up the API call for larger wallets).

ADDRESS is a string representing the public address (or wallet/HD wallet name) you're interested in querying, for example:

1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD

The returned object contains information about the address, including its balance in satoshis and the number of transactions associated with it. The endpoint omits any detailed transaction information, but if that isn't required by your application, then it's the fastest and preferred way to get public address information.

Address Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/addrs/1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD { "address": "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD", "total_received": 4433416, "total_sent": 0, "balance": 4433416, "unconfirmed_balance": 0, "final_balance": 4433416, "n_tx": 7, "unconfirmed_n_tx": 0, "final_n_tx": 7, "txrefs": [ { "tx_hash": "14b1052855bbf6561bc4db8aa501762e7cc1e86994dda9e782a6b73b1ce0dc1e", "block_height": 302013, "tx_input_n": -1, "tx_output_n": 0, "value": 20213, "ref_balance": 4433416, "spent": false, "confirmations": 63066, "confirmed": "2014-05-22T03:46:25Z", "double_spend": false }, { "tx_hash": "4cff011ec53022f2ae47197d1a2fd4a6ac2a80139f4d0131c1fed625ed5dc869", "block_height": 302002, "tx_input_n": -1, "tx_output_n": 0, "value": 40596, "ref_balance": 4413203, "spent": false, "confirmations": 63077, "confirmed": "2014-05-22T02:56:08Z", "double_spend": false }, ... ], "tx_url": "https://api.blockcypher.com/v1/btc/main/txs/" }

The default Address Endpoint strikes a balance between speed of response and data on Addresses. It returns more information about an address' transactions than the Address Balance Endpoint but doesn't return full transaction information (like the Address Full Endpoint).

Resource Method Return Object
/addrs/$ADDRESS GET Address
Flag Type Effect
unspentOnly bool If unspentOnly is true, filters response to only include unspent transaction outputs (UTXOs).
includeScript bool If includeScript is true, includes raw script of input or output within returned TXRefs.
includeConfidence bool If true, includes the confidence attribute (useful for unconfirmed transactions) within returned TXRefs. For more info about this figure, check the Confidence Factor documentation.
before integer Filters response to only include transactions below before height in the blockchain.
after integer Filters response to only include transactions above after height in the blockchain.
limit integer limit sets the minimum number of returned TXRefs; there can be less if there are less than limit TXRefs associated with this address, but there can be more in the rare case of more TXRefs in the block at the bottom of your call. This ensures paging by block height never misses TXRefs. Defaults to 200, maximum is 2000.
confirmations integer If set, only returns the balance and TXRefs that have at least this number of confirmations.
confidence integer Filters response to only include TXRefs above confidence in percent; e.g., if this is set to 99, will only return TXRefs with 99% confidence or above (including all confirmed TXRefs). For more detail on confidence, check the Confidence Factor documentation.
omitWalletAddresses bool If omitWalletAddresses is true and you're querying a Wallet or HDWallet, the response will omit address information (useful to speed up the API call for larger wallets).

ADDRESS is a string representing the public address (or wallet/HD wallet name) you're interested in querying, for example:

1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD

The returned object contains information about the address, including its balance in satoshis, the number of transactions associated with it, and transaction inputs/outputs in descending order by block height---and if multiple transaction inputs/outputs associated with this address exist within the same block, by descending block index (position in block).

Address Full Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/addrs/1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD/full?before=300000 { "address": "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD", "total_received": 4433416, "total_sent": 0, "balance": 4433416, "unconfirmed_balance": 0, "final_balance": 4433416, "n_tx": 7, "unconfirmed_n_tx": 0, "final_n_tx": 7, "txs": [ { "block_hash": "0000000000000000af64802c79...", "block_height": 292586, "hash": "b4735a0690dab16b8789fceaf81c511f...", "addresses": [ "18KXZzuC3xvz6upUMQpsZzXrBwNPWZjdSa", "1AAuRETEcHDqL4VM3R97aZHP8DSUHxpkFV", "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD", "1VxsEDjo6ZLMT99dpcLu4RQonMDVEQQTG" ], "total": 3537488, "fees": 20000, "size": 438, "preference": "medium", "relayed_by": "", "confirmed": "2014-03-26T17:08:04Z", "received": "2014-03-26T17:08:04Z", "ver": 1, "lock_time": 0, "double_spend": false, "vin_sz": 2, "vout_sz": 2, "confirmations": 64492, "confidence": 1, "inputs": [ { "prev_hash": "729f6469b59fea5da7...", "output_index": 0, "script": "483045022100d06cdad1a...", "output_value": 3500000, "sequence": 4294967295, "addresses": [ "1VxsEDjo6ZLMT99dpcLu4RQonMDVEQQTG" ], "script_type": "pay-to-pubkey-hash" }, ... ], "outputs": [ { "value": 3500000, "script": "76a9148629647bd642a237...", "addresses": [ "1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD" ], "script_type": "pay-to-pubkey-hash" }, { "value": 37488, "script": "76a9145049e2ad94ed9c68...", "spent_by": "3ebe4bb294beaed58aca83...", "addresses": [ "18KXZzuC3xvz6upUMQpsZzXrBwNPWZjdSa" ], "script_type": "pay-to-pubkey-hash" } ] }, ..., ] }

The Address Full Endpoint returns all information available about a particular address, including an array of complete transactions instead of just transaction inputs and outputs. Unfortunately, because of the amount of data returned, it is the slowest of the address endpoints, but it returns the most detailed data record.

Resource Method Return Object
/addrs/$ADDRESS/full GET Address
Flag Type Effect
before integer Filters response to only include transactions below before height in the blockchain.
after integer Filters response to only include transactions above after height in the blockchain.
limit integer limit sets the minimum number of returned TXs; there can be less if there are less than limit TXs associated with this address, but there can also be more in the rare case of more TXs in the block at the bottom of your call. This ensures paging by block height never misses TXs. Defaults to 10, maximum is 50.
txlimit integer This filters the TXInputs/TXOutputs within the returned TXs to include a maximum of txlimit items.
confirmations integer If set, only returns the balance and TXs that have at least this number of confirmations.
confidence integer Filters response to only include TXs above confidence in percent; e.g., if this is set to 99, will only return TXs with 99% confidence or above (including all confirmed TXs). For more detail on confidence, check the Confidence Factor documentation.
legacyaddrs bool Litecoin Only. Replaces P2SH prefix with legacy 3 instead of M. Disabled by default.
includeHex bool If true, includes hex-encoded raw transaction for each TX; false by default.
includeConfidence bool If true, includes the confidence attribute (useful for unconfirmed transactions) within returned TXs. For more info about this figure, check the Confidence Factor documentation.
omitWalletAddresses bool If omitWalletAddresses is true and you're querying a Wallet or HDWallet, the response will omit address information (useful to speed up the API call for larger wallets).

ADDRESS is a string representing the public address (or wallet/HD wallet name) you're interested in querying, for example:

1DEP8i3QJCsomS4BSMY2RpU1upv62aGvhD

The returned object contains information about the address, including its balance in satoshis, the number of transactions associated with it, and the corresponding full transaction records in descending order by block height---and if multiple transactions associated with this address exist within the same block, by descending block index (position in block).

Generate Address Endpoint

Copy to Clipboard
curl -X POST https://api.blockcypher.com/v1/btc/test3/addrs { "private": "81ee75559d37cbe4b7cbbfb9931ab1ba32172c5cdfc3ac2d020259b4c1104198", "public": "0231ff9ec76820cb36b69061f6ffb125db3793b4aced468a1261b0680e1ef4883a", "address": "mvpW7fMSi1nbZhJJDySNS2PUau8ppnu4kY", "wif": "cRwGhRjCuuNtPgLcoYd1CuAqjFXCV5YNCQ1LB8RsFCvu61VfSsgR" }
Copy to Clipboard
# generate bech32 p2wpkh curl -X POST https://api.blockcypher.com/v1/btc/test3/addrs?bech32=true { "private": "516c110f271f2b26ad8ed2d72c469d2dde0db5030241926b6b0388c602cf572c", "public": "023766804d9c34ead560be1d1f819127cb2636305ac9ba2f76c176efd2b3913a25", "address": "tb1q2u0dzlwf805qy62w099p06f8z5nxz5kk34a456", "wif": "cQJyYH6rjkV2W9jR9PjnJftBmGt93Yi4gpn494oEAiWvoUJoEpCs" }

The Generate Address endpoint allows you to generate private-public key-pairs along with an associated public address. No information is required with this POST request.

Resource Method Request Object Return Object
/addrs POST nil AddressKeychain
Flag Type Effect
bech32 bool Whether or not to generate a p2wpkh bech32 address. Default is false.

The returned object contains a private key in hex-encoded and wif-encoded format, a public key, and a public address.

Generate Multisig Address Endpoint

Copy to Clipboard
curl -d '{"pubkeys": ["02c716d071a76cbf0d29c29cacfec76e0ef8116b37389fb7a3e76d6d32cf59f4d3", "033ef4d5165637d99b673bcdbb7ead359cee6afd7aaf78d3da9d2392ee4102c8ea", "022b8934cc41e76cb4286b9f3ed57e2d27798395b04dd23711981a77dc216df8ca"], "script_type": "multisig-2-of-3"}' https://api.blockcypher.com/v1/btc/main/addrs { "private": "", "public": "", "address": "3BF1M1PnTge94QewuWh3B8mRVw8U4SVnb4", "wif": "", "pubkeys": [ "02c716d071a76cbf0d29c29cacfec76e0ef8116b37389fb7a3e76d6d32cf59f4d3", "033ef4d5165637d99b673bcdbb7ead359cee6afd7aaf78d3da9d2392ee4102c8ea", "022b8934cc41e76cb4286b9f3ed57e2d27798395b04dd23711981a77dc216df8ca" ], "script_type": "multisig-2-of-3" }

The Generate Multisig Address Endpoint is a convenience method to help you generate multisig addresses from multiple public keys. After supplying a partially filled-out AddressKeychain object (including only an array of hex-encoded public keys and the script type), the returned object includes the computed public address.

Resource Method Request Object Return Object
/addrs POST AddressKeychain AddressKeychain

Wallet API

The Wallet API allows you to group multiple addresses under a single name. It only holds public address information and never requires any private keys.

A normal Wallet can be created, deleted, and have addresses added and removed. The Wallet itself can have any custom name as long as it does not start with the standard address prefix (1, 3 or bc1 for Bitcoin Mainnet).

Hierarchical Deterministic (HD) Wallets

We also offer support for HD Wallets, which make it easy to manage multiple addresses under a single name. All HD wallet addresses are derived from a single seed. Please see BIP32 for more background on HD wallets.

HD Wallets can be created, deleted, and have new addresses generated. However, unlike normal Wallets, addresses cannot be removed.

When creating a wallet, one can optionally include one or more "subchain" indexes. These subchains can later be referenced when generating new addresses or sending txs. If none are provided in wallet creation, the wallet will derive & use addresses straight from the given extended pubkey. If no index is given when using the wallet with other APIs, it defaults to using the wallet's first (sub) chain.

In BIP32 notation, the wallet layout is m/0, m/1, ... and m/i/0, m/i/1, ... for each subchain i if the wallet has subchains. For example, the path of the fourth address generated is m/3 for a non-subchain wallet. The path of the fourth address at subchain index two is m/2/3. Note that this is different from the default BIP32 wallet layout.

If you want to use BIP32 default wallet layout you can submit the extended public key of m/0' (which can only be derived from your master private key) with subchain indexes = [0, 1]. Subchain index 0 represents the external chain (of account 0) and will discover all k keypairs that look like: m/0'/0/k. Subchain index 1 represents the internal chain (of account 0) and will discover all k keypairs in m/0'/1/k.

If you want to use BIP 44 layout (for BTC), you can submit the extended public key of m/44'/0'/0'. (which can only be derived from your master private key) with subchain indexes = [0, 1]. Subchain index 0 represents the external chain (of account 0) and will discover all k keypairs in m/44'/0'/0'/0/k. Subchain index 1 represents the internal chain (of account 0) and will discover all k keypairs in m/44'/0'/0'/1/k.

If you want to use BIP 84 layout (for BTC), you can submit the extended public key of m/84'/0'/0'. (which can only be derived from your master private key) with subchain indexes = [0, 1]. Subchain index 0 represents the external chain (of account 0) and will discover all k keypairs in m/84'/0'/0'/0/k. Subchain index 1 represents the internal chain (of account 0) and will discover all k keypairs in m/84'/0'/0'/1/k.

If an address ahead of current addresses listed in an HD Wallet receives a transaction, it will be added, along with any addresses between the new address and the last used one. We limit looking ahead to 20 addresses; if more than 20 addresses are skipped for the next payment to an HD Wallet, it won't be detected/added to the HD Wallet.

Using Wallets

Both HD Wallets and normal Wallets can be leveraged by the Address API, just by using their $NAME instead of $ADDRESS. They can also be used with Events and with the Transaction API. In general, using a wallet instead of an address in an API will have the effect of batching the set of addresses contained in the wallet.

The following code examples should be considered serially; that is to say, the results will appear as if each API call were done sequentially. Also, $NAME is a string representing the name of your wallet, for example:

alice

As you'll see in the examples, if you're using HD Wallets, take care to use the appropriate resource (e.g. /wallets/hd instead of /wallets ).

Create Wallet Endpoint

Copy to Clipboard
# normal wallet curl -d '{"name": "alice","addresses": ["1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e"]}' https://api.blockcypher.com/v1/btc/main/wallets?token=YOURTOKEN {"token": "YOURTOKEN", "name": "alice", "addresses": [ "1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e" ]} # hd wallet curl -d '{"name": "bob", "extended_public_key": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8"}' https://api.blockcypher.com/v1/btc/main/wallets/hd?token=YOURTOKEN {"token": "YOURTOKEN", "name": "bob", "hd": true, "extended_public_key": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8", "chains": [ {"chain_addresses": [ { "address": "1FHz8bpEE5qUZ9XhfjzAbCCwo5bT1HMNAc", "path": "m/0" }, { "address": "1J8QDN1u7iDMbJktbqXPSrAqruNjkmRFmT", "path": "m/1" }, { "address": "1MWNKnYfE2LVdvAzFUioF3F3JXFpRfDCQb", "path": "m/2" } ]} ]} # hd wallet BIP84 curl -d '{"name": "charlie", "extended_public_key": "vpub5bJX9NkmSDP33H5PxJXmehqyV7aDaVWxudzDW3kP4c5Z5KFEaUNtJ9CLebEiEssZJyZa7AE9zR5Q7nqPAmk6xgRpRvXRMKj6WPfBGBi3fR"}' https://api.blockcypher.com/v1/btc/test3/wallets/hd?token=YOURTOKEN {"token": "YOURTOKEN", "name": "charlie", "hd": true, "extended_public_key": "vpub5bJX9NkmSDP33H5PxJXmehqyV7aDaVWxudvzDW3kP4c5Z5KFEaUNtJ9CLebEiEssZJyZa7AE9zR5Q7nqPAmk6xgRpRvXRMKj6WPfBGBi3fR", "chains": [ {"chain_addresses": [ { "address": "tb1q4a9vav7vq4gp7ca9emddr66dvk099vdhh5srhp", "path": "m/0" } ]} ]} # hd wallet with subchains curl -d '{"name": "catheryne", "extended_public_key": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8", "subchain_indexes": [1, 3]}' https://api.blockcypher.com/v1/btc/main/wallets/hd?token=YOURTOKEN {"token": "YOURTOKEN", "name": "catheryne", "hd": true, "extended_public_key": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8", "subchain_indexes": [ 1, 3 ], "chains": [ { "index": 1, "chain_addresses": [] }, { "index": 3, "chain_addresses": [] } ]}
Resource Method Request Object Return Object
/wallets POST Wallet Wallet
/wallets/hd POST HDWallet HDWallet

This endpoint allows you to create a new wallet, by POSTing a partially filled out Wallet or HDWallet object, depending on the endpoint.

For normal wallets, at minimum, you must include the name attribute and at least one public address in the addresses array.

For HD wallets, at minimum, you must include the name and the extended_public_key attributes. The encoding of the key is documented here. You can optionally include subchain_indexes to initialize the wallet with one or more subchains. If not given, the wallet will derive address straight from the given extended pubkey. See BIP32 for more info.

If successful, it will return the same Wallet or HDWallet object you requested, appended with your user token.

List Wallets Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/wallets?token=YOURTOKEN { "wallet_names": [ "alice", "bob", "catheryne" ] }
Resource Method Return Object
/wallets GET {"wallet_names":$NAMEARRAY}

This endpoint returns a string array ($NAMEARRAY) of active wallet names (both normal and HD) under the token you queried. You can then query detailed information on individual wallets (via their names) by leveraging the Get Wallet Endpoint.

Get Wallet Endpoint

Copy to Clipboard
# normal wallet curl https://api.blockcypher.com/v1/btc/main/wallets/alice?token=YOURTOKEN {"token":"YOURTOKEN", "name":"alice", "addresses": [ "1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e"]} # hd wallet curl https://api.blockcypher.com/v1/btc/main/wallets/hd/bob?token=YOURTOKEN {"token": "YOURTOKEN", "name": "bob", "hd": true, "extended_public_key": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8", "chains": [{ "chain_addresses": [ { "address": "1FHz8bpEE5qUZ9XhfjzAbCCwo5bT1HMNAc", "path": "m/0" }, { "address": "1J8QDN1u7iDMbJktbqXPSrAqruNjkmRFmT", "path": "m/1" }, { "address": "1MWNKnYfE2LVdvAzFUioF3F3JXFpRfDCQb", "path": "m/2" } ]} ]}
Resource Method Return Object
/wallets/$NAME GET Wallet
/wallets/hd/$NAME GET HDWallet

This endpoint returns a Wallet or HDWallet based on its $NAME.

Add Addresses to Wallet Endpoint

Copy to Clipboard
curl -d '{"addresses": ["13cj1QtfW61kQHoqXm3khVRYPJrgQiRM6j"]}' https://api.blockcypher.com/v1/btc/main/wallets/alice/addresses?token=YOURTOKEN {"token": "YOURTOKEN", "name": "alice", "addresses": [ "1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e", "13cj1QtfW61kQHoqXm3khVRYPJrgQiRM6j" ]}
Resource Method Request Object Return Object
/wallets/$NAME/addresses POST Wallet Wallet
Flag Type Effect
omitWalletAddresses bool If omitWalletAddresses is true, the response will omit address information (useful to speed up the API call for larger wallets).

This endpoint allows you to add public addresses to the $NAME wallet, by POSTing a partially filled out Wallet object. You only need to include the additional addresses in a new addresses array in the object. If successful, it will return the newly modified Wallet, including an up-to-date, complete listing of addresses.

Get Wallet Addresses Endpoint

Copy to Clipboard
#normal wallet curl https://api.blockcypher.com/v1/btc/main/wallets/alice/addresses?token=YOURTOKEN {"addresses": [ "13cj1QtfW61kQHoqXm3khVRYPJrgQiRM6j", "1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e" ]} #hd wallet curl https://api.blockcypher.com/v1/btc/main/wallets/hd/bob/addresses?token=YOURTOKEN {"chains": [ {"chain_addresses": [ { "address": "1FHz8bpEE5qUZ9XhfjzAbCCwo5bT1HMNAc", "path": "m/0" }, { "address": "1J8QDN1u7iDMbJktbqXPSrAqruNjkmRFmT", "path": "m/1" }, { "address": "1MWNKnYfE2LVdvAzFUioF3F3JXFpRfDCQb", "path": "m/2" }] } ]}
Resource Method Return Object
/wallets/$NAME/addresses GET Wallet
/wallets/hd/$NAME/addresses GET HDChain
Flag Type Effect
used bool Returns only used addresses if set to true and only unused if false. Only valid on HD wallets.
zerobalance bool Returns only addresses with zero balance if set to true and only addresses with non-zero balance if false. Only valid on HD wallets.

This endpoint returns a list of the addresses associated with the $NAME wallet. It returns the addresses in a partially filled out Wallet which you'll find under the addresses attribute. For HD wallets it returns an HDChain object.

Remove Addresses from Wallet Endpoint

Copy to Clipboard
#pipe to grep to check status code $ curl -X DELETE -Is https://api.blockcypher.com/v1/btc/main/wallets/alice/addresses?token=USERTOKEN&address=1JcX75oraJEmzXXHpDjRctw3BX6qDmFM8e | grep "HTTP/1.1" HTTP/1.1 204 OK
Resource Method Return Object
/wallets/$NAME/addresses?address=$ADDRESS DELETE nil

This endpoint allows you to delete an $ADDRESS associated with the $NAME wallet. As a reminder, you can batch multiple addresses by appending them with semicolons within the $ADDRESS URL parameter. If successful, it will return an HTTP 204 status code with no return object.

Generate Address in Wallet Endpoint

Copy to Clipboard
curl -X POST https://api.blockcypher.com/v1/btc/main/wallets/alice/addresses/generate?token=YOURTOKEN {"token": "YOURTOKEN", "name": "alice", "addresses": [ "13cj1QtfW61kQHoqXm3khVRYPJrgQiRM6j", "14LcPtRSGjYb1s8kfxsVDbXvA7VYCmoFho" ], "private": "6238efeb679d75ec3b1a43e76cc0ed33abdf56e30bb5bb95e4793134a7958609", "public": "03e4f273521a30373a639f60da836f2308a5d53853ec18f903dd235c73e6e26e4a", "address": "14LcPtRSGjYb1s8kfxsVDbXvA7VYCmoFho", "wif": "KzWeDL7sysRay7pZUm6hQQLaDVjmN1jUZzeZuq6ru5FtN1RhPrLX"}
Resource Method Request Object Return Object
/wallets/$NAME/addresses/generate POST nil Wallet + AddressKeychain
Flag Type Effect
bech32 bool Whether or not to generate a p2wpkh bech32 address. Default is false.

This endpoint allows you to generate a new address associated with the $NAME wallet, similar to the Generate Address Endpoint. If successful, it will returned the newly modified Wallet composed with an AddressKeychain.

Only works for regular Wallets; for HD Wallets, use the Derive Address endpoint specified below.

Derive Address in Wallet Endpoint

Copy to Clipboard
curl -X POST https://api.blockcypher.com/v1/btc/main/wallets/hd/bob/addresses/derive?token=YOURTOKEN { "chains": [ {"chain_addresses": [ { "address": "19urzZsoBNsomSfj68PUUGLXDz261tK5Jo", "public": "02c85080e00080aa933f93a2718bba9f01fd6fdc8e4712a155849f5ba588666471", "path": "m/3" } ]} ]} #with subchain_index curl -X POST 'https://api.blockcypher.com/v1/btc/main/wallets/hd/catheryne/addresses/derive?token=YOURTOKEN&subchain_index=1' { "chains": [ {"index":1, "chain_addresses": [ { "address": "1NwEtFZ6Td7cpKaJtYoeryS6avP2TUkSMh", "public": "029b393153a1ec68c7af3a98e88aecede3a409f27e698c090540098611c79e05b0", "path": "m/1/0" } ]} ]}
Resource Method Request Object Return Object
/wallets/hd/$NAME/addresses/derive POST nil Partial HDWallet
Flag Type Effect
count integer Number of addresses to derive. If not set, default is one address.
subchain_index integer Derives address(es) on this specific subchain. If not set, address will be generated on the first chain in the HD wallet.
lookahead boolean Default to true. If set to false will not try to check the balance of the subsequent addresses. Set to false if this endpoint is too slow.

This endpoint allows you to derive a new address (or multiple addresses) associated with the $NAME HD Wallet. If successful, it will return an HDWallet but only with the newly derived address(es) represented in its chains field to limit the data transmitted; for the full address list after derivation, you can follow up this API call with the Get Wallet Addresses Endpoint.

Only works for HD Wallets; for regular wallets, use the Generate Address in Wallet endpoint specified above.

Delete Wallet Endpoint

Copy to Clipboard
# normal wallet, pipe to grep to check status code curl -X DELETE -Is https://api.blockcypher.com/v1/btc/main/wallets/alice?token=YOURTOKEN | grep "HTTP/1.1" HTTP/1.1 204 OK # hd wallet curl -X DELETE -Is https://api.blockcypher.com/v1/btc/main/wallets/hd/bob?token=YOURTOKEN | grep "HTTP/1.1" HTTP/1.1 204 OK
Resource Method Return Object
/wallets/$NAME DELETE nil
/wallets/hd/$NAME DELETE nil

This endpoint deletes the Wallet or HD Wallet with $NAME. If successful, it will return an HTTP 204 status code with no return object.

Transaction API

BlockCypher's Transaction API allows you to look up information about unconfirmed transactions, query transactions based on hash, create and propagate your own transactions, including multisignature transactions, and embed data on the blockchain---all based on the coin/chain resource you've selected for your endpoints.

If you're new to blockchains, the idea of transactions is relatively self-explanatory. Here's what's going on underneath the hood: a transaction takes previous "unspent transaction outputs" (also known as UTXOs) as "transaction inputs" and creates new "locking scripts" on those inputs such that they are "sent" to new addresses (to become new UTXOs). While most of these public addresses are reference points for single private keys that can "unlock" the newly created UTXOs, occasionally they are sent to more exotic addresses through pay-to-script-hash, typically multisignature addresses.

Generally speaking, UTXOs are generated from previous transactions (except for Coinbase inputs).

Transaction Hash Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/txs/f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449 { "block_hash": "0000000000000000c504bdea36e5...", "block_height": 293000, "hash": "f854aebae95150b379cc1187d848d58225f...", "addresses": [ "13XXaBufpMvqRqLkyDty1AXqueZHVe6iyy", "19YtzZdcfs1V2ZCgyRWo8i2wLT8ND1Tu4L", "1BNiazBzCxJacAKo2yL83Wq1VJ18AYzNHy", "1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq", "1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV" ], "total": 70320221545, "fees": 0, "size": 636, "vsize": 636, "preference": "low", "relayed_by": "", "confirmed": "2014-03-29T01:29:19Z", "received": "2014-03-29T01:29:19Z", "ver": 1, "lock_time": 0, "double_spend": false, "vin_sz": 4, "vout_sz": 1, "confirmations": 64373, "inputs": [ { "prev_hash": "583910b7bf90ab802e22e5c25a89b59...", "output_index": 1, "script": "4830450220504b1ccfddf508422bdd8b0f...", "output_value": 16450000, "sequence": 4294967295, "addresses": [ "1GbMfYui17L5m6sAy3L3WXAtf1P32bxJXq" ], "script_type": "pay-to-pubkey-hash" }, ... ], "outputs": [ { "value": 70320221545, "script": "76a914e6aad9d712c419ea8febf009a3f3...", "spent_by": "35832d6c70b98b54e9a53ab2d51176eb...", "addresses": [ "1N2f642sbgCMbNtXFajz9XDACDFnFzdXzV" ], "script_type": "pay-to-pubkey-hash" } ] }

The Transaction Hash Endpoint returns detailed information about a given transaction based on its hash.

Resource Method Return Object
/txs/$TXHASH GET TX
Flag Type Effect
limit integer Filters TXInputs/TXOutputs, if unset, default is 20.
instart integer Filters TX to only include TXInputs from this input index and above.
outstart integer Filters TX to only include TXOutputs from this output index and above.
legacyaddrs bool Litecoin Only. Replaces P2SH prefix with legacy 3 instead of M. Disabled by default.
includeHex bool If true, includes hex-encoded raw transaction; false by default.
includeConfidence bool If true, includes the confidence attribute (useful for unconfirmed transactions). For more info about this figure, check the Confidence Factor documentation.

TXHASH is a string representing the hex-encoded transaction hash you're interested in querying, for example:

f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449

The returned object contains detailed information about the transaction, including the value transfered, date received, and a full listing of inputs and outputs.

Unconfirmed Transactions Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/txs [ { "block_height": -1, "hash": "7f3af38d988e479f651520b13b85...", "addresses": [ "19ZZonTmBD3VBhgFSWrtNis6Wo4aNRyjAV", "1GD2Gnt3Vk51FpUhZWrFpSa24KE2ZGPaWG", "1HEJiW8jxvUvVQ5cuButRmFj6ZzKzM9Fp6" ], "total": 46977000, "fees": 10000, "size": 225, "vsize": 225, "preference": "medium", "relayed_by": "54.209.56.58:8333", ... }, { "block_height": -1, "hash": "7e2d8b4e95c8246e81f297539409...", "addresses": [ "12u8EFJR6QJpNYbuQcYt2iMsAtPdnCFwQb", "1MUbYoqSadRSEipwcmKnH37NaKakDCmgwW" ], "total": 1070000, "fees": 10000, "size": 225, "vsize": 225, "preference": "medium", "relayed_by": "52.1.229.213:8333", "received": "2015-05-21T05:44:13.878Z", ... }, ... ]

The Unconfirmed Transactions Endpoint returns an array of the latest transactions relayed by nodes in a blockchain that haven't been included in any blocks.

Resource Method Return Object
/txs GET Array[TX]
Flag Type Effect
limit integer Maximum number of transactions returned, if unset, default is 10. Maximum is 100.
minValue integer Filter transactions that transfer a total above the minimal value provided (in satoshis).

The returned object is an array of transactions that haven't been included in blocks, arranged in reverse chronological order (latest is first, then older transactions follow).

Creating Transactions

Using BlockCypher's API, you can push transactions to blockchains one of two ways:

In either case, for security reasons, we never take possession of your private keys.

New Transaction Endpoint

Copy to Clipboard
# Note resource change to bcy/test instead of btc/main, makes sharing private keys easier :) curl -d '{"inputs":[{"addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"]}],"outputs":[{"addresses": ["C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn"], "value": 1000000}]}' https://api.blockcypher.com/v1/bcy/test/txs/new { "tx": { "block_height": -1, "hash": "c2b350b273b3bf04791d8e59fc9c021fd91fa423c50c29473dc079150f5a778a", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9", "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "total": 4988000, "fees": 12000, "size": 119, "vsize": 119, "preference": "high", ..., "confirmations": 0, "inputs": [ { "prev_hash": "c8ea8b221580ebb2f1cabc8b40797bffec742b97c82a329df96d93121db43519", "output_value": 5000000, "addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"], "script": "", "script_type": "", ... } ], "outputs": [ { "value": 1000000, "script": "76a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac", "addresses": ["C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn"], "script_type": "pay-to-pubkey-hash" }, { "value": 3988000, "script": "76a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac", "addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"], "script_type": "pay-to-pubkey-hash" } ] }, "tosign": ["32b5ea64c253b6b466366647458cfd60de9cd29d7dc542293aa0b8b7300cd827"] }

To use BlockCypher's two-endpoint transaction creation tool, first you need to provide the input address(es), output address, and value to transfer (in satoshis). Provide this in a partially-filled out TX request object.

Resource Method Request Object Return Object
/txs/new POST TX TXSkeleton
Flag Type Effect
includeToSignTx bool If true, includes tosign_tx array in TXSkeleton, useful for validating data to sign; false by default.

As you can see from the code example, you only need to provide a single public address within the addresses array of both the input and output of your TX request object. You also need to fill in the value with the amount you'd like to transfer from one address to another.

If you'd like, you can even use a Wallet instead of addresses as your input. You just need to use two non-standard fields (your wallet_name and wallet_token) within the inputs array in your transaction, instead of addresses:

{inputs:[{"wallet_name":"alice", "wallet_token":"YOURTOKEN"}], value: 5000000}

While this particular usage will differ between client libraries, the result is the same: the addresses within your wallet will be used as the inputs, as if all of them had been placed within the addresses array.

As a return object, you'll receive a TXSkeleton containing a slightly-more complete TX alongside data you need to sign in the tosign array. You'll need this object for the next steps of the transaction creation process.

Validating the Data to Sign

For the extra cautious, you can protect yourself from a potential malicious attack on BlockCypher by validating the data we're asking you to sign. Unfortunately, it's impossible to do so directly, as pre-signed signature data is hashed twice using SHA256. To get around this, set the includeToSignTx URL flag to true. The optional tosign_tx array will be returned within the TXSkeleton, which you can use in the following way:

Copy to Clipboard
# next, you sign the data returned in the tosign array locally # here we're using our signer tool (https://github.com/blockcypher/btcutils/tree/master/signer), but any ECDSA secp256k1 signing tool should work # $PRIVATEKEY here is a hex-encoded private key corresponding to the input from address CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9 ./signer 32b5ea64c253b6b466366647458cfd60de9cd29d7dc542293aa0b8b7300cd827 $PRIVATEKEY 3045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca

Locally Sign Your Transaction

With your TXSkeleton returned from the New Transaction Endpoint, you now need to use your private key(s) to sign the data provided in the tosign array.

Digital signing can be a difficult process, and is where the majority of issues arise when dealing with cryptocurrency transactions. We are working on integrating client-side signing solutions into our libraries to make this process easier. You can read more about signing here. In the mean time, if you want to experiment with client-side signing, consider using our signer tool.

Copy to Clipboard
# the request body is truncated because it's huge, but it's the same as the returned object from above plus the signatures and public keys # remember, still using bcy/test instead of btc/main curl -d '{"tx": {...}, "tosign": [ "32b5ea64c253b6b466366647458cfd60de9cd29d7dc542293aa0b8b7300cd827" ], "signatures": [ "3045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca" ], "pubkeys": [ "02152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044" ] }' https://api.blockcypher.com/v1/bcy/test/txs/send?token=YOURTOKEN { "tx": { "block_height": -1, "hash": "4e6dfb1415b4fba5bd257c129847c70fbd4e45e41828079c4a282680528f3a50", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9", "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "total": 4988000, "fees": 12000, "size": 226, "vsize": 226, "preference": "high", ..., "confirmations": 0, "inputs": [ { "prev_hash": "c8ea8b221580ebb2f1cabc8b40797bffec742b97c82a329df96d93121db43519", "output_value": 5000000, "addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"], "script": "483045022100921fc36b911094280f...", "script_type": "pay-to-pubkey-hash", ... } ], "outputs": [ { "value": 1000000, "script": "76a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac", "addresses": ["C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn"], "script_type": "pay-to-pubkey-hash" }, { "value": 3988000, "script": "76a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac", "addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"], "script_type": "pay-to-pubkey-hash" } ] }, "tosign": [ "" ] }

Send Transaction Endpoint

Once you've finished signing the tosign array locally, put that (hex-encoded) data into the signatures array of the TXSkeleton. You also need to include the corresponding (hex-encoded) public key(s) in the pubkeys array, in the order of the addresses/inputs provided. Signature and public key order matters, so make sure they are returned in the same order as the inputs you provided.

Resource Method Request Object Return Object
/txs/send POST TXSkeleton TXSkeleton

If the transaction was successful, you'll receive a TXSkeleton with the completed TX (which contains its final hash) and an HTTP Status Code 201.

Dealing with Errors

Signing and creating transactions can be one of the trickiest parts of using blockchains in your applications. Consequently, when an error is encountered when Creating Transactions, we send back an HTTP Status Code 400 alongside a descriptive array of errors within the TXSkeleton.

Customizing Transaction Requests

Copy to Clipboard
# here are some example request objects for `/txs/new` # simplest posssible case, with input address, output address and value '{ "inputs": [{"addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"]}], "outputs": [{"addresses": ["C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn"], "value": 1000000}] }' # let's add confirmation field to only allow UTXOs, and set fee preference to medium '{ "inputs": [{"addresses": ["CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9"]}], "outputs": [{"addresses": ["C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn"], "value": 1000000}], "confirmations": 1, "preference": "medium" }' # instead of providing an address, let's specify a particular UTXO via prev_hash and output_index, and add a different change_address '{ "inputs": [{"prev_hash":"a238c817bea2d54dad4cdde38a1cfeb2aa5592313bc49514f3cd0d9db71c69c8", "output_index":0}], "outputs": [{"addresses": ["C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn"], "value": 1000000}], "confirmations": 1, "preference": "medium", "change_address": "CFr99841LyMkyX5ZTGepY58rjXJhyNGXHf" }'

While we demonstrated the simplest use of our two-endpoint process to create transactions, you can have finer-grain control by modifying the TX request object before sending to /txs/new.

By default, we allow unconfirmed UTXOs as inputs when creating transactions. If you only want to allow confirmed UTXOs, set the confirmations value in your TX request object to 1.

Instead of providing addresses, you can use prev_hash and output_index within the inputs array of your request object, in which case, we'll use the inputs as provided and not attempt to generate them from a list of addresses. We will compute change and fees the same way.

BlockCypher will set the change address to the first transaction input/address listed in the transaction. To redirect this default behavior, you can set an optional change_address field within the TX request object.

Fees in cryptocurrencies can be complex. We provide 2 different ways for you to control the fees included in your transactions:

  1. Set the preference property in your TX request object to "high", "medium", or "low". This will calculate and include appropriate fees for your transaction to be included in the next 1-2 blocks, 3-6 blocks or 7 or more blocks respectively. You can see the explicit estimates per kilobyte for these high, medium, and low ranges by calling your base resource through the Chain Endpoint. The default fee calculation is based on a "high" preference. A preference set to "zero" will set no fee.
  2. Manually set the fee to a desired amount by setting the fees property in your TX request object. Note that a fee too low may result in an error for some transactions that would require it.

To learn more about fees, bitcoinfees.com is a good resource.

For even more control, you can also change the script_type in the outputs of your partially filled TX. You'll notice this used to powerful effect in the section on Multisig Transactions. These are the possible script types:

  1. pay-to-pubkey-hash (most common transaction transferring to a public key hash, and the default behavior if no out)
  2. pay-to-multi-pubkey-hash (multi-signatures transaction, now actually less used than pay-to-script-hash for this purpose)
  3. pay-to-pubkey (used for mining transactions)
  4. pay-to-script-hash (used for transactions relying on arbitrary scripts, now used primarily for multi-sig transactions)
  5. multisig-m-of-n (not present in blockchain, but used by BlockCypher to construct P2SH multisig transactions; see Multisig Transactions for more info)
  6. null-data (sometimes called op-return; used to embed small chunks of data in the blockchain)
  7. empty (no script present, mostly used for mining transaction inputs)
  8. unknown (non-standard script)

Push Raw Transaction Endpoint

Copy to Clipboard
# Note resource change to bcy/test instead of btc/main curl -d '{"tx":"01000000011935b41d12936df99d322ac8972b74ecff7b79408bbccaf1b2eb8015228beac8000000006b483045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca012102152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044ffffffff0240420f00000000001976a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac20da3c00000000001976a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac00000000"}' https://api.blockcypher.com/v1/bcy/test/txs/push?token=YOURTOKEN { "block_height": -1, "hash": "4e6dfb1415b4fba5bd257c129847c70fbd4e45e41828079c4a282680528f3a50", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9", "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "total": 4988000, "fees": 12000, "size": 226, "vsize": 226, "preference": "high", "relayed_by": "73.162.198.68", "received": "2015-05-22T05:10:00.305308666Z", "ver": 1, "lock_time": 0, "double_spend": false, "vin_sz": 1, "vout_sz": 2, "confirmations": 0, "inputs": [ { "prev_hash": "c8ea8b221580ebb2f1cabc8b40797bffec742b97c82a329df96d93121db43519", "output_index": 0, "script": "483045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca012102152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044", "output_value": 5000000, "sequence": 4294967295, "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9" ], "script_type": "pay-to-pubkey-hash", "age": 576 } ], "outputs": [ { "value": 1000000, "script": "76a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac", "addresses": [ "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "script_type": "pay-to-pubkey-hash" }, { "value": 3988000, "script": "76a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9" ], "script_type": "pay-to-pubkey-hash" } ] }

If you'd prefer to use your own transaction library instead of the recommended path of our two-endpoint transaction generation we're still happy to help you propagate your raw transactions. Simply send your raw hex-encoded transaction to this endpoint and we'll leverage our huge network of nodes to propagate your transaction faster than anywhere else.

Resource Method Request Object Return Object
/txs/push POST {"tx":$TXHEX} TX

$TXHEX is a hex-encoded raw representation of your transaction, for example:

01000000011935b41d12936df99d322ac8972b74ecff7b79408bbccaf1b2eb8015228beac8000000006b483045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca012102152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044ffffffff0240420f00000000001976a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac20da3c00000000001976a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac00000000

If it succeeds, you'll receive a decoded TX object and an HTTP Status Code 201. If you'd like, you can use the decoded transaction hash alongside an Event to track its progress in the network.

Decode Raw Transaction Endpoint

Copy to Clipboard
# Note resource change to bcy/test instead of btc/main curl -d '{"tx":"01000000011935b41d12936df99d322ac8972b74ecff7b79408bbccaf1b2eb8015228beac8000000006b483045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca012102152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044ffffffff0240420f00000000001976a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac20da3c00000000001976a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac00000000"}' https://api.blockcypher.com/v1/bcy/test/txs/decode?token=YOURTOKEN { "block_height": -1, "hash": "4e6dfb1415b4fba5bd257c129847c70fbd4e45e41828079c4a282680528f3a50", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9", "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "total": 4988000, "fees": 12000, "size": 226, "vsize": 226, "preference": "high", "relayed_by": "73.162.198.68", "received": "2015-05-22T05:10:00.305308666Z", "ver": 1, "lock_time": 0, "double_spend": false, "vin_sz": 1, "vout_sz": 2, "confirmations": 0, "inputs": [ { "prev_hash": "c8ea8b221580ebb2f1cabc8b40797bffec742b97c82a329df96d93121db43519", "output_index": 0, "script": "483045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca012102152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044", "output_value": 5000000, "sequence": 4294967295, "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9" ], "script_type": "pay-to-pubkey-hash", "age": 576 } ], "outputs": [ { "value": 1000000, "script": "76a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac", "addresses": [ "C1rGdt7QEPGiwPMFhNKNhHmyoWpa5X92pn" ], "script_type": "pay-to-pubkey-hash" }, { "value": 3988000, "script": "76a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac", "addresses": [ "CEztKBAYNoUEEaPYbkyFeXC5v8Jz9RoZH9" ], "script_type": "pay-to-pubkey-hash" } ] }

We also offer the ability to decode raw transactions without sending propagating them to the network; perhaps you want to double-check another client library or confirm that another service is sending proper transactions.

Resource Method Request Object Return Object
/txs/decode POST {"tx":$TXHEX} TX

$TXHEX is a hex-encoded raw representation of your transaction, for example:

01000000011935b41d12936df99d322ac8972b74ecff7b79408bbccaf1b2eb8015228beac8000000006b483045022100921fc36b911094280f07d8504a80fbab9b823a25f102e2bc69b14bcd369dfc7902200d07067d47f040e724b556e5bc3061af132d5a47bd96e901429d53c41e0f8cca012102152e2bb5b273561ece7bbe8b1df51a4c44f5ab0bc940c105045e2cc77e618044ffffffff0240420f00000000001976a9145fb1af31edd2aa5a2bbaa24f6043d6ec31f7e63288ac20da3c00000000001976a914efec6de6c253e657a9d5506a78ee48d89762fb3188ac00000000

If it succeeds, you'll receive your decoded TX object.

Decode Transaction Witness To Sign Endpoint

Copy to Clipboard
curl -d '{"witness_tosign_tx":"01000000d0fe2d3feb5f3a5b6a99c244f21924b0249e2bc65c5745bdb618b1799066a80a3bb13029ce7b1f559ef5e747fcac439f1455a2ec7c5f09b72290795e706650448b3658589c258fb4b44180f158ae73d4dbaaf26d64c43a97a5cd78d9577f786d010000001976a9141b80a938a784abe7cdee8fdaf95f5f7e0b8cd0b988ac40420f0000000000ffffffff5fa4537c4c565583f8d32a36c3510808d38acc0ad18cc7e637be6523ebb39ff30000000001000000"}' https://api.blockcypher.com/v1/bcy/test/txs/decodeWitnessToSign?token=YOURTOKEN { "version": 1, "hash_prevouts": "0aa8669079b118b6bd45575cc62b9e24b02419f244c2996a5b3a5feb3f2dfed0", "hash_sequence": "445066705e799022b7095f7ceca255149f43acfc47e7f59e551f7bce2930b13b", "outpoint": "6d787f57d978cda5973ac4646df2aadbd473ae58f18041b4b48f259c5858368b", "outpoint_index": 1, "script_code": "76a9141b80a938a784abe7cdee8fdaf95f5f7e0b8cd0b988ac", "value": 1000000, "sequence": 4294967295, "hash_outputs": "f39fb3eb2365be37e6c78cd10acc8ad3080851c3362ad3f88355564c7c53a45f", "lock_time": 0, "sighash_type": 1 }

This endpoint allows you to decode the tosign_tx only in the case of the spending of a native segwit input (P2WPKH). This allows you to double check the which input you are spending and the value transfered.

Resource Method Request Object Return Object
/txs/decodeWitnessToSign POST {"witness_tosign_tx":$WITNESSTOSIGNTXHEX} WitnessToSignTx

$WITNESSTOSIGNTXHEX is a hex-encoded raw given by the #creating-transactions when includeToSignTx is to true, for example:

01000000d0fe2d3feb5f3a5b6a99c244f21924b0249e2bc65c5745bdb618b1799066a80a3bb13029ce7b1f559ef5e747fcac439f1455a2ec7c5f09b72290795e706650448b3658589c258fb4b44180f158ae73d4dbaaf26d64c43a97a5cd78d9577f786d010000001976a9141b80a938a784abe7cdee8fdaf95f5f7e0b8cd0b988ac40420f0000000000ffffffff5fa4537c4c565583f8d32a36c3510808d38acc0ad18cc7e637be6523ebb39ff30000000001000000

If it succeeds, you'll receive your decoded WitnessToSignTx object.

Multisig Transactions

Copy to Clipboard
{ "inputs": [{"addresses": [sourceAddr]}], "outputs": [{ "addresses" : [pubkey1, pubkey2, pubkey3], "script_type" : "multisig-2-of-3", "value" : 250000 }] }

Multisignature transactions are made simple by the method described in the Creating Transactions section, but they deserve special mention. In order to use them, you first need to fund a multisignature address. You use the /txs/new endpoint as before, but instead of the outputs addresses array containing public addresses, it instead contains the public keys associated with the new address. In addition, you must select a script_type of mutlisig-n-of-m, where n and m are numbers (e.g., multisig-2-of-3). The code example demonstrates how the partially filled TX request object would appear.

After you've set up your request object, you send to /txs/new and receive a partially filled TXSkeleton as before, but with data to sign from the source address. Sign this data and include the public key(s) of the source address---as demonstrated in the Creating Transactions---then send along to the /txs/send endpoint. If it returns with an HTTP Status Code 201, then your multisignature address (via a pay-to-script-hash address) is funded.

Spending Multisig Funds

Copy to Clipboard
{ "inputs": [{ "addresses" : [pubkey1, pubkey2, pubkey3], "script_type" : "multisig-2-of-3" }], "outputs": [{ "addresses" : [destAddr], "value" : 150000 }] }

Once funded, you might want to programmatically spend the money in the address at some point. Here the process is similar, but with the inputs and outputs reversed. As you can see in the code sample, you need to provide the public keys within the inputs addresses array, and the corresponding script_type of multisig-n-of-m (e.g., multisig-2-of-3). Then you follow the same process of sending to /txs/new and getting an array of data to be signed.

Each party can send their signed data individually to /txs/send and we can correlate the signatures to the public keys; once we have enough signatures we'll propagate the transaction. Or you can send all needed signatures alongside ordered public keys with a single call to /txs/send.

If you send all signatures in a single call, and you're spending inputs locked by a multisig-n-of-m script_type, remember that you'll need n signatures for every element in the TXSkeleton's tosign array. For example, let's say /txs/new returns two elements in the tosign array, corresponding to two multisig-2-of-3 inputs locked by pubkey1, pubkey2, and pubkey3:

{...,"tosign":[data1,data2],...}

Then you'd need to return each piece of data signed twice, preserving order between signatures and pubkeys, resulting in four elements for the signatures and pubkeys arrays:

{...,"tosign":[data1,data2], "signatures":[data1sig1,data1sig2,data2sig1,data2sig2], "pubkeys":[pubkey1,pubkey2,pubkey1,pubkey2],...}

Transaction Propagation Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/txs/5cad31bd8baf5d10ecdc275193f878226bb51f549c2357658f3dd0d7c5402a7b/propagation?token=YOURTOKEN { "transaction": "5cad31bd8baf5d10ecdc275193f878226bb51f549c2357658f3dd0d7c5402a7b", "first_location": { "latitude": 43.171, "longitude": -71.8229 }, "first_city": "Henniker", "first_country": "United States", "aggregated_origin": { "latitude": 44.283110947350366, "longitude": -69.82911485365968 }, "aggregated_origin_radius": 1023192, "first_received": "2016-08-30T21:25:37.427Z" }

By operating a well-connected node, we collect a lot of information about how transactions propagate; for example, our Confidence Factor relies on this connectivity. With this endpoint, you can leverage our connectivity to get an approximation of a transaction's location of origin.

Resource Method Return Object
/txs/$TXHASH/propagation GET Described Below

TXHASH is a string representing the hex-encoded transaction hash you're interested in querying for propagation information. The return object is described below:

Attribute Type Description
transaction string The hash of the transaction you queried.
first_location Object An object containing latitude and longitude floats representing the first location to broadcast this transaction to BlockCypher.
first_city string Optional The name of the city closest to the first_location. If no nearby city can be found, this is not returned.
first_country string The name of the country containing the first_location.
aggregated_origin Object An object containing latitude and longitude floats representing BlockCypher's best guess of likely origin of this transaction, based on the radius of the smallest circle containing the first peer from which we detect this transaction, the average of the first five peers, and the average of the first ten peers.
aggregated_origin_radius integer The radius (in meters) of the smallest circle containing the first peer from which we detect this transaction, the average of the first five peers, and the average of the first ten peers. In a general sense, this represents an approximate confidence interval in our calculated aggregated_origin; the smaller the radius, the more confidence in our aggregated_origin assessment.
first_received time The timestamp when BlockCypher first received this transaction.

Transaction Propagation WebSocket

You can get a live view of unconfirmed transaction propagation analysis on Bitcoin by connecting to our Transaction Propagation WebSocket, at the following address:

wss://socket.blockcypher.com/v1/btc/main?token=$TOKEN/txs/propagation

As soon as an unconfirmed transaction hits 10 peers, we send the object described above through this WebSocket. For more WebSocket implementation details, check Using WebSockets.

Confidence Factor

One of the things that makes BlockCypher's API uniquely powerful is our ability to accurately predict the likelihood of an attempted double-spend succeeding against a transaction; this percentage probability is optionally included within the confidence attribute on any unconfirmed transaction returned by the Transaction Hash Endpoint when using the includeConfidence flag, in addition to the explicit Transaction Confidence Endpoint detailed below.

So what does that confidence attribute actually mean? In simpler terms, if an unconfirmed transaction returns a confidence factor of 99.9%, then our data says there's a 0.1% chance that an attempted double-spend will succeed. By design, we're conservative. Even when we return 90% confidence, the likelihood of a successful double-spend is significantly lower than 10%.

As you may have gathered from the frequency of links to this feature in these docs, we're exceptionally proud of the work we've done to build this feature and provide it to our users. And that pride extends to our own confidence in our confidence product. We've leveraged this product internally on a major feature: our live block explorer visually shows confidence intervals on unconfirmed transactions directly. Check out a live view of bitcoin and click on one of the most recent unconfirmed transactions. Make sure you pick a very recent transaction: our confidence interval rapidly approaches 99% so quickly that you might miss it!

How does it work?

There are a host of factors that go into our confidence calculation, but you can broadly organize them into two categories. The shape of transactions refers to aspects of transactions that don't vary with time (time-invariant) in our model. The behavior of transactions refers to aspects of transactions that do vary with time (time-variant) in our model.

On the shape side of our model, we ask a number of questions about a transaction: How is it structured? What are its inputs and outputs? What's its signature type? Broadly speaking, without knowing anything about the network, does it look like this transaction will be confirmed soon?

The behavior part of our model primarily focuses on how a transaction propagates through the network. In order to model this correctly, you need both a great connection to the network and a lot of past data, which we have. As BlockCypher pools resources for many users, we're always connected to a statistically significant number of nodes on the network---we target anywhere between 10 to 20% of the active nodes on any given blockchain---and offer connections in return. By monitoring transaction propagation, the number of nodes that have received it, and how quickly they received it, we can calculate its probability to be the "winning" transaction at any given point in time, if a double-spend was attempted. (As an aside, you can always see if a double spend was attempted by checking the double_spend and double_spend_tx attributes on an unconfirmed transaction)

The result is a robust and reliable metric for judging unconfirmed transaction confidence, especially when used in concert with webhooks and websockets. Our work here is based on several public research results in addition to our own in-depth follow-up research, which you can read about here. We are constantly improving our confidence model, and we always publish our findings when we do.

Transaction Confidence Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/txs/43fa951e1bea87c282f6725cf8bdc08bb48761396c3af8dd5a41a085ab62acc9/confidence { "age_millis": 12725, "receive_count": 666, "confidence": 0.9901509730004237, "txhash": "43fa951e1bea87c282f6725cf8bdc08bb48761396c3af8dd5a41a085ab62acc9", "txurl": "https://api.blockcypher.com/v1/btc/main/txs/43fa951e1bea87c282f6725cf8bdc08bb48761396c3af8dd5a41a085ab62acc9" }
Resource Method Return Object
/txs/$TXHASH/confidence GET TXConfidence

TXHASH is a string representing the hex-encoded transaction hash you're interested in querying, for example:

43fa951e1bea87c282f6725cf8bdc08bb48761396c3af8dd5a41a085ab62acc9

The returned TXConfidence object contains the all-important confidence percentage, receive count and more.

You can find an unconfirmed transaction hash from our block explorer here.

Metadata API

Cryptocurrency addresses, transactions, and blocks are extremely powerful, but the labels they employ can be...cryptic. That's why we have a Metadata API, allowing both public and private key-value storage against addresses, transactions, and blocks.

Private vs Public Metadata

The Metadata API supports both public and private key-value storage. In both cases, setting metadata requires use of a token (if you haven't already, you can register for one here). Public metadata is immutable; once set, it cannot be modified or deleted. If you accidentally set public metadata and need it deleted, contact us. Also, as implied by the name, it's openly accessible to the whole world---regardless of whether they have a token or not. Consequently, private metadata is associated and only accessible with your user token. The methods for interacting with metadata are outlined below.

Get Metadata Endpoint

Copy to Clipboard
# Get Public Metadata (set by you or anyone else) curl https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN {"name":"silkroad","owner":"dpr"} # Get Private Metadata (none set yet, returns empty) curl https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN&private=true {}
Resource Method Return Object
/addrs/$ADDRESS/meta GET {"$KEY":"$VALUE",...}
/txs/$TXHASH/meta GET {"$KEY":"$VALUE",...}
/blocks/$BLOCKHASH/meta GET {"$KEY":"$VALUE",...}
Flag Type Effect
private bool If private is true, it will return privately stored metadata under your token. Otherwise, returns public metadata. If not set, it defaults to false, returning public data.

This endpoint retrieves metadata associated with a given $ADDRESS, $TXHASH, or $BLOCKHASH.

Put Metadata Endpoint

Copy to Clipboard
# Put Private Metadata, piping to grep to check 204 status code curl -X PUT -d '{"satoshi":"nakamoto", "alice":"bob"}' -is 'https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN&private=true' | grep "HTTP/1.1" HTTP/1.1 204 No Content # Get Metadata Again curl https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN&private=true {"satoshi":"nakamoto", "alice":"bob"} # Modify/Add Private Metadata curl -X PUT -d '{"satoshi":"moto", "charlie":"tango"}' -is 'https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN&private=true' | grep "HTTP/1.1" HTTP/1.1 204 No Content # Get Metadata Again curl https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN&private=true {"satoshi":"moto", "alice":"bob", "charlie":"tango"}
Resource Method Request Object Return Object
/addrs/$ADDRESS/meta PUT {"$KEY":"$VALUE",...} nil
/txs/$TXHASH/meta PUT {"$KEY":"$VALUE",...} nil
/blocks/$BLOCKHASH/meta PUT {"$KEY":"$VALUE",...} nil
Flag Type Effect
private bool If private is true, it will set/update privately stored metadata under your token. Otherwise, sets public metadata. If not set, it defaults to false, setting public metadata.

This endpoint sets or updates metadata (of the form {"$KEY1:$VALUE1,$KEY2:$VALUE2,...}") associated with a given $ADDRESS, $TXHASH, or $BLOCKHASH. If another key with the same name already exists under your private metadata store, supplying a new value will replace it. New key-value pairs will be added without replacing prexisting key-value pairs. If successful, it will return an HTTP Status Code 204 with no return object.

Delete Metadata Endpoint

Copy to Clipboard
# Delete Private Metadata, pipes to grep to check for 204 status code curl -X DELETE -Is https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN | grep "HTTP/1.1" HTTP/1.1 204 No Content # Get Private Metadata Again to Confirm Deletion curl https://api.blockcypher.com/v1/btc/main/addrs/1rundZJCMJhUiWQNFS5uT3BvisBuLxkAp/meta?token=YOURTOKEN&private=true {}
Resource Method Return Object
/addrs/$ADDRESS/meta DELETE nil
/txs/$TXHASH/meta DELETE nil
/blocks/$BLOCKHASH/meta DELETE nil

This endpoint deletes all private metadata associated with a given $ADDRESS, $TXHASH, or $BLOCKHASH and your token.

Asset API

Blockchains are about transferring value and ownership, so why can't that value extend beyond a blockchain's native token? Thanks to the possibility of embedding arbitrary data through null-data outputs, a blockchain can!

However, the act of creating these alternate forms of value---and choosing a format that was universally readable---can be fraught with difficulty. We built our Asset API to simplify that process. Now instead of spelunking through a blockchain's native transactions and interpreting them yourself, you can utilize this set of APIs to easily issue, check, and transfer assets. This set of endpoints currently leverages the Open Assets Protocol, a simple, robust method of embedding assets across any blockchain that supports null-data outputs.

The endpoints (and code examples) are ordered below to demonstrate how to create asset addresses, issue assets, transfer them, then query the assets/asset addresses you initially created.

Generate Asset Address Endpoint

Copy to Clipboard
# generate on bitcoin mainnet curl -X POST https://api.blockcypher.com/v1/btc/main/oap/addrs?token=YOURTOKEN { "private": "c0e09905fddb1b4a42d297cae1a5f20ca4cbe813e92a7dc4035ffc54561c05de", "public": "02e9431a3ba8d756a26c03c07ffda2a7e28a17b62051f77ea3944c21dc090ba45b", "oap_address": "akFjrBkcu9QQoJeBkwWeH54jnymaGVSUBAs", "original_address": "15mxwaoZfvX7SQ2PttY6RCqDeAQ6UqVjuM", "wif": "L3ge2aRsGReaBtYVYg9Lau2LxDkRW4Cak1dQsuttShEnRXcA1Vfy" } # generate on blockcypher testnet curl -X POST https://api.blockcypher.com/v1/bcy/test/oap/addrs?token=YOURTOKEN { "private": "0eb369746401c3369517239314a6bc0f2bda6124a4dda15643887f86dc0590cf", "public": "026b9f2786b96f7f1aae011a08f5aaccc70f2249606fac4c400d6aa35f50bf7373", "oap_address": "1ByJUiocpifLPaYVTALpA7JYa9DxpGxXKKP", "original_address": "ByJUiocpifLPaYVTALpA7JYa9DxpLQwte4", "wif": "BopcB66fRGgKkwiT2fKyxcawQBJ57DgNyvFq65XuVQdTboxsBkRm" } # generate another oap_address to use in examples below curl -X POST https://api.blockcypher.com/v1/bcy/test/oap/addrs?token=YOURTOKEN { "private": "442abd64783a6411d9e6eb0ed9575c6676bb51824aa3ad4b53577e3d344910c6", "public": "03121e17e0996513813c504c63016cea9a7cf9689025e33f9157bccea67ba60846", "oap_address": "1C3nrGhUDxBbr393u2Wq4PiE8T6oEYjYhrK", "original_address": "C3nrGhUDxBbr393u2Wq4PiE8T6oEYU9At1", "wif": "BqcYBWUvXszsRi1A5cD6t21CT7sbBoJQEkRSnFuoznJDn4hw5aGg" }
Resource Method Request Object Return Object
/oap/addrs POST nil AddressKeychain

The Generate Asset Address Endpoint returns a private/public keypair and the associated oap_address (the asset address) and original_address (native address on parent blockchain). Asset addresses are just like regular bitcoin addresses, and are generated from a private-public keypair. They only differ by a prefix (ex: 'a' for instead of '1') to distinguish them.

Issue Asset Endpoint

Copy to Clipboard
# Since this is a new address, I need to fund underlying bcy original_address # to enable issuance transaction (otherwise no money available for mining fees) # Going to use a faucet thanks to testnet curl -d '{"address": "ByJUiocpifLPaYVTALpA7JYa9DxpLQwte4", "amount": 1000000}' https://api.blockcypher.com/v1/bcy/test/faucet?token=YOURTOKEN {"tx_ref": "e7ca58724100f20b81e82ac24cb83cc112627be9cbfd2d09b96a87fbafe9e636"} # using same underlying (now-funded address) to issue 1000 assets # also could have used a different, funded bcy address to issue assets to a new oap_address curl -d '{"from_private": "0eb369746401c3369517239314a6bc0f2bda6124a4dda15643887f86dc0590cf", "to_address": "1ByJUiocpifLPaYVTALpA7JYa9DxpGxXKKP", "amount": 1000, "metadata": "1a2b3c4d5e6f"}' https://api.blockcypher.com/v1/bcy/test/oap/issue?token=YOURTOKEN { "ver": 1, "assetid": "1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui", "hash": "56253cffa1b3508d106391da3646cda2aee0bd080db427321c77ad11739e4239", "received": "2015-10-25T05:41:45.092075094Z", "double_spend": false, "oap_meta": "1a2b3c4d5e6f", "inputs": [], "outputs": [ { "address": "1ByJUiocpifLPaYVTALpA7JYa9DxpGxXKKP", "value": 1000, "original_output_index": 0 } ] }
Resource Method Request Object Return Object
/oap/issue POST OAPIssue OAPTX

The Issue Asset Endpoint issues new assets onto an OAP to_address, using your private key. Notice that an issuance returns an OAPTX with no inputs, since it is the original issue.

Transfer Asset Endpoint

Copy to Clipboard
# using assetid in endpoint as issued above # from private key curl -d '{"from_private": "0eb369746401c3369517239314a6bc0f2bda6124a4dda15643887f86dc0590cf", "to_address": "1C3nrGhUDxBbr393u2Wq4PiE8T6oEYjYhrK", "amount": 200, "metadata": "1a2b3c4d5e6f"}' https://api.blockcypher.com/v1/bcy/test/oap/1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui/transfer?token=YOURTOKEN { "ver": 1, "assetid": "1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui", "hash": "022e05bdfa2e148bc1882cb7a81506b8316fee6957b11625126d075a8cf8791b", "received": "2015-10-25T05:48:13.417949402Z", "oap_meta": "1a2b3c4d5e6f", "double_spend": false, "inputs": [ { "prev_hash": "56253cffa1b3508d106391da3646cda2aee0bd080db427321c77ad11739e4239", "output_index": 0, "address": "1ByJUiocpifLPaYVTALpA7JYa9DxpGxXKKP", "output_value": 1000 } ], "outputs": [ { "address": "1C3nrGhUDxBbr393u2Wq4PiE8T6oEYjYhrK", "value": 200, "original_output_index": 1 } ] }
Resource Method Request Object Return Object
/oap/$ASSETID/transfer POST OAPIssue OAPTX

The Transfer Asset Endpoint transfers already issued assets (represented by ASSETID) onto a different OAP to_address, using your private key.

List Asset TXs Endpoint

Copy to Clipboard
# using asset id as generated above curl https://api.blockcypher.com/v1/bcy/test/oap/1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui/txs?token=YOURTOKEN [ "5f13d5c56ed5b7fe673832e2b5b21feceecebfd08aef03f3208ee855d25f050c", "022e05bdfa2e148bc1882cb7a81506b8316fee6957b11625126d075a8cf8791b", "7216fd3fb2908f87255f9514c98f40cf1299ea6b9182fa4825f5c5bfacf8b038", "56253cffa1b3508d106391da3646cda2aee0bd080db427321c77ad11739e4239", "dff06ef62b8d67ce6eb0750ed0a414932c1b13b825870d8711cd81219418f6d4" ]
Resource Method Return Object
/oap/$ASSETID/txs GET Array[String]

The List Asset TXs Endpoint returns an array of strings representing transaction hashes associated with this ASSETID.

Get Asset TX Endpoint

Copy to Clipboard
# using asset id as generated above, and first txhash from list asset txs endpoint curl https://api.blockcypher.com/v1/bcy/test/oap/1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui/txs/5f13d5c56ed5b7fe673832e2b5b21feceecebfd08aef03f3208ee855d25f050c?token=YOURTOKEN { "ver": 1, "assetid": "1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui", "hash": "5f13d5c56ed5b7fe673832e2b5b21feceecebfd08aef03f3208ee855d25f050c", "block_height": 506539, "confirmed": "2015-10-25T04:50:06Z", "received": "2015-10-25T04:49:32.37Z", "double_spend": false, "oap_meta": "1a2b3c4d5e6f", "inputs": [], "outputs": [ { "address": "1ByJUiocpifLPaYVTALpA7JYa9DxpGxXKKP", "value": 1000, "original_output_index": 0 } ] }
Resource Method Return Object
/oap/$ASSETID/txs/$TXHASH GET OAPTX

The Get Asset TX Endpoint returns an OAPTX by TXHASH and ASSETID.

Get Asset Address Endpoint

Copy to Clipboard
# using the transfer address from above curl https://api.blockcypher.com/v1/bcy/test/oap/1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui/addrs/1C3nrGhUDxBbr393u2Wq4PiE8T6oEYjYhrK?token=YOURTOKEN { "address": "1C3nrGhUDxBbr393u2Wq4PiE8T6oEYjYhrK", "total_received": 200, "total_sent": 0, "balance": 200, "unconfirmed_balance": 0, "final_balance": 200, "n_tx": 1, "unconfirmed_n_tx": 0, "final_n_tx": 1, "txrefs": [ { "tx_hash": "022e05bdfa2e148bc1882cb7a81506b8316fee6957b11625126d075a8cf8791b", "block_height": 506598, "tx_input_n": -1, "tx_output_n": 1, "value": 200, "ref_balance": 200, "spent": false, "confirmations": 26, "confirmed": "2015-10-25T05:49:07Z", "double_spend": false } ], "tx_url": "https://api.blockcypher.com/v1/bcy/test/oap/1Npqwstp55vgThp4pwAC9UhYkvPJ28b2Ui/txs/" }
Resource Method Return Object
/oap/$ASSETID/addrs/$OAPADDR GET Address

The Get Asset Address Endpoint returns an Address representing information about a particular OAPADDR underneath a given ASSETID. Note that while it returns an Address object, anything that would have represented "satoshis" now represents "amount of asset." (e.g., balance, value, etc.)

Address Forwarding

One of the well-known benefits of cryptocurrency is the ability to allow users to partake in online commerce without necessarily requiring extensive setup barriers, like registering new accounts. In that spirit, our Address Forwarding API is the easiest way to accept---and consolidate---payments securely without forcing your users to create accounts and jump through unnecessary loops. It's also a generic way to automatically transfer value from one address to another. While there are many possible use cases, the two we hear most about are:

We do not take a fee on address forwarding, other than the required miner fee which depends on network conditions; forwards are free. However, as part of your own services, you can include a fee (either fixed or a percentage) that will also be automatically transfered to your own address in the same transaction. Fee-based business models are thus easily achieved, and moreover, easily auditable via the blockchain.

Create Forward Endpoint

Copy to Clipboard
curl -d '{"destination":"15qx9ug952GWGTNn7Uiv6vode4RcGrRemh","callback_url": "https://my.domain.com/callbacks/new-pay"}' https://api.blockcypher.com/v1/btc/main/forwards?token=YOURTOKEN { "input_address": "16uKw7GsQSzfMaVTcT7tpFQkd7Rh9qcXWX", "destination": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "callback_url": "https://my.domain.com/callbacks/forwards", "id": "399d0923-e920-48ee-8928-2051cbfbc369", "token": "YOURTOKEN" }

First, to create an address forwarding address, you need to POST a partially filled AddressForward object to the payment creation endpoint. You need to include at least a destination address and your token; optionally, you can add a callback_url, processing fees (either percent or fixed) and a process_fee_address, and a few other options. You can see more details about these options in the AddressForward object details.

Resource Method Request Object Return Object
/forwards POST AddressForward addressForward

In return, you'll get a more complete AddressForward object, including an input_address and id.

List Payments Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/forwards?token=YOURTOKEN [ { "input_address": "16uKw7GsQSzfMaVTcT7tpFQkd7Rh9qcXWX", "destination": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "callback_url": "https://my.domain.com/callbacks/forwards", "id": "399d0923-e920-48ee-8928-2051cbfbc369", "token": "YOURTOKEN" } ]

To list your currently active address forwarding addresses, you can use this endpoint.

Resource Method Return Object
/forwards GET Array[AddressForward]
Flag Type Effect
start integer Returns list of address forwards starting at the start index; useful for paging beyond the limit of 200 address forwards.

This returns the full array of your currently active address forwarding addresses, based on your token. By default, this endpoint only returns the first 200 address forwards. If you have more, you can page through them using the optional start parameter.

Delete Payment Endpoint

Copy to Clipboard
# Piping to grep to just show status code curl -X DELETE -Is https://api.blockcypher.com/v1/btc/main/forwards/399d0923-e920-48ee-8928-2051cbfbc369?token=YOURTOKEN | grep "HTTP/1.1" HTTP/1.1 204 No Content

When you're done with an address forwarding address, you can delete it via its id.

Resource Method Return Object
/forwards/$PAYID DELETE nil

PAYID is a string representing the address forwarding request you want to delete, for example:

399d0923-e920-48ee-8928-2051cbfbc369

This will return no object, but will return an HTTP Status Code 204 if the request was successfully deleted.

Events and Hooks

Blockchains are highly transactional systems. Many usage patterns require knowing when an event occurs: i.e., when a transaction is included into a block, or when an unconfirmed transaction is relayed through the network. Instead of requiring you to continuously poll resources, we provide push APIs to facilitate those use cases, and support both WebSockets and WebHooks.

Which Should I Use?

WebSockets are typically used in client applications when a server is not already running: e.g., a web page displaying the most recent transactions or a wallet app updating its UI when a transaction has been confirmed. Websockets are less reliable in longer interactions (> 1 hour) because they require a connection to stay open.

WebHooks are the most reliable way to get event notifications but requires running a server to receive the callbacks. We automatically retry HTTP requests 5 times.

Types of Events

We support a number of different event types, and you can filter your notification requests depending on how you structure your Event request object.

Event Description
unconfirmed-tx Triggered for every new transaction BlockCypher receives before it's confirmed in a block; basically, for every unconfirmed transaction. The payload is an unconfirmed TX.
new-block Triggered for every new block added to the blockchain you've selected as your base resource. The payload is a Block.
confirmed-tx Triggered for every new transaction making it into a new block; in other words, for every first transaction confirmation. This is equivalent to listening to the new-block event and fetching each transaction in the new Block. The payload is a confirmed TX.
tx-confirmation Simplifies listening to confirmations on all transactions for a given address up to a provided threshold. Sends first the unconfirmed transaction and then the transaction for each confirmation. Use the confirmations property within the Event to manually specify the number of confirmations desired (maximum 10, defaults to 6). The payload is a TX.
double-spend-tx Triggered any time a double spend is detected by BlockCypher. The payload is the TX that triggered the event; the hash of the transaction that it's trying to double spend is included in its double_spend_tx property.
tx-confidence Triggered any time an address has an unconfirmed transaction above the confidence property specified in the Event, based on our Confidence Factor. The payload is the TX that triggered the event. If confidence is not set, defaults to 0.99. To ensure transactions are not missed, even if your confidence threshold is not reached, a transaction is still sent after a minute timeout; please remember to double-check the confidence attribute in the TX payload.

Using WebSockets

Copy to Clipboard
# no websockets via cURL, check the Javascript example

Opening a WebSocket to listen to our feeds is easy, like so in Javascript:

new WebSocket("wss://socket.blockcypher.com/v1/btc/main?token=$TOKEN");

The code may differ if you're not programming in Javascript (check relevant code examples for our standard libraries) but the URL will be identical. Once the socket is opened, the JSON document representing the Event of interest should be sent.

In addition to standard events, WebSockets accept a "ping" event. If you send the following, you will receive the same message back with "ping" replaced by "pong":

{ "event": "ping" }

A regular ping (i.e. every 20 seconds) allows the WebSocket to stay connected for a longer period of time.

Using WebHooks

WebHooks leverage similar objects and interactions but with two key differences:

We retry individual payloads to your url five times; if one fails, we wait exponentially between retries: 1 second, 2s, 4s, 8s, 16s. In order to protect against stale callback urls, your Event will be deleted if it reaches 50 aggregate callback_errors from failed payloads.

Create WebHook Endpoint

Copy to Clipboard
curl -d '{"event": "unconfirmed-tx", "address": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "url": "https://my.domain.com/callbacks/new-tx"}' https://api.blockcypher.com/v1/btc/main/hooks?token=YOURTOKEN { "id": "399d0923-e920-48ee-8928-2051cbfbc369" "event": "unconfirmed-tx", "address": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "token": "YOURTOKEN", "url": "https://my.domain.com/callbacks/new-tx", "callback_errors": 0 }

Using a partially filled out Event, you can create a WebHook using this resource. Check the Event object description and types of events to understand the options available for your events.

Resource Method Request Object Return Object
/hooks POST Event Event

If successful, it will return the Event with a newly generated id.

List WebHooks Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/hooks?token=YOURTOKEN [ { "id": "399d0923-e920-48ee-8928-2051cbfbc369" "event": "unconfirmed-tx", "address": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "token": "YOURTOKEN", "url": "https://my.domain.com/callbacks/new-tx", "callback_errors": 0 } ]

This resource lists your currently active events, according to the base resource and $YOURTOKEN.

Resource Method Return Object
/hooks?token=$YOURTOKEN GET Array[Event]

WebHook ID Endpoint

Copy to Clipboard
curl https://api.blockcypher.com/v1/btc/main/hooks/399d0923-e920-48ee-8928-2051cbfbc369 { "id": "399d0923-e920-48ee-8928-2051cbfbc369" "event": "unconfirmed-tx", "address": "15qx9ug952GWGTNn7Uiv6vode4RcGrRemh", "token": "YOURTOKEN", "url": "https://my.domain.com/callbacks/new-tx", "callback_errors": 0 }

This resource returns an Event based on its generated id.

Resource Method Return Object
/hooks/$WEBHOOKID GET Event

WEBHOOKID is a string representing the event's generated id, for example:

399d0923-e920-48ee-8928-2051cbfbc369

Delete WebHook Endpoint

Copy to Clipboard
# Piping into grep to get status code curl -X DELETE -Is https://api.blockcypher.com/v1/btc/main/hooks/399d0923-e920-48ee-8928-2051cbfbc369?token=YOURTOKEN | grep "HTTP/1.1" HTTP/1.1 204 OK

This resource deletes an active Event based on its id. Remember to include your token, or the request will fail.

Resource Method Return Object
/hooks/$WEBHOOKID DELETE nil

WEBHOOKID is a string representing the event's generated id, for example:

399d0923-e920-48ee-8928-2051cbfbc369

If successful, it won't return any objects, but will respond with an HTTP Status Code 204.

WebHook Signing

To guarantee the origin and integrity of the webhook data, webhooks can optionally be signed by our servers. An optional JSON attribute called "signkey" can be provided with the webhook when created to either:

  1. A PEM-encoded ECDSA private key that you created.
  2. The string "preset", in which case the BlockCypher signing key will be used. The associated x509 PKIX encoded public key for our webhook signing key is MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEflgGqpIAC9k65JicOPBgXZUExen4rWLq05KwYmZHphTU/fmi3Oe/ckyxo2w3Ayo/SCO/rU2NB90jtCJfz9i1ow==

Once the "signkey" attribute is set on a webhook, all webhook requests will be signed following the sha256-ecdsa scheme of the HTTP signatures specification.

Updates

This section list all the updates in reverse chronological order. All dates are in the DD/MM/YY format.

28/10/21 - Partial Taproot Support

We are happy to announce that BlockCypher now support P2TR (Taproot). Please not that it is not possible to create a transaction that spend a P2TR but you can send to P2TR. We support the new bech32m address format for v1 witness.

18/10/21 - Fix Unconfirmed Transactions on Address Full Endpoint

Previously, when using the address full endpoint with confirmations>0, you'd still get unconfirmed transactions. This is fixed.

14/10/21 - Fix Websocket Origin Check

We fixed an error where using blockcypher websocket would returns a 403.

06/08/21 - New Filters for Uncofirmed Transactions Endpoint

We've added new filters possibilities to the Unconfirmed Transactions Endpoint.

11/06/21 - Data Endpoint Terminated

The data endpoint no longer exists as it was uneconomical and thus non functional since a long time.

19/02/21 - Node-Client Archived

BlockCypher Node.js SDK is now archived. We recommend that javascript users use HTTP libraries such as Axios. The POSTMAN documentation contains all the examples that you need.

18/02/21 - Virtual Size for Blocks

Virtual size (vsize) for blocks.

12/02/21 - Virtual Size for Segwit Transaction

We've added the virtual size (vsize) for segwit transaction. For regular (non-segwit) transaction the vsize is the same as the size. This is how you can see how much fees you are saving by using segwit. Enjoy!

04/02/21 - Creation of the "Updates" Section

We've created this new "Updates" section to let you know about the new feature and bugfixes we deployed :).

03/02/21 - Additional DNS Seeds for Doge

Following last week Dogecoin chain lag due to unhealthy network conditions, we've added new DNS seeds thanks to Denarius.

02/02/21 - Additional Support for Litecoin Maddrs

Following previous updates to enhance the support of "Maddrs" on Litecoin, we've added several bugfixes:

27/11/20 - New DASH DNS Seeds

We've updated our DASH DNS seeds in order to provide a more reliable service.

23/11/20 - Payment Forward for Litecoin MAddrs

We've added the ability to create payment forward to Litecoin address with the M prefix.

17/11/20 - OP_RETURN Simplification

We've added the ability to create OP_RETURN output as easily as including null-data as script-type. See the TXOutput object for more details.