NAV Navigation
BETA Version
Shell HTTP JavaScript Node.JS PHP Ruby Python Java Go

Introduction

Welcome to the Crypto APIs documentation! Cryptoapis.io is a simple, mostly RESTful JSON API for interacting with blockchains, accessed over HTTPS from the api.cryptoapis.io domain. Crypto APIs is an all-in-one platform unifying the way developers interact with Blockhains & Crypto Exchanges.

You will be able to get a wide range of data for top cryptocurrency exchanges & blockchains, plus integrate our API’s using this technical documentation. It is a fast, reliable and unified API Endpoint provider to access real-time or historical data.

Currently, there is only one version of our API (v1).

Getting Started

You can save time by using our Rest APIs, WebSockets and SDKs. We provide direct access to the most important blockchains and data to more than 150 top crypto exchanges.

Here is what you need to do next in order to get started:

Step 1: Read the documentation or Pick SDK

We recommend that you read the API documentation (https://docs.cryptoapis.io/) and familiarize yourself with the different API functions and calls so you can get the most out of the Crypto APIs!

For SDK’s:

Step 2: Create API Key

Production endpoints, require API key for authentication and providing real data. Be sure to generate an API Key from your Crypto APIs dashboard - https://dashboard.cryptoapis.io/account/api-keys . Click on “Create New API Key”.

Step 3: Using your API Key

You will be able to generate multiple API keys and to enable/disable them at any time. You may use them to get access to Crypto APIs Endpoints related to blockchains and exchanges. Be sure to authenticate yourself when performing queries to Crypto APIs.

Step 4: Get the right package for your business

In order to get the full potential of Crypto APIs, we suggest that you select the best package for your business needs. Follow the link below & sign-in.

Simply, select “Purchase” for your preferred plan and follow the instructions.

In case you need any help, please don't hesitate to use our direct chat or send us an email to: [email protected].

RESTFul resources

RESTful JSON API’s for interacting with blockchains & exchanges, are accessed over HTTPS from the https://api.cryptoapis.io domain. Currently, Crypto APIs supports Bitcoin, Ethereum, Litecoin, & Bitcoin Cash, both main & test net. We are working on implementing more blockchain such as EOS, Stellar & Ripple, plus additional exchanges. The data provided is HTTPS protocol which works on a Request-Reply basis.

All resources under a particular blockchain follow the following patter:

https://api.cryptoapis.io/$API_VERSION/BC/$COIN/${NETWORK}

Coin Network Resource
Bitcoin Main https://api.cryptoapis.io/v1/bc/btc/mainnet
Bitcoin Testnet https://api.cryptoapis.io/v1/bc/btc/testnet
Bitcoin Cash Main https://api.cryptoapis.io/v1/bc/bch/mainnet
Bitcoin Cash Testnet https://api.cryptoapis.io/v1/bc/bch/testnet
Litecoin Main https://api.cryptoapis.io/v1/bc/ltc/mainnet
Litecoin Testnet https://api.cryptoapis.io/v1/bc/ltc/testnet
Ethereum Main https://api.cryptoapis.io/v1/bc/eth/mainnet
Ethereum Ropsten (Testnet) https://api.cryptoapis.io/v1/bc/eth/ropsten
Ethereum Rinkeby (Testnet) https://api.cryptoapis.io/v1/bc/eth/rinkeby

Regarding our data provided by the exchanges, we have production endpoints, which require API Credentials for authentication and providing real-data: https://api.cryptoapis.io domain. In order to get real-time market data streaming, use WebSockets provided by Crypto APIs.

Exchange Functionality Resource Pathways Description
Get Exchanges https://api.cryptoapis.io/v1/exchanges Get a detailed list of exchanges provided by the system.
Get Assets https://api.cryptoapis.io/v1/assets Get detailed list of assets.
Get Mappings https://api.cryptoapis.io/v1/mappings Get detailed list of symbols & mappings.
Get OHLCV https://api.cryptoapis.io/v1/ohlcv Open, High, Low, Close, Volume timeseries data.
Get Trades https://api.cryptoapis.io/v1/trades This section describes calls related to executed transactions data, also known as matched orders data or active data.
Get Quotes https://api.cryptoapis.io/v1/quotes This section describes calls related to quotes data, also known as quotes or passive level 1 data.

WebSocket resources

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.

WebSocket endpoint provides real-time market data streaming from the exchanges, which works in Subscribe-Publish communication model.

Crypto APIs WebSocket API is located on wss://ws.cryptoapis.io

Authentication

Getting an API Key

Production endpoints, require API key for authentication and providing real data. Be sure to create and get your API key from the API Keys section on the CryptoAPIs dashboard - https://dashboard.cryptoapis.io/account/api-keys

From there you can also create new API keys and delete old ones, which you do not want to have access anymore.

Using your API Key

'X-API-Key: my-api-key' 'Content-Type: application/json'

Once API Key has been obtained, you may use it to get access to Crypto APIs Endpoints related to blockchains and exchanges.

API Credential Usage Credits

Most plans include a daily limit or “hard stop” to the number of data calls that can be made and the results provided by Crypto APIs. This limit is tied directly to your API Key usage and number of credits purchased. Your daily credits will be re-loaded counting 24 hrs back from the initial request.

The daily credit limit is tracked based on API data calls & results provided with your key. Each credit is accounted for and incremented 1:1, with the exception of:

  1. Error responses are not included in this monthly limit.
  2. Paginated Endpoints: List based endpoints. Credit allocation per API credentials is done for every 50 data results returned, always rounded-up.
  3. Bundled/Batched API calls: Credit allocation per API credentials is done for every 50 data results returned, always rounded-up.

Standards & Conventions

This section represents used standards, conventions and object across all documents and API Endpoints, provided by Crypto APIs.

Endpoint Response Payload Format

All endpoints return results in JSON format and JSON/HTTPS binding for Ethereum based contracts, when the call is successfully executed.

Status object is always included for both successful calls and failures when possible. The Status object always includes the current time on the server when the call was executed as time-stamp, the number of API call credits this call utilized as credit count, and the number of milliseconds it took to process the request as elapsed. Any details about errors encountered can be found under the error_code and error_message.

Cryptocurrency, Exchanges and Fiat currency identifiers

All of the identifiers used are ISO compliant and used in accordance to the unique Crypto APIs ID.

  1. Cryptocurrencies may be identified using their unique exchange name (ex. Bitcoin) or through their asset ID (ex. BTC). You may get a list of all active assets from Crypto APIs by calling the endpoint /v1/assets.
  2. Exchanges supported by Crypto APIs may be identified using the unique exchange name (ex. Kraken) or through their exchange ID (ex. KRAKEN). You may get a list of all active exchange from Crypto APIs by calling the endpoint /v1/exchanges.
  3. All of the fiat currency options use the standard ISO 8601 currency codes (ex. USD for US Dollar or EUR for Euro). Unless otherwise stated, endpoints with fiat currency options support these major currency codes:
    Currency Code Currency
    AED United Arab Emirates Dirham
    ALL Albanian Lek
    ARY Peso
    ATS Authorship
    AUD Australian Dollar
    BAM Convertible Mark
    BEC Convertible Franc
    BGN Bulgarian Lev
    BHD Bahraini Dinar
    BOB Boliviano
    BOP Peso Boliviano
    BRC Cruzado
    BRE Cruzeiro
    BRL Brazilian Real
    BSD Bahamian Dollar
    BUK Burma
    CAD Canadian Dollar
    CHC WIR Franc
    CHF Swiss Franc
    CNX Peoples Bank Dollar
    CNY Yuan Renminbi
    CRC Costa Rican Colon
    CYP Cyprus Pound
    CZK Czech Koruna
    DEM Deutsche Mark
    DKK Danish Krone
    ESP Spanish Peseta
    ETB Ethiopian Birr
    EUR Euro
    GBP Pound Sterling
    GHS Ghana Cedi
    HKD Hong Kong Dollar
    HRK Croatian Kuna
    HUF Forint
    IDR Rupiah
    ILS New Israeli Sheqel
    INR Indian Rupee
    JPY Yen
    KRW Won
    LTT Talonas
    LUC Luxembourg Convertible Franc
    MAD Moroccan Dirham
    MTL Maltese Lira
    MUR Mauritius Rupee
    MVR Rufiyaa
    MXN Mexican Peso
    MYR Malaysian Ringgit
    NGN Naira
    NIC Cordoba
    NLG Netherlands Guilder
    NOK Norwegian Krone
    NZD New Zealand Dollar
    PEN Nuevo Sol
    PHP Philippine Peso
    PLN Zloty
    RON New Romanian Leu
    RUB Russian Ruble
    RUR Russian Ruble
    SBD Solomon Islands Dollar
    SDG Sudanese Pound
    SEK Swedish Krona
    SGD Singapore Dollar
    SLL Leone
    SUR Rouble
    SVC El Salvador Colon
    THB Baht
    TOP Top Coin
    TRY Turkish Lira
    TWD New Taiwan Dollar
    UAH Hryvnia
    USD US Dollar
    XAG Silver
    XAU Gold
    XBB Bond Markets Monetary Unit
    XBC Bond Markets Unit of Account 9
    XPD Petro Dollar
    XPT Platinum
    XRE Revolver Coin
    ZAR Rand

Date and Time Formats

For all required endpoints with time stamp, input and output time values used are UNIX standard based (eg. 1540220759 or translated 10/22/2018 @ 3:05pm (UTC)). If a time-zone isn’t specified, we default to UTC. All time stamps returned in JSON payloads are returned in UTC time and can be converted here for human eye readability.

The UNIX time stamp is a way to track time as a running total of seconds. This is very useful to computer systems for tracking and sorting dated information in dynamic and distributed applications both online and client side

Objects

This section provides details all the Objects exposed and expected by the API. The information below will 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 and their endpoints.

Blockchain

A Blockchain represents the current state of a particular currency blockchain. Typically returned from the Chain API Endpoint:

Attributes Type Description
name string The name of the blockchain represented, in the form of $COIN.$NETWORK.
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)), in Ethereum, the hashing function is Keccak/SHA3.
time time The time of the latest update to the blockchain; typically when the latest block was added.
latest_url url The 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 URL to query for more information on the second-to-latest confirmed block; returns a Block.
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.
high_gas_price integer A rolling average of the gas price (in wei) for transactions to be confirmed within 1 to 2 blocks.
medium_gas_price integer A rolling average of the gas price (in wei) for transactions to be confirmed within 3 to 6 blocks.
low_gas_price integer A rolling average of the gas price (in wei) 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

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

Attributes Type Description
hash string The hash of the block; in Bitcoin, the hashing function is SHA256(SHA256(block)); The hash of the block; in Ethereum, the hashing function is Keccak/SHA3
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.$NETWORK
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. The total number of fees—in wei—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.
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 Crypto APIs servers receive the block. Our servers’ clock is continuously adjusted and accurate.
relayed_by string Address of the peer that sent Crypto APIs 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 Crypto APIs URL to query for more information on the previous block.
tx_url url The base Crypto APIs 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 Crypto APIs URL to query the next set of transactions (within a Block object).
internal_txids array[string] An array of internal transaction hashes (initiated by internal contracts) in this block. By default, only 20 are included.
next_internal_txids url Optional If there are more internal transactions that couldn’t fit in the internal_txids array, this is the Crypto APIs URL to query the next set of transactions (within a Block object).
coinbase_addr string The Ethereum address of the miner that received the coinbase and fee reward.

TX

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.

Attributes 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 cryptocurrency public addresses involved in the transaction.
total integer The total number of satoshis or wei exchanged in this transaction.
fees integer The total number of fees—in satoshis or wei—collected by miners in this transaction.
size integer The 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.
gas_used integer The amount of gas used by this transaction.
gas_price integer The price of gas—in wei—in this transaction.
relayed_by string Address of the peer that sent Crypto APIs’s servers this transaction.
received time Time this transaction was received by Crypto APIs’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.
internal_txids array[string] Optional If this transaction executed a contract which propagated its own subsequent transactions, then this array will be present, containing the hashes of those subsequent internal transactions.
parent_tx string Optional If this transaction was initiated by a contract, this field will be present, conveying the hash of the parent transaction that executed the contract resulting in this transaction (the inverse of an internal_txids hash).
confirmed time Optional Time at which transaction was included in a block; only present for confirmed transactions.
gas_limit integer Optional If creating a transaction, can optionally set a higher default gas limit (useful if your recipient is a contract).
contract_creation bool Optional If true, this transaction was used to create a contract and contract account. Note that the contract address (in the outputs field) will be blank until the transaction is confirmed
receive_count integer Optional Number of peers that have sent this transaction to Crypto APIs; only present for unconfirmed transactions.
change_address string Optional Address Crypto APIs 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 its 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 Crypto APIs 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 Crypto APIs URL to query the next set of TXOutputs(within a TX object).
execution_error string Optional If this transaction has an execution error, then this field will be included (e.g. “out of gas”).

TXInput

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.

Attributes 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

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

Attributes Type Description
value int Value in this transaction output.
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.

TXRef

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.

Attributes 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 transferred by this input/output in satoshis or wei 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.
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 Crypto APIs servers; only present for unconfirmed transactions.
receive_count integer Optional Number of peers that have sent this transaction to Crypto APIs; 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 is double-spending.

TXSkeleton

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

Attributes 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.

Address

An Address represents a public address on a blockchain or the state of the address/account, 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.

Attributes Type Description
address string 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 or wei received by this address.
total_sent integer Total amount of confirmed satoshis or wei sent by this address.
balance integer Balance of confirmed satoshis or wei 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 or wei 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 or wei, 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.

Address Keychain

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.

Attributes 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

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.

Attributes 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.

HDWallet

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. 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.

Attributes 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.

HDChain

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

Attributes 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

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.

Attributes 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.

Contract

A Contract represents an embedded contract on the Ethereum blockchain, and is used with both creating and executing contracts in our Contract API. All the fields below are generally optional, but may be required depending on the particular contract endpoint you’re using.

Attributes Type Description
solidity string Solidity code of this contract; required when creating a contract. In responses, only returned with contracts initially compiled by Crypto APIs.
params Array[string] Parameters for either contract creation or method execution.
publish Array[string] Named contract(s) to publish; necessary to specify when first creating a contract.
private string Private key associated with a funded Ethereum external account used to publish a contract or execute a method.
gas_limit int Maximum amount of gas to use in contract creation or method execution.
value int Amount (in wei) to transfer; can be used when creating a contract or calling a method.
name string Name of contract as published.
bin string Hex-encoded binary compilation of this contract.
abi ABI JSON-encoded ABI. Only returned with contracts initially compiled by Crypto APIs.
address string Hex-encoded address of this contract.
created time Timestamp when this contract was confirmed in the Ethereum blockchain.
creation_tx_hash string Hex-encoded transaction hash that created this contract.
results Array[string] If this is a response from a calling a contract method, this array of results may appear if the method returns any.

Event

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

Attributes 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.
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.

PaymentForward

A PaymentForward object represents a request set up through the Payment Forwarding service.

Attributes Type Description
id string Identifier of the payment forwarding request; generated when a new request is created.
token string The mandatory user token.
destination string The required destination address for payment forwarding.
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 and wei 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 payment 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 payment forward; not present if this request has yet to forward any transactions.
id string I dentifier of the payment forwarding request; generated when a new request is created.

PaymentForwardCallback

A PaymentForwardCallback object represents the payload delivered to the optional callback_url in a PaymentForward request.

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

Errors & Rate Limits

HTTPS Errors

HTTPS Errors are all request with response status code different than 200 (successful HTTP), must be considered as failure of a particular API call. You should expect additional JSON inside the body of the response with the error message encapsulated inside it as shown in the example.

We recommend, as best practice, to store all error messages somewhere along with request data for further manual review. We use the following error codes:

Error Code Description
400 (Bad Request) Something is wrong with your request, possibly due to invalid argument.
401 (Unauthorized) Lack of valid authentication credentials, your API key is wrong/invalid.
403 (Forbidden) The request was rejected due to a permission issue. Your API does not have enough privileges/credits to access this resource.
404 (No Data) You requested specific single item that we don’t have at this moment.
429 (Too Many Requests) Your API key rate limits have been exceeded.
500 (Internal Server Error) An unexpected server error was encountered, we are working on fixing this.

Rate Limits

Crypto API’s professional service is subject to API call rate limits, based on your subscription plan tier. If you are interested in custom subscription tier for higher limits, reach out to us.

If you exceed these limits, your requests will return an HTTPS Status Code 429.

The rate limits are on call per day, per hour, per minute & per second in correspondence to available credits. Your daily credits are accounted for 24 hrs from the initial call to our API-Gateway.

Endpoint Overview

Our professional API is divided into several main categories:

Category Description
Exchanges Endpoint call, which will return market data from crypto exchanges. For example, exchanges lists, trades & quotes details, exchange rates and market pair data.
Blockchains Endpoints that return data around cryptocurrencies, such as general information for the blockchain, transactions & addresses.

Crypto APIs provides a unique product for all its clients by unifying, as much as possible, the most common blockchain endpoint functionalities. We have made two mandatory parameters, which can be dynamic per blockchain: COIN & NETWORK.

The power of the product is exactly this a unified common path, where all you have to do is change the coin value and the network, so that you get the requested information from the blockchain. Visit our Blockchain--> Common section for details.

REST API

Exchanges

Crypto APIs provides a wide range of data driven API endpoints from 100+ exchange, which will allow you to get access to information in a Request – Reply Scheme or Subscribe – Publish communication model. You will be able to get information about current, latest & historical data, plus exchange rates.

Metadata

In this section, you will be able to get information about the exchanges supported by Crypto APIs.

List All Exchanges

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/exchanges' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/exchanges HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/exchanges').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/exchanges",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/exchanges');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/exchanges")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/exchanges'
headers = {
  'Content-Type' : 'application/json',
  'X-API-Key' : 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/exchanges")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/exchanges")
}

Response Body

{
    "meta": {
        "totalCount": 100
    },
    "payload": [
        {
            "exchangeId": "BITTREX",
            "name": "Bittrex",
            "website": "https://bittrex.com/",
            "_id": "5b4366dab98b280001540e16",
            "_created": 1531143898,
            "_lastModified": 1531143898
        },
        ....
        {
            "exchangeId": "BITFINEX",
            "name": "Bitfinex",
            "website": "https://www.bitfinex.com/",
            "_id": "5b4366dab98b280001540e18",
            "_created": 1531143898,
            "_lastModified": 1531143898
        }
    ]
}

Get a detailed list of all supported exchanges provided by our system.

HTTP Request

GET /v1/exchanges

Output Variables
Endpoint Name HTTP Request
exchangeId Our exchange identifier
website Exchange website address
name Display name of the exchange

List All Assets

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/assets' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/assets HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/assets').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/assets",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/assets');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/assets")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/assets'
headers = {
  'Content-Type' : 'application/json',
  'X-API-Key' : 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/assets")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/assets")
}

Response Body

{
    "meta": {
        "totalCount": 100
    },
    "payload": [
        {
            "assetId": "ETH",
            "originalSymbol": "ETH",
            "name": "Ethereum",
            "slug": "ethereum",
            "cryptoType": true,
            "supply": 103337722,
            "marketCap": 13895051350,
            "price": 134.46,
            "volume": 2871630447,
            "change": -3.37,
            "_id": "5b4366f596e7a1000166b3d4",
            "_created": 1531143925,
            "_lastModified": 1531143925
        },
        ....
        {
            "assetId": "USD",
            "originalSymbol": "USD",
            "name": "US Dollar",
            "cryptoType": false,
            "_id": "5b4366f596e7a1000166b3d5",
            "_created": 1531143925,
            "_lastModified": 1531143925
        }
    ]
}

Get detailed list of all associated assets.

HTTP Request

GET /v1/assets?skip={skip}&limit={limit}

URL Parameters
Variable Type Description
skip int The offset of items to start from. Useful for paginations. (e.g. skip=100 would show results from 101 item to 200)
limit int Amount of items to return (optional, default value is 100)
Output Variables
Endpoint Name HTTP Request
assetid Our asset identifier
name Display name of the asset
cryptoType Boolean value transported as integer; True for cryptocurrency assets, False otherwise.
originalSymbol Original asset name as listed originally by creator / issuer
slug lowercase and without whitespaces representation of the name of the asset
supply approximate total amount of coins in existence right now. Applicable only for currencies of type crypto
marketCap market capitalization in USD. Applicable only for currencies of type crypto
price latest weighted average trade price across markets in USD. Applicable only for currencies of type crypto
volume 24 hour trading volume in USD. Applicable only for currencies of type crypto
change 24 hour trading price percentage change. Applicable only for currencies of type crypto

List all symbols

Code samples


curl -X GET \
   'https://api.cryptoapis.io/v1/mappings' \
  -H 'Content-Type: authorization/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/mappings HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/mappings').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/mappings",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/mappings');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/mappings")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/mappings'
headers = {
  'Content-Type' : 'application/json',
  'X-API-Key' : 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/mappings")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeadeer("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/mappings")
}

Response Body

{
    "meta": {
        "totalCount": 100
    },
    "payload": [
        {
            "exchangeId": "5b4366dab98b280001540e53",
            "exchangeSymbol": "ETH-EUR",
            "baseAsset": "5b4366f596e7a1000166b3d7",
            "quoteAsset": "5b4366f596e7a1000166b3d5",
            "tradeType": "SPOT",
            "_id": "5b45b055401814000123ebf7",
            "_created": 1531293781,
            "_lastModified": 1531824922
        },
        ....
        {
            "exchangeId": "5b4366dab98b280001540e53",
            "exchangeSymbol": "BTG-PLN",
            "baseAsset": "5b4366f596e7a1000166b3f8",
            "quoteAsset": "5b4366f596e7a1000166b46d",
            "tradeType": "SPOT",
            "_id": "5b45b055401814000123ebf8",
            "_created": 1531293781,
            "_lastModified": 1531293781
        }
    ]
}

Get a detailed list of all symbol mappings.

HTTP Request

GET /v1/mappings

Output Variables
Variables Description
exchangeSymbol Our symbol identifier, see table below for format description.
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
Trade Type Details
Type Name Description
SPOT FX Spot Agreement to exchange one asset for another one (e.g. Buy BTC for USD)
FUTURES Futures contract FX Spot derivative contract where traders agree to trade fx spot at predetermined future time
OPTION Option contract FX Spot derivative contract where traders agree to trade right to require buy or sell of fx spot at agreed price on exercise date

Call Exchange Rates

Crypto APIs provides an API to help you professionally convert currencies, simply any business model. All of our exchange rates are calculated based on a 5 min. intervals.

Get Specific Rate

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/exchange-rates/USD/BTC' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/exchange-rates/USD/BTC HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" , 
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/exchange-rates/USD/BTC').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/exchange-rates/USD/BTC",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/exchange-rates/USD/BTC');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/exchange-rates/USD/BTC")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/exchange-rates/USD/BTC'
headers = {
  'Content-Type' : 'application/json',
  'X-API-Key' : 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/exchange-rates/USD/BTC")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/exchange-rates/USD/BTC")
}

Response Body

{
    "payload": {
        "weightedAveragePrice": 0.00025199385136389241,
        "medianPrice": 0.00024906102275700436,
        "weightedMedianAveragePrice": 0,
        "timestamp": 1543839205,
        "baseAsset": "USD",
        "quoteAsset": "BTC"
    }
}

Get exchange rates between pair of requested assets pointing at a specific or current time.

HTTP Request

GET /v1/exchange-rates/{baseAssetId}/{quoteAssetId}?timestamp={timestamp}

URL Parameters
Variable Type Description
baseAssetId string FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAssetId string FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
timestamp int Time (in UNIX Timestamp) of the market data used to calculate exchange rate. Optional. Default value is current time.
Output Variables
Variables Description
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
timestamp Time (in UNIX Timestamp) of the market data used to calculate exchange rate
weightedAveragePrice Exchange rate between assets calculated by weighted average of the last trades in every exchange for the last 24 hours by giving more weight to exchanges with higher volume
medianPrice Exchange rate between assets calculated by median of the last trades in every exchange for the last 24 hours
weightedMedianAveragePrice Exchange rate between assets calculated by median of the last trades in every exchange for the last 24 hours by giving more weight to exchanges with higher volume. Range of the prices is being adjusted by calculating percentage of wrong (extremely low or extremely high) prices

Get All Current Rates

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/exchange-rates/USD' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/exchange-rates/USD HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" , 
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/exchange-rates/USD').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/exchange-rates/USD",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/exchange-rates/USD');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/exchange-rates/USD")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/exchange-rates/USD'
headers = {
  'Content-Type' : 'application/json',
  'X-API-Key' : 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/exchange-rates/USD")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/exchange-rates/USD")
}

Response Body

{
    "meta": {
        "totalCount": 34
    },
    "payload": [
        {
            "baseAsset": "USD",
            "quoteAsset": "BTC",
            "medianPrice": 0.00024971208719927192,
            "weightedAveragePrice": 0.00025063981680473099,
            "weightedMedianAveragePrice": 0,
            "timestamp": 1543839501
        },
        ....
        {
            "baseAsset": "USD",
            "quoteAsset": "CNY",
            "price": 6.8903065749863579,
            "weightedAveragePrice": 6.8903065749863579,
            "weightedMedianAveragePrice": 0,
            "timestamp": 1543839501
        },
    ]
}

Get the current exchange rate between requested asset and all other assets.

HTTP Request

GET /v1/exchange-rates/{baseAssetId}?timestamp={timestamp}&skip={skip}&limit={limit}

URL Parameters
Variable Type Description
baseAssetId string FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/*)
timestamp int Time (in UNIX Timestamp) of the market data used to calculate exchange rate. Optional. Default value is current time.
skip int The offset of items to start from. Useful for paginations. (e.g. skip=100 would show results from 101 item to 200)
limit int Amount of items to return (optional, default value is 100)
Output Variables
Variables Description
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
timestamp Time (in UNIX Timestamp) of the market data used to calculate exchange rate
weightedAveragePrice Exchange rate between assets calculated by weighted average of the last trades in every exchange for the last 24 hours by giving more weight to exchanges with higher volume
medianPrice Exchange rate between assets calculated by median of the last trades in every exchange for the last 24 hours
weightedMedianAveragePrice Exchange rate between assets calculated by median of the last trades in every exchange for the last 24 hours by giving more weight to exchanges with higher volume. Range of the prices is being adjusted by calculating percentage of wrong (extremely low or extremely high) prices

Call OHLCV

The information provided from the API calls are related to downloading OHLCV (Open, High, Low, Close, Volume) time-series data. Each data point, within the particular time range, of this time-series represents several indicators calculated from transactions activity.

List all Periods

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/ohlcv/periods' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/ohlcv/periods HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/ohlcv/periods').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/ohlcv/periods",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/ohlcv/periods');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/ohlcv/periods")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/ohlcv/periods'
headers = {
  'Content-Type' : 'application/json',
  'X-API-Key' : 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/ohlcv/periods")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/ohlcv/periods")
}

Response Body

{
    "meta": {
        "totalCount": 100
    },
    "payload": [
        {
            "period": "1sec",
            "lengthInSeconds": 1,
            "lengthInMonths": null,
            "unitCount": 1,
            "unitName": "second",
            "displayName": "1 Second"
        },
        ....
        {
            "period": "6hrs",
            "lengthInSeconds": 21600,
            "lengthInMonths": null,
            "unitCount": 6,
            "unitName": "hour",
            "displayName": "6 Hours"
        }
    ]
}

Get full list of, supported by us, time periods available for requesting OHLCV data.

HTTP Request

GET /v1/ohlcv/periods

Available Time-series periods
Time Series Period Identifier
Second 1sec, 2sec, 3sec, 4sec, 5sec, 6sec, 10sec, 15sec, 20sec, 30sec
Minute 1min, 2min, 3min, 4min, 5min, 6min, 10min, 15min, 20min, 30min
Hour 1hrs, 2hrs, 3hrs, 4hrs, 6hrs, 8hrs, 12hrs
Day 1day, 2day, 3day, 5day, 7day, 10day
Month 1mth, 2mth, 3mth, 4mth, 6mth
Year 1yrs, 2yrs, 3yrs, 4yrs, 5yrs
Output Variables
Variables Description
period Period Identifier used by Crypto APIs
lengthInSeconds Seconds part of period length
lengthInMonths Months part of period length
unitCount Period length in units
unitName Type of time-series used (second/minute/hour/day/year)
displayName Display name of period length

Latest Data

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day'
headers = {
  'Content-Type': 'application/json',
  'X-API-Key': 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/ohlcv/latest/5b3a4d323d8cea0001653bb0?period=1day")
}

Response Body

{
    "meta": {
        "totalCount": 35
    },
    "payload": [
        {
            "exchange": "5b1ea9d21090c200146f7362",
            "eventType": "SPOT",
            "assetBase": "5b1ea92e584bf50020130621",
            "assetQuote": "5b1ea92e584bf50020130614",
            "timePeriodStart": 1534204800,
            "timePeriodEnd": 1534291200,
            "timeOpen": 1534204814,
            "timeClose": 1534250116,
            "priceOpen": 0.016135,
            "priceClose": 0.016392,
            "priceLow": 0.015909,
            "priceHigh": 0.016754999999999999,
            "volumeTraded": 376888.24000000011,
            "tradesCount": 8948,
            "_id": "5b754a7c0e23de00017958fd",
            "_created": 1534413436,
            "_lastModified": 1534417582
        },
        ....
        {
            "exchange": "5b1ea9d21090c200146f7362",
            "eventType": "SPOT",
            "assetBase": "5b1ea92e584bf50020130621",
            "assetQuote": "5b1ea92e584bf50020130614",
            "timePeriodStart": 1468800,
            "timePeriodEnd": 1555200,
            "timeOpen": 1533307,
            "timeClose": 1534147,
            "priceOpen": 0.017266,
            "priceClose": 0.015892,
            "priceLow": 0.014929,
            "priceHigh": 0.017687000000000001,
            "volumeTraded": 2858646.7699999646,
            "tradesCount": 80412,
            "_id": "5b6469df1cc71c0001468414",
            "_created": 1533307359,
            "_lastModified": 1534147656
        }
    ]
}

Get OHLCV latest time-series data for requested symbol and period, returned in time descending order.

HTTP Request

GET /v1/ohlcv/latest/{symbol_id}?period={period_id}&limit={limit}

URL Parameters
Variable Type Description
symbol_id string Symbol identifier used to filter response. (required)
period_id string Identifier of requested time period (required, e.g. 1hrs, 2mth etc.)
limit int Amount of items to return (optional, default value is 100)
Output Variables
Variables Description
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
timePeriodStart Period starting time (range left inclusive)
timePeriodEnd Period ending time (range right exclusive)
timeOpen Time of first trade inside period range
timeClose Time of last trade inside period range
priceOpen First trade price inside period range
priceClose Last trade price inside period range
priceLow Lowest traded price inside period range
priceHigh Highest traded price inside period range
volumeTraded Cumulative base amount traded inside period range
tradesCount Amount of trades executed inside period range

Historical Data

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000 HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["Authorizaion"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000'
headers = {
  'Content-Type': 'application/json',
  'X-API-Key': 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/ohlcv/history/5b3a4d323d8cea0001653bb0?period=1day&timePeriodStart=1530000000&timePeriodEnd=1540876000")
}

Response Body

{
    "meta": {
        "totalCount": 34
    },
    "payload": [
        {
            "exchange": "5b1ea9d21090c200146f7362",
            "eventType": "SPOT",
            "assetBase": "5b1ea92e584bf50020130621",
            "assetQuote": "5b1ea92e584bf50020130614",
            "timePeriodStart": 1530489600,
            "timePeriodEnd": 1530576000,
            "timeOpen": 1530549336,
            "timeClose": 1530575925,
            "priceOpen": 0.018759000000000001,
            "priceClose": 0.018835999999999999,
            "priceLow": 0.018678,
            "priceHigh": 0.019154000000000001,
            "volumeTraded": 82432.489999999962,
            "tradesCount": 6245,
            "_id": "5b5b0aae188299000123db17",
            "_created": 1532693166,
            "_lastModified": 1533218361
        },
        ....
        {
            "exchange": "5b1ea9d21090c200146f7362",
            "eventType": "SPOT",
            "assetBase": "5b1ea92e584bf50020130621",
            "assetQuote": "5b1ea92e584bf50020130614",
            "timePeriodStart": 1534204800,
            "timePeriodEnd": 1534291200,
            "timeOpen": 1534204814,
            "timeClose": 1534250116,
            "priceOpen": 0.016135,
            "priceClose": 0.016392,
            "priceLow": 0.015909,
            "priceHigh": 0.016754999999999999,
            "volumeTraded": 376888.24000000011,
            "tradesCount": 8948,
            "_id": "5b754a7c0e23de00017958fd",
            "_created": 1534413436,
            "_lastModified": 1534417582
        }
    ]
}

Get OHLCV time-series data for requested symbol and period, returned in time ascending order.

HTTP Request

GET /v1/ohlcv/history/{symbol_id}?period={period_id}&timePeriodStart={time_start}&timePeriodEnd={time_end}&limit={limit}

URL Parameters
Variable Type Description
symbol_id string Symbol identifier used to filter response. (required)
period_id string Identifier of requested time period (required, e.g. 1hrs, 2mth etc.)
time_start timestamp Time period starting time in timestamp (required)
time_end timestamp Time period ending time in timestamp (optional, if not supplied then the data is returned to the end or when count of result elements reaches the limit)
limit int Amount of items to return (optional, default value is 100)
Output Variables
Variables Description
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
timePeriodStart Period starting time (range left inclusive)
timePeriodEnd Period ending time (range right exclusive)
timeOpen Time of first trade inside period range
timeClose Time of last trade inside period range
priceOpen First trade price inside period range
priceClose Last trade price inside period range
priceLow Lowest traded price inside period range
priceHigh Highest traded price inside period range
volumeTraded Cumulative base amount traded inside period range
tradesCount Amount of trades executed inside period range

Trades

In this section, you will be able to get information about transaction data.

Output Varibles
Variable Description
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
exchangeSequenceId Sequence number per pair (type, exchangeId) which is valid only for the lifespan of the connection.
eventTime Time of trade reported by exchange
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
price Price of the transaction
amount Base asset amount traded in the transaction
direction Aggressor side of the transaction (BUY/SELL/BUY_ESTIMATED/SELL_ESTIMATED/UNKNOWN)
Direction of the transaction Description
Buy Exchange has reported that transaction aggressor was buying
Sell Exchange has reported that transaction aggressor was selling
Buy_Estimated Exchange has not reported transaction aggressor, we estimated that more likely it was buying
Sell_Estimated Exchange has not reported transaction aggressor, we estimated that more likely it was selling
Unknown Exchange has not reported transaction aggressor and we have not estimated who it was

Latest Data

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/trades/latest' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/trades/latest HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/trades/latest').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/trades/latest",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/trades/latest');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/trades/latest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/trades/latest'
headers = {
  'Content-Type': 'application/json',
  'X-API-Key': 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/trades/latest")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/trades/latest")
}

Response Body

{
    "payload": [
        {
            "exchangeId": "5b1ea8278111cc0001206314",
            "baseAsset": "5b1e9de8cf19ad00016095e2",
            "quoteAsset": "5b1e9de8cf19ad00016095e5",
            "eventTime": 1532955177,
            "exchangeSequenceId": "35209977",
            "tradeType": "SPOT",
            "price": 8168.9910900000004,
            "amount": 0.00089999999999999998,
            "direction": "SELL"
        },
        ....
        {
            "exchangeId": "5b1ea8278111cc00012062d8",
            "baseAsset": "5b1e9de9cf19ad0001609613",
            "quoteAsset": "5b1e9de8cf19ad00016095e3",
            "eventTime": 1532446280685,
            "exchangeSequenceId": "272319805",
            "tradeType": "SPOT",
            "price": 0.0013412999999999999,
            "amount": 52.420000000000002,
            "direction": "SELL"
        }
    ]
}

Get latest trades from all symbols up to 1 hour ago. Latest data is always returned in time descending order.

HTTP Request

GET /v1/trades/latest?limit={limit}

URL Parameters
Variable Type Description
limit integer Optional. Sets the maximum number of results returned. Default is 100
Output Variables
Variables Description
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
exchangeSequenceId Sequence number per pair (type, exchangeId) which is valid only for the lifespan of the connection.
eventTime Time of trade reported by exchange
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
price Price of the transaction
amount Base asset amount traded in the transaction
direction Aggressor side of the transaction (BUY/SELL/BUY_ESTIMATED/SELL_ESTIMATED/UNKNOWN)

Latest Data by symbol

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/trades/5b45b055401814000123ebf7/latest",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest'
headers = {
  'Content-Type': 'application/json',
  'X-API-Key': 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/trades/5b45b055401814000123ebf7/latest")
}

Response Body

{
    "payload": [
        {
            "exchangeId": "5b1ea8278111cc0001206314",
            "baseAsset": "5b1e9de8cf19ad00016095e2",
            "quoteAsset": "5b1e9de8cf19ad00016095e5",
            "eventTime": 1532955177,
            "exchangeSequenceId": "35209977",
            "tradeType": "SPOT",
            "price": 8168.9910900000004,
            "amount": 0.00089999999999999998,
            "direction": "SELL"
        },
        ....
        {
            "exchangeId": "5b1ea8278111cc0001206314",
            "baseAsset": "5b1e9de8cf19ad00016095e2",
            "quoteAsset": "5b1e9de8cf19ad00016095e5",
            "eventTime": 1532446280685,
            "exchangeSequenceId": "272319805",
            "tradeType": "SPOT",
            "price": 0.0013412999999999999,
            "amount": 52.420000000000002,
            "direction": "SELL"
        }
    ]
}

Get latest trades from a specific symbol up to 1 hour ago. Latest data is always returned in time descending order.

HTTP Request

GET /v1/trades/{symbol_id}/latest?limit={limit}

Symbol Parameters
Parameter Type Description
symbol_id string Symbol identifier used to filter response. (_id attribute from symbols endpoint)
URL Parameters
Variable Type Description
limit integer Optional. Sets the maximum number of results returned. Default is 100
Output Variables
Variables Description
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
exchangeSequenceId Sequence number per pair (type, exchangeId) which is valid only for the lifespan of the connection.
eventTime Time of trade reported by exchange
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
price Price of the transaction
amount Base asset amount traded in the transaction
direction Aggressor side of the transaction (BUY/SELL/BUY_ESTIMATED/SELL_ESTIMATED/UNKNOWN)

Historical Data

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000 HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000'
headers = {
  'Content-Type': 'application/json',
  'X-API-Key': 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/trades/5b3a4d2a3d8cea0001653b91/history?timeStart=1526000000&timeEnd=1526593672000")
}

Response Body

{
    "meta": {
        "totalCount": 166419
    },
    "payload": [
        {
            "exchangeId": "5b1ea9d21090c200146f73a5",
            "exchangeSequenceId": "2068932",
            "eventTime": 1526593672000,
            "baseAsset": "5b1ea92e584bf50020130696",
            "quoteAsset": "5b1ea92e584bf50020130612",
            "price": 0.00010399999999999999,
            "amount": 9.4859000099999999,
            "direction": "BUY",
            "tradeType": "SPOT"
        },
        ....
        {
            "exchangeId": "5b1ea9d21090c200146f73a5",
            "exchangeSequenceId": "2068932",
            "eventTime": 1526593672000,
            "baseAsset": "5b1ea92e584bf50020130696",
            "quoteAsset": "5b1ea92e584bf50020130612",
            "price": 0.00010399999999999999,
            "amount": 9.4859000099999999,
            "direction": "BUY",
            "tradeType": "SPOT"
        }
    ]
}

Get history transactions from specific symbol, returned in time ascending order. If no start & end time is defined when calling the endpoint, your data results will be provided 24 hours back, by default.

HTTP Request

GET /v1/trades/{symbol_id}/history?timeStart={time_start}&timeEnd={time_end}

Symbol Parameters
Parameter Type Description
symbol_id string Symbol identifier used to filter response.
URL Parameters
Variable Type Description
timeStart integer Unix Timestap for the start of the requested period.
timeEnd integer Unix Timestamp for the end of the requested period. Has current time by default.
Output Variables
Variables Description
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
exchangeSequenceId Sequence number per pair (type, exchangeId) which is valid only for the lifespan of the connection.
eventTime Time of trade reported by exchange
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
price Price of the transaction
amount Base asset amount traded in the transaction
direction Aggressor side of the transaction (BUY/SELL/BUY_ESTIMATED/SELL_ESTIMATED/UNKNOWN)

Quotes

This section describes calls related to quotes data, also known as quotes or passive level 1 data. It will allow you to get data for current, latest & historical information.

Output Varibles
Variable Description
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
exchangeSequenceId Sequence number per pair (type, exchangeId) which is valid only for the lifespan of the connection.
timeExchange Time of quote reported by exchange
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
price Price of the transaction
amount Base asset amount traded in the transaction
direction Aggressor side of the transaction (ASKS/BIDS)

Latest Data

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/quotes/latest' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/quotes/latest HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/quotes/latest').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/quotes/latest",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/quotes/latest');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/quotes/latest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/quotes/latest'
headers = {
  'Content-Type': 'application/json',
  'X-API-Key': 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/quotes/latest")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/quotes/latest")
}

Response Body

{
    "payload": [
        {
            "exchangeSymbol": "LSK-BTC",
            "exchangeId": "5b4e11256ab304000a106942",
            "baseAsset": "5b1ea92e584bf5002013062e",
            "quoteAsset": "5b1ea92e584bf50020130612",
            "timeExchange": 1543401244630,
            "tradeType": "SPOT",
            "price": 0.00035885000000000002,
            "amount": 56.588099999999997,
            "direction": "ASKS"
        },
        ....
        {
            "exchangeSymbol": "xrpbtc",
            "exchangeId": "5b1ea9d21090c200146f7386",
            "baseAsset": "5b1ea92e584bf50020130619",
            "quoteAsset": "5b1ea92e584bf50020130612",
            "timeExchange": 1543401241912,
            "tradeType": "SPOT",
            "price": 0.000106,
            "amount": 1.2210000000000001,
            "direction": "ASKS"
        }
    ]
}

Get latest quote updates for up to 1 hour ago. Latest data is always returned in time descending order.

HTTP Request

GET /v1/quotes/latest?limit={limit}

URL Parameters
Variable Type Description
limit integer Optional. Sets the maximum number of results returned. Default is 100
Output Variables
Variables Description
exchangeSymbol Symbol identifier custom for the exchange where trade took place.
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
direction Initiator side of the transaction (ASKS/BIDS)
price Price of the transaction
amount Base asset amount traded in the transaction

Historical Data

Code samples


curl -X GET \
  'https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177 HTTP/1.1
Host: https://api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177'
headers = {
  'Content-Type': 'application/json',
  'X-API-Key': 'my-api-key'
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorizarion", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/quotes/5b45b055401814000123ebf7/history?timeStart=1532955177&timeEnd=1556355177")
}

Response Body

{
    "meta": {
        "totalCount": 1
    },
    "payload": [
        {
            "exchangeSymbol": "tLTCUSD",
            "exchangeId": "5b1ea8278111cc00012062d8",
            "price": 32.439999999999998,
            "tradeType": "SPOT",
            "baseAsset": "5b1e9de8cf19ad00016095e4",
            "quoteAsset": "5bb367d36eeda0000c3a1122",
            "direction": "ASKS",
            "amount": 239.964,
            "eventTime": 1543831655438
        }
    ]
}

Get historical quote updates within requested time range, returned in time ascending order. If no start & end time are defined when calling the enpoint, your data results will be provided 24 hours back, by default.

HTTP Request

GET /v1/quotes/{symbol_id}/history?timeStart={time_start}&timeEnd={time_end}

Symbol Parameters
Parameter Type Description
symbol_id string Symbol identifier used to filter response.
URL Parameters
Variable Type Description
limit integer Optional. Sets the maximum number of results returned. Default is 100
Output Variables
Variables Description
exchangeSymbol Symbol identifier custom for the exchange where quote was created
exchangeId Our identifier of the exchange where symbol is traded.
tradeType Type of symbol (possible values are: SPOT, FUTURES or OPTION)
exchangeSequenceId Sequence number per pair (type, exchangeId) which is valid only for the lifespan of the connection.
eventTime Time of quote reported by exchange
baseAsset FX Spot base asset identifier, for derivatives it’s contact underlying (e.g. BTC for BTC/USD)
quoteAsset FX Spot quote asset identifier, for derivatives it’s contract underlying (e.g. USD for BTC/USD)
price BID/ASK-ed price
amount BID/ASK-ed amount
direction Aggressor side of the transaction (ASKS/BIDS)

Blockchain

Currently, Crypto APIs supports Bitcoin, Ethereum, Litecoin, Bitcoin Cash with more in the blockchains in the pipe-line, such as Dodgecoin, EOS, Stellar & Ripple.

Common

Here you will find the most common blockchain HTTP Requests, which is the power Crypto APIs professional solution.

Endpoint Name HTTP Request Description
Blockchain Chain Endpoint GET /v1/bc/${COIN}/${NETWORK}/info General information about a blockchain is available by GET-ing the base resource.
Blockchain Hash Endpoint GET /v1/bc/${COIN}/${NETWORK}/blocks/${BLOCK_HASH} Block Hash endpoint gives you detail information for particular block in the blockchain.
Blockchain Height Endpoint GET /v1/bc/${COIN}/${NETWORK}/blocks/${BLOCK_HEIGHT} Block Hash endpoint gives you detail information for particular block in the blockchain, including height.
Address Balance Endpoint GET /v1/bc/${COIN}/${NETWORK}/address/${ADDRESS}/balance The Address Balance Endpoint is the simplest—and fastest—method to get a subset of information on a public address.
Address Endpoint GET /v1/bc/${COIN}/${NETWORK}/address/${ADDRESS} Returns more information about an address’ transactions than the Address Balance Endpoint but doesn’t return full transaction information.
Generate Address Endpoint POST /v1/bc/${COIN}/${NETWORK}/address Generate Address endpoint allows you to generate private-public key-pairs along with an associated public address.
Add Address to Wallet Endpoint POST /v1/bc/${COIN}/${NETWORK}/wallets/${WALLET_NAME}/addresses This endpoint allows you to add public addresses to the $WALLET_NAME wallet, by POSTing a partially filled out Wallet object.
Generate Address in Wallet Endpoint POST /v1/bc/${COIN}/${NETWORK}/wallets/${WALLET_NAME}/addresses/generate Тhis endpoint allows you to generate a new address associated with the WALLET_NAME wallet. Note: Currently ETH is not included.
Remove Addresses from Wallet Endpoint DELETE /v1/bc/${COIN}/${NETWORK}/wallets/{WALLET_NAME}/address/${ADDRESS} This endpoint allows you to delete an $ADDRESS associated with the WALLET_NAME wallet. Note: Currently ETH is not included.
Delete Wallet Endpoint DELETE /v1/bc/${COIN}/${NETWORK}/wallets/${WALLET_NAME} This endpoint deletes the Wallet with WALLET_NAME. If successful, it will return an error message with no return object. Note: Currently ETH is not included.
Transaction Hash Endpoint GET /v1/bc/${COIN}/${NETWORK}/txs/${TX_HASH} The Transaction Hash Endpoint returns detailed information about a given transaction based on its hash.
Creating Transactions POST /v1/bc/${COIN}/${NETWORK}/txs/new Two-endpoint transaction creation tool, New.
Creating Transactions POST /v1/bc/${COIN}/${NETWORK}/txs/send Two-endpoint transaction creation tool, Send.

BTC

Blockchain API

Chain Endpoint

Code samples


curl -X GET 'https://api.cryptoapis.io/v1/bc/btc/mainnet/info' \
    -H 'ContentType: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/info HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/bc/btc/mainnet/info').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/info",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/info');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/info")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/info'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/info")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/bc/btc/mainnet/info")
}

Response Body

{
    "difficulty": 7182852313938.317,
    "headers": 546904,
    "chain": "main",
    "chainWork": "000000000000000000000000000000000000000003b8fe71a1bf647effbc862f",
    "mediantime": 1540234846,
    "blocks": 546904,
    "bestBlockHash": "0000000000000000001c940339b65f3c1d85006041e9602bc9bda2c495e2ca82",
    "currency": "BTC",
    "transactions": 342149347,
    "verificationProgress": 0.9999964749471614
}
Info

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

HTTP Request

GET /v1/bc/btc/${NETWORK}/info

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)

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

Block Hash Endpoint

Code samples


curl -X GET 'https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381")
}

Response Body

{
    "nextHash": "0000000000000000001c940339b65f3c1d85006041e9602bc9bda2c495e2ca82",
    "previousHash": "00000000000000000014b10d64dd3e60b038233ccca693b13ce9f1ee6afc26f9",
    "tx": [
        "89067219fdf8343024cc9f0f4d9016ac7b8e131d19fa05bff1cc08b06bed500d",
        "b336a9d7fbb290eeb4d572e1b4233d537b2070685ebbaaf9eb82c0714782de04",
        ...
        "f7b4becb2ca1aff2aebb1faaa5252c8583bf4e66b1304f9c02639d93b29e1eac",
        "7beefdba268eb412dddd7bd422fa4916731dd2e9d1be9666962d7d50202e8316"
    ],
    "n_tx": 949,
    "bits": "17272fbd",
    "merkleRoot": "c60a59ea073b3fbe6426da111da042f75a76435b0d0ee05e177749052cfc5e6b",
    "confirmations": 4269,
    "version": 536870912,
    "nonce": 3498325829,
    "difficulty": 7182852313938.317,
    "chainwork": "000000000000000000000000000000000000000003b8f7e937daa747f14ee0a8",
    "size": 1124359,
    "time": "2018-10-22 19:46:31 UTC",
    "hash": "0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381",
    "height": 546903,
    "timestamp": 1540237591
}

Info

Block Hash endpoint gives you detail information for particular block in the blockchain

HTTP Request

GET /v1/bc/btc/${NETWORK}/blocks/${BLOCK_HASH}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
BLOCK_HASH - Hash of the block in blockchain

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

0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381

The returned object contains information about the block in JSON format, 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.

Block Height Endpoint

Code samples


curl -X GET 'https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/546903' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/blocks/546903 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/546903').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/blocks/546903",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/546903');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/546903")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/546903'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/546903")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/546903")
}

Response Body

{
    "nextHash": "0000000000000000001c940339b65f3c1d85006041e9602bc9bda2c495e2ca82",
    "previousHash": "00000000000000000014b10d64dd3e60b038233ccca693b13ce9f1ee6afc26f9",
    "tx": [
        "89067219fdf8343024cc9f0f4d9016ac7b8e131d19fa05bff1cc08b06bed500d",
        "b336a9d7fbb290eeb4d572e1b4233d537b2070685ebbaaf9eb82c0714782de04",
        ...
        "f7b4becb2ca1aff2aebb1faaa5252c8583bf4e66b1304f9c02639d93b29e1eac",
        "7beefdba268eb412dddd7bd422fa4916731dd2e9d1be9666962d7d50202e8316"
    ],
    "n_tx": 949,
    "bits": "17272fbd",
    "merkleRoot": "c60a59ea073b3fbe6426da111da042f75a76435b0d0ee05e177749052cfc5e6b",
    "confirmations": 4269,
    "version": 536870912,
    "nonce": 3498325829,
    "difficulty": 7182852313938.317,
    "chainwork": "000000000000000000000000000000000000000003b8f7e937daa747f14ee0a8",
    "size": 1124359,
    "time": "2018-10-22 19:46:31 UTC",
    "hash": "0000000000000000001ca87bd09c2fc80a0ef3966c6473553b118583e0a73381",
    "height": 546903,
    "timestamp": 1540237591
}

Info

Block Hash endpoint gives you detail information for particular block in the blockchain

HTTP Request

GET /v1/bc/btc/${NETWORK}/blocks/${BLOCK_HEIGHT}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
BLOCK_HEIGHT - Height of the block in blockchain

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

546903

The returned object contains information about the block in JSON format, 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.

Latest Block Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/latest \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/blocks/latest HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/latest",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "port": "8021",
  "path": [
    "v1",
    "bc",
    "btc",
    "mainnet",
    "blocks",
    "latest"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/latest');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/latest")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,btc,mainnet,blocks,latest", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/latest")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/blocks/latest"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
    "previousHash": "c93bf9b1ef052f314a9a6d71b91912e906e7608415f571e8052409273574f583",
    "tx": [...],
    "n_tx": 260,
    "bits": "1a02abb4",
    "merkleRoot": "b26611d9a3557e151cc24e11938eeb1a207661ccceb023999b024ab71e087f4d",
    "confirmations": 1,
    "version": 536870912,
    "nonce": 188249030,
    "difficulty": 6281822.625865576,
    "chainwork": "00000000000000000000000000000000000000000000018bec99f78e23c6c448",
    "size": 324696,
    "time": "2018-12-07 08:02:06 UTC",
    "hash": "47f4a91232017991c0666dcc3ce1667c5920d7bb6bf24e717748e476193e4293",
    "height": 1539315,
    "timestamp": 1544169726
}
Info

Latest Block Endpoint gives you detail information for the latest block in the blockchain

HTTP Request

GET /v1/bc/btc/${NETWORK}/blocks/latest

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or testnet)

The returned object contains information about the latest block in JSON format, including its height, the total amount of wei transacted within it, the number of transactions in it and more.

Address API

Crypto APIs 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 Endpoint

Code samples


curl -X GET 'https://api.cryptoapis.io/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/bc/btc/mainnet/address/1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ")
}

Response Body

{
    "total_spent": 0,
    "txout_n": 1,
    "final_balance": 5000000000,
    "address": "1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ",
    "txin_n": 0,
    "txs": 1,
    "total_received": 5000000000
}
Info

The default Address Endpoint strikes a general information about addresses. It returns more information about an address’ transactions, but doesn’t return full transaction information.

HTTP Request

GET /v1/bc/btc/${NETWORK}/address/${ADDRESS}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
ADDRESS - Address in blockchain

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

1DBrYbe5U7LGDcHA5tiLCxivZ7JZAGqGhJ

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.

Generate Address Endpoint

Code samples


curl -X POST 'https://api.cryptoapis.io/v1/bc/btc/mainnet/address' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


POST /v1/bc/btc/mainnet/address HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.post('https://api.cryptoapis.io/v1/bc/btc/mainnet/address')
  .then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/address",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/address');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/address")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/address'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.post(url, headers=headers, data={})


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/address")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Post("https://api.cryptoapis.io/v1/bc/btc/mainnet/address")
}

Response Body

{
    "privateKey": "ffa3bb7aec71d6eef3a84fd430a7c8da37bf42d304573e308220f0ab02ff3606",
    "address": "17k8m6zwB3wThUXK9UJoCt5qjQPizr5tXK",
    "publicKey": "03eba0d2aedfc74b415f962c1d113c6095774ff79d97fed250a5a79629a0055068",
    "wif": "L5ne7xz81GNK7kY8ZwoCu9khzgn7CJLzqJ36XGpvW57wzRyCV7d7"
}
Info

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.

HTTP Request

POST /v1/bc/btc/${NETWORK}/address

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or testnet)

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

Address Transactions Endpoint

Code samples


curl -X GET 'https://api.cryptoapis.io/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/bc/btc/mainnet/address/3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3/transactions")
}

Response Body

{
    {
        "txs": [
            {
                "txid": "add64f7635e554d9af1e692108f7194bbc0f95801965f69561f2b2d482937c8b",
                "hash": "add64f7635e554d9af1e692108f7194bbc0f95801965f69561f2b2d482937c8b",
                "version": 1,
                "size": 2238,
                "vsize": 2238,
                "locktime": 0,
                "time": "2018-11-22 22:12:30 UTC",
                "blockhash": "000000000000000000044cd5a47d8b306bdaebd5990627c71fc4f5009df86f5f",
                "blockheight": 551116,
                "blocktime": 1542924750,
                "txins": [
                    {
                        "coinbase": false,
                        "txout": "479cad5f869b3b24754b51e604d44af44b430d4c734f5153bf27acf1db39ccee",
                        "vout": 3,
                        "address": "15cVYhenMqoVAhYqdQoBNfKmb8yQWpcagX",
                        "amount": 31328456
                    },
                    {
                        "coinbase": false,
                        "txout": "5b364e18f628d4b49ad56d7118fc7aec9c7b38cd3f100541cb02872ab45a087b",
                        "vout": 3,
                        "address": "19VgMGh5Zqg5YNjdktbWXCCDc7kAK6iYif",
                        "amount": 26002022
                    },
                    {
                        "coinbase": false,
                        "txout": "5b364e18f628d4b49ad56d7118fc7aec9c7b38cd3f100541cb02872ab45a087b",
                        "vout": 67,
                        "address": "137j4Ss5ZYjXPEd7tSHDEjZqAo3D3ry3Zd",
                        "amount": 17000000
                    },
                    {
                        "coinbase": false,
                        "txout": "d1002ad536ad292c459dbc2b519f5334500017c733ad09c7e04c01523e7db17a",
                        "vout": 3,
                        "address": "17R87ARe3zSE5qpeNSGVDwmVejeNyvKYtV",
                        "amount": 16173530
                    },
                    {
                        "coinbase": false,
                        "txout": "f3d8851147817bd748d96e9af3ace1ae186b94aa72eb555b8dcbedd1c47a617b",
                        "vout": 5,
                        "address": "1KoZVrMfCqKtQAVM276DmE8xZNxEeerPf2",
                        "amount": 1671158
                    },
                    {
                        "coinbase": false,
                        "txout": "393caedb13898fea17fa780f63afa2c0856f149020be2a02abe769bf714c5b7c",
                        "vout": 8,
                        "address": "1JNehNtEp3nQKMbWMVg1YLJoHRPF6WrwgA",
                        "amount": 1076342
                    },
                    {
                        "coinbase": false,
                        "txout": "16864995a26fe25876e5ed7d58310ba83492c133dacae9fb06e486a7db1f927b",
                        "vout": 0,
                        "address": "1DXZr8M2CgLvNoqGV4GdXsyrJ8P2ehtc7m",
                        "amount": 516200
                    },
                    {
                        "coinbase": false,
                        "txout": "b107916918f6106e928ada70e8fead343cc510f185e51d1f97e5dcb68420767b",
                        "vout": 1,
                        "address": "19hZbEE16HFwAXfsekpqTBFu1ZgRwXuLru",
                        "amount": 453617
                    },
                    {
                        "coinbase": false,
                        "txout": "883dae11152e4a226c6f2a8d23ddc4a9823fd9e6ee9fc3cd26a4bbac32e00c7b",
                        "vout": 0,
                        "address": "1FFKpiPyzH8xmugEL8a9mJ7MvsqaLE3Y5p",
                        "amount": 392200
                    },
                    {
                        "coinbase": false,
                        "txout": "ab603db0b4ec67556084be09bf9e70a01e070a19879500a74aa2885f91a0a17c",
                        "vout": 1,
                        "address": "163Qu7MwhWRezRi6L5sYHiCC8NgrVn9JLF",
                        "amount": 300000
                    },
                    {
                        "coinbase": false,
                        "txout": "989a8e06d98f8abd7a1f59453077fe11c5dd476af6c29e9dd03e41d6635a2e7c",
                        "vout": 1,
                        "address": "1CpHe2NCuUBnjuxXyGcYusaBiSpcQM9AJU",
                        "amount": 233072
                    },
                    {
                        "coinbase": false,
                        "txout": "ebb9a4313bbac086fc008f75278c3083cfe7f0b6d475449e294363b46320477c",
                        "vout": 1,
                        "address": "14izYkYXRfQ8VF2G9Tif2xQCF8MorFXrq9",
                        "amount": 200000
                    },
                    {
                        "coinbase": false,
                        "txout": "a2803e2d95af88606cd3ca89244d403c1baaa2426d1d53a1510eab092e14447b",
                        "vout": 0,
                        "address": "1F5JEsaudbnSvCBTMJ8zsgB6VQP2QBCH83",
                        "amount": 195920
                    },
                    {
                        "coinbase": false,
                        "txout": "ea89c7d6365ff450a6eb17366b3c5dc56ae24ff55edd8a9f88c2effb6b18da79",
                        "vout": 37,
                        "address": "1EYLikLiD3rcfHxLissJVbQNNnEgP2pVMR",
                        "amount": 117732
                    }
                ],
                "txouts": [
                    {
                        "address": "3EeGr2CBEWiM1WoTnnkoqa2k9PEfAFuBPF",
                        "amount": 9011054
                    },
                    {
                        "address": "3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3",
                        "amount": 7446226
                    },
                    {
                        "address": "33TjLd5Z9TdaLPBFQ1rbxxQS6uTmvYq9t6",
                        "amount": 3342155
                    },
                    {
                        "address": "3N7uXXDRVwJVu3C1sZtxn7sjQqNR3iBjuG",
                        "amount": 1028854
                    },
                    {
                        "address": "19H9mfjcuDWfkeQp1DKrL65EqXAtT937Ft",
                        "amount": 74711961
                    }
                ],
                "timestamp": 1542924750,
                "confirmations": 50
            },
            {
                "txid": "d7eb36c92006b9e77d21420fbf42473ac9f9a2558f5f97a5654b430fdb94b3a7",
                "hash": "d7eb36c92006b9e77d21420fbf42473ac9f9a2558f5f97a5654b430fdb94b3a7",
                "version": 1,
                "size": 2868,
                "vsize": 2868,
                "locktime": 0,
                "time": "2018-11-22 12:08:11 UTC",
                "blockhash": "00000000000000000015f4ef32626fc031f2d0d7a4028239d310bbbca8e2f0a6",
                "blockheight": 551066,
                "blocktime": 1542888491,
                "txins": [
                    {
                        "coinbase": false,
                        "txout": "beca31a60d1ec658e9432f281fe9daab0d6932e3462e631378b2c806a9eb78f4",
                        "vout": 3,
                        "address": "1MX2RfAigbgBfU1oL9M1APGdvxaeZs2Xfb",
                        "amount": 67202260
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2361,
                        "address": "12CfmmRqv7rvGHvrxjExayf7DBhN6Fq2ge",
                        "amount": 143000
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2348,
                        "address": "19KHMGfYKjwKNCiQAkAzG97M8At4du1CAf",
                        "amount": 140581
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2364,
                        "address": "1JhQGni4qrpheSg4rxCZVduYRxpzkmhZAk",
                        "amount": 133602
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2244,
                        "address": "1QG9FKZgbmwHS8cEuFyQVHn61nTgJBgNiB",
                        "amount": 104583
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1748,
                        "address": "13MEfQio7WrXnQT14ameYSYurtVrKGV1cF",
                        "amount": 104523
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1750,
                        "address": "1Pr3DJRNqeUinhqR4kwDyjaYLhiHhEHMJi",
                        "amount": 104458
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1753,
                        "address": "1GPdMuViSotWVtoAC1KPNZLc7zhPsKTxH5",
                        "amount": 104424
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2256,
                        "address": "1LSMDZSWmb1gdxjqWmW6fJSfDNt7RfmbCs",
                        "amount": 104408
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1754,
                        "address": "1MmSo4Fvbm1GV59taSwmDtCRcXAKUXTNKk",
                        "amount": 104399
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1756,
                        "address": "1NK9QfoGQ9icZoeMKoUsHmAddAs6BAfMpa",
                        "amount": 104378
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2248,
                        "address": "154jWwmWusEviegc2xaFvMK1P9whVWuzmT",
                        "amount": 104283
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1764,
                        "address": "1AK3wALzY6BpS3JarLqa46b3TgtAVDMGSr",
                        "amount": 104280
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1765,
                        "address": "19Gs6dGU1Hn46bTBXq3Yu9h5BQxxu9eeEd",
                        "amount": 104253
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 1767,
                        "address": "1PXnFaqCqX7GnoNQNLRBZFKRkPg48U9cKQ",
                        "amount": 104183
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2298,
                        "address": "15b3VYiS3PafbCSqT6Bu5ZpbUg7ZJTtsTd",
                        "amount": 104150
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2281,
                        "address": "15xXpparCaR7Qzjt3c1zCNHJsHXYP5XwtX",
                        "amount": 104127
                    },
                    {
                        "coinbase": false,
                        "txout": "fc9176b4e5c8af77f3fad9387aa0435c2610bfef0b08efdeccf0dd33ea953801",
                        "vout": 2261,
                        "address": "1LFag9PHbtUpCQYa1mZRdFSbs8tyihfeHK",
                        "amount": 104094
                    }
                ],
                "txouts": [
                    {
                        "address": "3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3",
                        "amount": 10985649
                    },
                    {
                        "address": "1MPXeepmzC6ky2L2ADUQBBeqwMcBoWhkFL",
                        "amount": 10888597
                    },
                    {
                        "address": "1JkQe87HcmBNsCTPhFfzt618Uxm2CK9hG9",
                        "amount": 21000000
                    },
                    {
                        "address": "3CCH6CDP6fnkMGxNcfFXxLHNvt6yEvTA6J",
                        "amount": 157257
                    },
                    {
                        "address": "36Zs7CZ5tmCTZBniQ1pDGAG4Btgd2FGTyR",
                        "amount": 1849303
                    },
                    {
                        "address": "1CT9EsHuzrk1XoXB6EziMndygVuBAHe2TJ",
                        "amount": 24049183
                    }
                ],
                "timestamp": 1542888491,
                "confirmations": 100
            }
            ...
    ]
}
Info

The Address Transactions Endpoint returns all information available about a particular address, including an array of complete transactions.

HTTP Request

GET /v1/bc/btc/${NETWORK}/address/${ADDRESS}/transactions

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
ADDRESS - Address in blockchain
index 0 First index of returned txs
limit 50 Sets the minimum number of returned txs

ADDRESS is a string representing the public address you’re interested in querying, for example:

3DrVotri9Rq2xcHqCMKpVUoyU6pvoWRtY3

The returned object contains information about the address, including the number of transactions associated with it, and the corresponding full transaction records in descending order by blocktime.

Wallet API

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 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.

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

Code samples


#### normal wallet
curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/ \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "walletName" : "demowallet",
    "addresses": ["1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"]
}'

#### hd wallet
curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/ \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "walletName" : "demohdwallet",
    "addressCount" : 5,
    "password" : "8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32"
}'


#### normal wallet
POST /v1/bc/btc/mainnet/wallets HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "walletName" : "demowallet",
    "addresses" : ["1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"]
}

#### hd wallet
POST /v1/bc/btc/mainnet/wallets/hd HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "walletName" : "demohdwallet",
    "addressCount" : 5,
    "password" : "8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32"
}


// normal wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"walletName\" : \"demowallet\",\n\t\"addresses\" : [\"1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA\", \"1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5\", \"1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH\"]\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

// hd wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/mainnet/wallets/hd/",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"walletName\" : \"demohdwallet\",\n\t\"addressCount\" : 5,\n\t\"password\" : \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


// normal wallet
var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/wallets",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  walletName: 'demowallet',
  addresses: 
   ["1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"] }));
req.end();

// hd wallet
var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/wallets/hd",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({
  walletName: 'demohdwallet',
  addressCount: 5,
  password: '8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32' }));
req.end();


<?php

// normal wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "walletName" : "demowallet",
    "addresses" : ["1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"]
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

// hd wallet

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "walletName" : "demohdwallet",
    "addressCount" : 5,
    "password" : "8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


?>


####noraml wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"walletName\" : \"demowallet\",\n\t\"addresses\" : [\"1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA\", \"1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5\", \"1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH\"]\n}"

response = http.request(request)
puts response.read_body

#### hd wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"walletName\" : \"demohdwallet\",\n\t\"addressCount\" : 5,\n\t\"password\" : \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}"

response = http.request(request)
puts response.read_body


#### normal wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"walletName\" : \"demowallet\",\n\t\"addresses\" : [\"1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA\", \"1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5\", \"1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH\"]\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/wallets", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

#### hd wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"walletName\" : \"demohdwallet\",\n\t\"addressCount\" : 5,\n\t\"password\" : \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/wallets/hd", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


// normal wallet
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\\n\t\"walletName\" : \"demowallet\",\n\t\"addresses\" : [\"1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA\", \"1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5\", \"1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH\"]\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();

// hd wallet
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"walletName\" : \"demohdwallet\",\n\t\"addressCount\" : 5,\n\t\"password\" : \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


// notmal wallet
package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets"

    payload := strings.NewReader("{\n\t\"walletName\" : \"demowallet\",\n\t\"addresses\" : [\"1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA\", \"1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5\", \"1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH\"]\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

// hd wallet
package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bcbtc/mainnet/wallets/hd"

    payload := strings.NewReader("{\n\t\"walletName\" : \"demohdwallet\",\n\t\"addressCount\" : 5,\n\t\"password\" : \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body

// normal wallet
{
    "addresses": [
      "1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", 
      "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", 
      "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"],
    "walletName": "demowallet",
    "hd": false
}

// hd wallet
{
    "addresses": [
        {
            "path": "M/0H/0/0",
            "address": "1M9H2qRkNAvjpBbaAknZBWYia7YKb3sskq"
        },
        {
            "path": "M/0H/0/1",
            "address": "1MXoSgaYLt2F9JRguHPbTiNmtw4UijLSvD"
        },
        {
            "path": "M/0H/0/2",
            "address": "1L5ZEe9e2d8bkCAzrub2AFjUNbGNtZNqEg"
        },
        {
            "path": "M/0H/0/3",
            "address": "15XL2G1eTbGT6xY7YrgsL1RtqvYnib8V56"
        },
        {
            "path": "M/0H/0/4",
            "address": "1BpWypWFVJPMHaSuL5oozAc8Zpe9FTiPcw"
        }
    ],
    "walletName": "demohdwallet",
    "hd": true
}
HTTP Request

normal wallet

POST /v1/bc/btc/${NETWORK}/wallets

hd wallet

POST /v1/bc/btc/${NETWORK}/wallets/hd

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or mainnet)
WALLET_NAME - Wallet name
ADDRESSES - Array of addresses that will be added to wallet
ADDRESS_COUNT - Number of addresses that should be generated in new wallet
PASSWORD - Wallet password
Request Wallet Object

{ "walletName" : ${WALLET_NAME}, "addresses" : ${ADDRESSES} }

Request HD Wallet Object

{ "walletName" : ${WALLET_NAME}, "addressCount" : ${ADDRESS_COUNT}, "password" : ${PASSWORD} }

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 WALLET_NAME attribute and at least one public address in the ADDRESSES array.

For HD wallets, at minimum, you must include WALLET_NAME, the ADDRESS_COUNT and the PASSWORD attributes.

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

List Wallets Endpoint

Code samples


#### normal wallet
curl -X GET \
  https://api.cryptoapis.io/v1/bc/btc/testnet/wallets \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'

#### hd wallet
curl -X GET \
  https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd \
  -H 'Content-Type: application/json'
  -H 'X-API-Key: my-api-key'


#### normal wallet
GET /v1/bc/btc/testnet/wallets HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

#### hd wallet
GET /v1/bc/btc/testnet/wallets/hd HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


// normal wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

// hd wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


// normal wallet
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/testnet/wallets",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

// hd wallet
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/testnet/wallets/hd",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

// normal wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/testnet/wallets');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

// hd wallet

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


####noraml wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body

#### hd wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


#### normal wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  "Content-Type": "application/json",
  "X-API-Key", "my-api-key"
}

conn.request("GET", "/v1/bc/btc/testnet/wallets", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

#### hd wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  "Content-Type": "application/json",
  "X-API-Key", "my-api-key"
}

conn.request("GET", "/v1/bc/btc/testnet/wallets/hd", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


// normal wallet
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();

// hd wallet
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


// notmal wallet
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

// hd wallet
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body

// normal wallet
{
    "wallets": [
        "demowallet",
        "newwallet",
        "specialwallet"
    ]
}

// hd wallet
{
    "wallets": [
        "demohdwallet",
        "newhdwallet",
        "specialhdwallet"
    ]
}

HTTP Request

normal wallet

GET /v1/bc/btc/${NETWORK}/wallets

hd wallet

GET /v1/bc/btc/${NETWORK}/wallets/hd

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)

This endpoint returns a string array ($NAMEARRAY) of active wallet names (both normal ор 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

Code samples


#### normal wallet
curl -X GET \
  https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/demowallet \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'

#### hd wallet
curl -X GET \
  https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd/demohdwallet \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


#### normal wallet
GET /v1/bc/btc/testnet/wallets/demowallet HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

#### hd wallet
GET /v1/bc/btc/testnet/wallets/hd/demohdwallet HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


// normal wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/demowallet",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

// hd wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd/demohdwallet",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


// normal wallet
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/testnet/wallets/demowallet",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

// hd wallet
var http = require("http");

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/testnet/wallets/hd/demohdwallet",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

// normal wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/demowallet');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

// hd wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd/demohdwallet');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>



####noraml wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/demowallet")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body

#### hd wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd/demohdwallet")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


#### normal wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  "Content-Type": "application/json",
  "X-API-Key", "my-api-key"
}

conn.request("GET", "/v1/bc/btc/testnet/wallets/demowallet", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

#### hd wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  "Content-Type": "application/json",
  "X-API-Key", "my-api-key"
}

conn.request("GET", "/v1/bc/btc/testnet/wallets/hd/demohdwallet", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


// normal wallet
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/demowallet")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();

// hd wallet
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd/demohdwallet")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


// notmal wallet
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/demowallet"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

// hd wallet
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/testnet/wallets/hd/demohdwallet"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body

// normal wallet
{
    "addresses": [
      "1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA", 
      "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5", 
      "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"],
    "walletName": "demowallet",
    "hd": false
}

// hd wallet
{
    "addresses": [
        {
            "path": "M/0H/0/0",
            "address": "1M9H2qRkNAvjpBbaAknZBWYia7YKb3sskq"
        },
        {
            "path": "M/0H/0/1",
            "address": "1MXoSgaYLt2F9JRguHPbTiNmtw4UijLSvD"
        },
        {
            "path": "M/0H/0/2",
            "address": "1L5ZEe9e2d8bkCAzrub2AFjUNbGNtZNqEg"
        },
        {
            "path": "M/0H/0/3",
            "address": "15XL2G1eTbGT6xY7YrgsL1RtqvYnib8V56"
        },
        {
            "path": "M/0H/0/4",
            "address": "1BpWypWFVJPMHaSuL5oozAc8Zpe9FTiPcw"
        }
    ],
    "walletName": "demohdwallet",
    "hd": true
}

HTTP Request

normal wallet

GET /v1/bc/btc/${NETWORK}/wallets/${WALLET_NAME}

hd wallet

GET /v1/bc/btc/${NETWORK}/wallets/hd/${WALLET_NAME}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
WALLET_NAME - Wallet name

This endpoint returns a Wallet or HDWallet based on its WALLET_NAME.

Add Addresses to Wallet Endpoint

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses \
  -H 'authorization: my-api-key' \
  -H 'content-type: application/json' \
  -d '{
	"addresses" : ["1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6", "13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er"]
}'


POST /v1/bc/btc/mainnet/wallets/demowallet/addresses HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
	"addresses" : ["1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6", "13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er"]
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses",
  "method": "POST",
  "headers": {
    "content-type": "application/json",
    "authorization": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"addresses\" : [\"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\", \"13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er\"]\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "port": null,
  "path": "/v1/bc/btc/mainnet/wallets/demowallet/addresses",
  "headers": {
    "content-type": "application/json",
    "authorization": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ addresses: 
   [ '1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6',
     '13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er' ] }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'authorization' => 'my-api-key',
  'content-type' => 'application/json'
));

$request->setBody('{
	"addresses" : ["1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6", "13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er"]
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>



require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'my-api-key'
request.body = "{\n\t\"addresses\" : [\"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\", \"13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er\"]\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("api.cryptoapis.io")

payload = "{\n\t\"addresses\" : [\"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\", \"13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er\"]\n}"

headers = {
    'content-type': "application/json",
    'authorization': "my-api-key"
    }

conn.request("POST", "/v1/bc/btc/mainnet/wallets/demowallet/addresses", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"addresses\" : [\"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\", \"13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er\"]\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("authorization", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses"

	payload := strings.NewReader("{\n\t\"addresses\" : [\"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\", \"13ZiD6gSv75aNKdRyoUN39R3oSZEPML7er\"]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("authorization", "my-api-key")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response Body

{
    "addresses": [
        "1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA",
        "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5",
        "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH",
        "1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R"
    ],
    "walletName": "wallet",
    "hd": false
}

HTTP Request

POST /v1/bc/btc/${NETWORK}/wallets/${WALLET_NAME}/addresses

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
WALLET_NAME - Wallet name
Request Wallet Object

{ "addresses" : ${ADDRESSES} }

This endpoint allows you to add public addresses to the $WALLET_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.

Generate Address in Wallet Endpoint

Code samples


#### normal wallet
curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'

#### hd wallet
curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate \
  -H 'content-type: application/json' \
  -H 'authorization: my-api-key' \
  -d '{
	"addressCount": 3,
	"password": "8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32"
}'


#### normal wallet
POST /v1/bc/btc/mainnet/wallets/demowallet/addresses/generate HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

#### hd wallet
POST /v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate HTTP/1.1
Host: api.cryptoapis.io
X-API-Key: my-api-key
Content-Type: application/json

{
	"addressCount": 3,
	"password": "8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32"
}


// normal wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

// hd wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate",
  "method": "POST",
  "headers": {
    "authorization": "my-api-key",
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\n\t\"addressCount\": 3,\n\t\"password\": \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


// normal wallet
var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

// hd wallet
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "port": null,
  "path": "/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate",
  "headers": {
    "authorization": "my-api-key",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ addressCount: 3, password: '8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32' }));
req.end();

<?php

// noraml wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

// hd wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'content-type' => 'application/json',
  'authorization' => 'my-api-key'
));

$request->setBody('{
	"addressCount": 3,
	"password": "8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


#### noraml wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body

#### hd wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["authorization"] = 'my-api-key'
request["content-type"] = 'application/json'
request.body = "{\n\t\"addressCount\": 3,\n\t\"password\": \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}"

response = http.request(request)
puts response.read_body


#### normal wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

#### hd wallet
import http.client

conn = http.client.HTTPSConnection("api.cryptoapis.io")

payload = "{\n\t\"addressCount\": 3,\n\t\"password\": \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}"

headers = {
    'authorization': "my-api-key",
    'content-type': "application/json"
    }

conn.request("POST", "/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


// normal wallet
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate")
  .post(null)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();

// hd wallet
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"addressCount\": 3,\n\t\"password\": \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate")
  .post(body)
  .addHeader("authorization", "my-api-key")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();


// normal wallet
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/addresses/generate"

    req, _ := http.NewRequest("POST", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

// hd wallet
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demohdwallet/addresses/generate"

	payload := strings.NewReader("{\n\t\"addressCount\": 3,\n\t\"password\": \"8a0690d2cd4fad1371090225217bb1425b3700210f51be6111eb225d5142ac32\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("authorization", "my-api-key")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response Body

// normal wallet
{
    "addresses": [
        "1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA",
        "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5",
        "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH",
        "1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R"
    ],
    "private": "99d1ffc2264f57479e948405d97b50a09e2a197d4c7b9d4271fd6d0cc722f4f3",
    "address": "1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R",
    "public": "03f2ff3a306245a78066636b2f3587dcddecbbcca2db0ab1ec2cbc257069853dde",
    "wif": "L2NiZnxNptPpZBNXYARaFV6vLonvZMNRp1hGYACbyzYxtYLmbGoZ",
    "walletName": "demowallet",
    "hd": false,
    "status": "ok"
}

// hd wallet
{
    "addresses": [
        {
            "address": "122vgxpcubtve59mrMcqbpKAUMAK297KgK",
            "path": "M/0H/0/0"
        },
        {
            "address": "1AzDHE4YxngtgpcVekQpJZupcmKkXhwSRT",
            "path": "M/0H/0/1"
        },
        {
            "address": "17eaeKLqY7vNfyeE1yQ9WNJ6ZWLHdx2kmK",
            "path": "M/0H/0/2"
        },
        {
            "address": "1B8DBKwUZPQ5m2GmKxAnH4GaVLMNXmDEks",
            "path": "M/0H/0/3"
        },
        {
            "address": "1MrLV9fnq93Gdqg6uDDioZSDjKgnf866Ne",
            "path": "M/0H/0/4"
        },
        {
            "address": "1JQwoe3vFKNPA19MWwYL7jasuh9rwjznMz",
            "path": "M/0H/0/5"
        }
    ],
    "walletName": "demohdwallet",
    "hd": true
}

HTTP Request

normal wallet

POST /v1/bc/btc/${NETWORK}/wallets/${WALLET_NAME}/addresses/generate

hd wallet

POST /v1/bc/btc/${NETWORK}/wallets/hd/${WALLET_NAME}/addresses/generate

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
WALLET_NAME - Wallet name
Request HD Wallet Object

{ "addressCount" : ${ADDRESS_COUNT}, "password" : ${ENCRYPTED_PASSWORD} }

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

Remove Addresses from Wallet Endpoint

curl -X DELETE \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


DELETE /v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R",
  "method": "DELETE",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "DELETE",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>



require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  "Content-Type": "application/json",
  "X-API-Key", "my-api-key"
}

conn.request("DELETE", "/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R")
  .delete(null)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet/address/1Ho72xi1JDv7inZ7BrLivJShSkcwARtP2R"

    req, _ := http.NewRequest("DELETE", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body

{
    "addresses": [
       "1MfyBywPTSj9aAPr8cccCTcch71fd4vkDA",
       "1B5WsYR8m4axbmEMMifveDL2gtZjtpaFr5",
       "1KRYkrh3dAkeBWPwxDZhrz9u8xf5NRK9UH"
    ],
    "walletName": "demowallet",
    "hd": false,
    "status": "ok"
}
HTTP Request

DELETE /v1/bc/btc/${NETWORK}/wallets/${WALLET_NAME}/address/${ADDRESS}

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
WALLET_NAME - Wallet name
ADDRESS - Address which should be deleted

This endpoint allows you to delete an $ADDRESS associated with the WALLET_NAME wallet.

Delete Wallet Endpoint

#### normal wallet
curl -X DELETE \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'

#### hd wallet
curl -X DELETE \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demowallet \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


#### normal wallet
DELETE /v1/bc/btc/mainnet/wallets/demowallet HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

#### hd wallet
DELETE /v1/bc/mainnet/wallets/hd/demowallet HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


// normal wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet",
  "method": "DELETE",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

//hd wallet
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/hd/demowallet",
  "method": "DELETE",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


// normal wallet
var http = require("http");

var options = {
  "method": "DELETE",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/wallets/demowallet",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();

// hd wallet
var http = require("http");

var options = {
  "method": "DELETE",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/wallets/hd/demowallet",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

// normal wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

// hd wallet
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>



#### normal wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


#### hd wallet
require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


#### normal wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  "Content-Type": "application/json",
  "X-API-Key", "my-api-key"
}

conn.request("DELETE", "/v1/bc/btc/mainnet/wallets/demowallet", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

#### hd wallet
import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("DELETE", "/v1/bc/btc/mainnet/wallets/demowallet", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))



// normal wallet
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet")
  .delete(null)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();

// hd wallet
OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet")
  .delete(null)
  .addHeader("content-type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


// normal wallet
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet"

    req, _ := http.NewRequest("DELETE", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.Defaubtclient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

// hd wallet
package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/wallets/demowallet"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("cache-control", "no-cache")
	req.Header.Add("postman-token", "d953336f-8728-f3b8-9bef-ae6892018f05")

	res, _ := http.Defaubtclient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response Body

{
    "status": "ok"
}
HTTP Request

normal wallet

DELETE /v1/bc/btc/${NETWORK}/wallets/${WALLET_NAME}

hd wallet

DELETE /v1/bc/btc/${NETWORK}/wallets/hd/${WALLET_NAME}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or testnet)
WALLET_NAME - Wallet name

This endpoint deletes the Wallet or HD Wallet with WALLET_NAME. If successful, it will return an error message with no return object.

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or testnet)
WALLET_NAME - Wallet name
ADDRESS - Address which should be deleted

Transaction API

Crypto APIs 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 Txid Endpoint

Code samples


curl -X GET 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/txid/5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2")
}

Response Body

{
    "outputs": [
        {
            "addresses": [
                "16ro3Jptwo4asSevZnsRX6vfRS24TGE6uK"
            ],
            "asm": "OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d OP_EQUALVERIFY OP_CHECKSIG",
            "type": "pubkeyhash",
            "value": 5000000000,
            "reqsigs": 1
        }
    ],
    "locktime": 0,
    "inputs": [
        {
            "addresses": [
                "1JBSCVF6VM6QjFZyTnbpLjoCJTQEqVbepG"
            ],
            "prev_hash": "f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6",
            "output_value": 5000000000,
            "output_index": 0,
            "script": {
                "asm": "304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d1090db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b2415[ALL]"
            },
            "vout": 0
        }
    ],
    "txid": "5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2",
    "block_hash": "000000000043a8c0fd1d6f726790caa2a406010d19efd2780db27bdbbd93baf6",
    "confirmations": 471172,
    "version": 1,
    "block_time": 1284613427,
    "size": 158,
    "time": "2010-09-16 05:03:47 UTC",
    "vin_sz": 1,
    "hash": "5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2",
    "vout_sz": 1,
    "timestamp": 1284613427
}
Info

The Transaction Txid Endpoint returns detailed information about a given transaction based on its id.

HTTP Request

GET /v1/bc/btc/${NETWORK}/txs/txid/${TXID}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
TXID - Id of the transaction in blockchain

TXID is a string representing the id of the block you’re interested in querying, for example:

5a4ebf66822b0b2d56bd9dc64ece0bc38ee7844a23ff1d7320a88c5fdb2ad3e2

The returned object contains information about the block in JSON format, including its height, the total amount of satoshis transacted within it, the number of transactions in it, transaction ids listed in the canonical order in which they appear in the block, and more.

Transaction Index by Block Hash Endpoint

Code samples


curl -X GET 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.get('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5').then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.get(url, headers=headers)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Get("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1/5")
}

Response Body

{
    "outputs": [
        {
            "addresses": [
                "1DfkcAE4xLEBV9CpfEc42bDbujF1ToND5Y"
            ],
            "asm": "OP_DUP OP_HASH160 8af5b7710298a9b3da819366acc141a5dd645349 OP_EQUALVERIFY OP_CHECKSIG",
            "type": "pubkeyhash",
            "value": 500000,
            "reqsigs": 1
        },
        {
            "addresses": [
                "16snPTn5CnXqgKW9FDVaHxz1sjMbLMkm13"
            ],
            "asm": "OP_DUP OP_HASH160 4073507c18a427f55aaa98c35da2ce327a4ed5ae OP_EQUALVERIFY OP_CHECKSIG",
            "type": "pubkeyhash",
            "value": 1180259,
            "reqsigs": 1
        }
    ],
    "locktime": 544703,
    "inputs": [
        {
            "addresses": [
                "1BBBKEgsZqrUh2qqZmabz5FsNTAwor3fXw"
            ],
            "prev_hash": "6ba6eb8af7fd2bb907cab4c9c0f3b30349c93df08aafe9c07c51414f5b8c90d0",
            "output_value": 1196219,
            "output_index": 1,
            "script": {
                "asm": "3044022037462be3eb3beeeb97bd16ea620b5b4800f2fd8012ecf38ba6d07ae96f818aad02202411010db50e439202ac58aba116a32127e41bfbbb4cbed78c8ea8b2fef2c5ff[ALL] 030453b83238c9be41702bba423abcb1212931052c52ba7c1d6b8ddf1805e42d25"
            },
            "vout": 1
        },
        {
            "addresses": [
                "17ZobmE52YjEoSBdvNyGeG5i59bUx9STyN"
            ],
            "prev_hash": "565e4c4dde06a521011737832c8a804f33bd4089e6e08d2384a912e29ebac9a3",
            "output_value": 492975,
            "output_index": 1,
            "script": {
                "asm": "304502210080fb525ec29602309f0e01b5a267750ce9429bd264730f0c9d78c157c3b0864e02201dfab7d79726b5b342a6e14025053f3b7d21ffdf7a35a274ef03bc5598613b21[ALL] 02a9bf18f877c65f89af9499cc2b38cf46f9349d60f97f5f311dc6faf703c7bf42"
            },
            "vout": 1
        }
    ],
    "txid": "3f611ea4b9b6ca9b24e4c2b1013bb0047016d03dce5ad7a17fe361b454154c7a",
    "block_hash": "00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1",
    "confirmations": 6468,
    "version": 1,
    "block_time": 1538882018,
    "size": 373,
    "time": "2018-10-07 03:13:38 UTC",
    "vin_sz": 2,
    "hash": "3f611ea4b9b6ca9b24e4c2b1013bb0047016d03dce5ad7a17fe361b454154c7a",
    "vout_sz": 2,
    "timestamp": 1538882018
}
Info

The Transaction Index by Block Hash Endpoint returns detailed information about a given transaction based on its hash and index of transaction in the block.

HTTP Request

GET /v1/bc/btc/${NETWORK}/txs/block/{BLOCKHASH}/{TXINDEX}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
TXINDEX - Index of the transaction in block
BLOCKHASH - Blockhash in blockchain

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

00000000000000000008b7233b8abb1519d0a1bc6579e209955539c303f3e6b1

TXINDEX is a integer representing the hash of the block you’re interested in querying, for example:

5

The returned object contains information about the block in JSON format, 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.

Transactions Index Endpoint by Index, Limit and Block Height

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/552875?index=0&limit=4 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/txs/block/552875?index=0&limit=4 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/552875?index=0&limit=4",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "btc",
    "mainnet",
    "txs",
    "block",
    "552875"
  ],
  "qs": {
    "index": 0,
    "limit": 4
  },
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/552875?index=0&limit=4');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/552875?index=0&limit=4")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

querystring = {"index": 0, "limit": 4}

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,btc,mainnet,txs,block,552875", headers=headers, params=querystring)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/552875?index=0&limit=4")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/block/552875?index=0&limit=4"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body


{
    "result": [
        {
            "outputs": [
                {
                    "addresses": [
                        "18cBEMRxXHqzWWCxZNtU91F5sbUNKhL5PX"
                    ],
                    "asm": "OP_DUP OP_HASH160 536ffa992491508dca0354e52f32a3a7a679a53a OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 1253613220,
                    "reqsigs": 1
                },
                {
                    "asm": "OP_RETURN aa21a9ed7d15c16c1bffb79fbec91bbc997f3382e5d3f46ad23a2dc36629331f6bebd6d8",
                    "type": "nulldata",
                    "value": 0
                }
            ],
            "locktime": 0,
            "inputs": [
                {
                    "coinbase": true
                }
            ],
            "txid": "ece2a0ad85b28cdf8d417545a41d7f98b3f228f9d3bfd9d847aafcf1999b7e18",
            "block_hash": "0000000000000000002647c65b97083eacc60466990151cfe08e6cc95175ee1b",
            "confirmations": 2,
            "version": 1,
            "block_time": 1544169571,
            "size": 263,
            "time": "2018-12-07 07:59:31 UTC",
            "vin_sz": 1,
            "hash": "fdcc8fe4d22c309bc694a0c16ce88ddb652d6c2af97b4655df83a7a2006922d4",
            "vout_sz": 2,
            "timestamp": 1544169571
        },
        {
            "outputs": [
                {
                    "addresses": [
                        "1BysRjEm82GExuqG5Mz1tz8X3PQCwpcoB4"
                    ],
                    "asm": "OP_DUP OP_HASH160 7872a53f19e6fbc5fea9a29c5f246e5ff3392d2b OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 5000000000,
                    "reqsigs": 1
                }
            ],
            "locktime": 0,
            "inputs": [
                {
                    "addresses": [
                        "3L5pbfbkzCHC48fknkt7gLaKFCPxcbkyPy"
                    ],
                    "coinbase": false,
                    "prev_hash": "1201a091591027fc778eee93c2a0debf33d1085472e687990fc4d1070c30f89d",
                    "output_value": 72346827,
                    "output_index": 0,
                    "script": {
                        "asm": "0014caa4c01c24a2c8c3b5e710003039788247b2a261"
                    },
                    "vout": 0
                },
                {
                    "addresses": [
                        "3Lk13QRfjihuT3j1b3EDdzE3aurwyKLNKh"
                    ],
                    "coinbase": false,
                    "prev_hash": "36967b824ca3709639d274538181a4466d78176ebcd7dbe426d1e5b679e2e26d",
                    "output_value": 69760808,
                    "output_index": 0,
                    "script": {
                        "asm": "001404341321243477777695a6677d84405320b5c173"
                    },
                    "vout": 0
                },
                {
                    "addresses": [
                        "3GmkCEPwfmx2LFFvvWsRxwZ3vd9bAqDiDe"
                    ],
                    "coinbase": false,
                    "prev_hash": "473d230f97c7dbe384892d8f891a1cc89865dea2fdca2de2111abed2627f433f",
                    "output_value": 269016709,
                    "output_index": 0,
                    "script": {
                        "asm": "001413394cddaf5cb6eaec9dd91c28b426f12874ff87"
                    },
                    "vout": 0
                },
                {
                    "addresses": [
                        "3QTy45KWqGhmbHtLJLRYKL6TRBcrPo9Bwp"
                    ],
                    "coinbase": false,
                    "prev_hash": "7871444584e948489269833ab066ccf64b5a589c9dfcf11127e76e295ecab21a",
                    "output_value": 873879870,
                    "output_index": 0,
                    "script": {
                        "asm": "00146a75e69a934d4aef612a88bd875fa378429df266"
                    },
                    "vout": 0
                },
                {
                    "addresses": [
                        "3EchQsKdEZZEw1UeFxXy1JNuSLbA2vL5LZ"
                    ],
                    "coinbase": false,
                    "prev_hash": "7b397d41527dfd4b476e9603b718813a9e2963a79e4b9a9728b03c7ff7904c5a",
                    "output_value": 1999950000,
                    "output_index": 21,
                    "script": {
                        "asm": "001496956a7120d731618faadfaee027dac49d7e3bda"
                    },
                    "vout": 21
                },
                {
                    "addresses": [
                        "33tA6Ah8qEfUsCH7ofcWQdKuvvLT7fwmrA"
                    ],
                    "coinbase": false,
                    "prev_hash": "b87150b3dce19964e7b9c101d6ef68206a1d1f892fbacf69e3265d4f41650d63",
                    "output_value": 787997296,
                    "output_index": 0,
                    "script": {
                        "asm": "001473c409a3b838bd7b0f8a7dd69c7392a88cfccb19"
                    },
                    "vout": 0
                },
                {
                    "addresses": [
                        "3EchQsKdEZZEw1UeFxXy1JNuSLbA2vL5LZ"
                    ],
                    "coinbase": false,
                    "prev_hash": "cb26b002410e73216bd4a2c84927d975c4da6bb8d6ff9c8e6c77829231e513b6",
                    "output_value": 927346517,
                    "output_index": 34,
                    "script": {
                        "asm": "001496956a7120d731618faadfaee027dac49d7e3bda"
                    },
                    "vout": 34
                }
            ],
            "txid": "461a8c0e2031bbac00d6b80fcce02a3c809c0e57dc3780b216003e6ae557d38d",
            "block_hash": "0000000000000000002647c65b97083eacc60466990151cfe08e6cc95175ee1b",
            "confirmations": 2,
            "version": 1,
            "block_time": 1544169571,
            "size": 1247,
            "time": "2018-12-07 07:59:31 UTC",
            "vin_sz": 7,
            "hash": "85ac59f75aba2b665450b06840db7aef093c2f6c64922a385dd41fe825f05c5c",
            "vout_sz": 1,
            "timestamp": 1544169571
        },
        {
            "outputs": [
                {
                    "addresses": [
                        "3DbZEg49U84hVpF3ZGWpkDtYk828L8wxQd"
                    ],
                    "asm": "OP_HASH160 829926ee22cfda3addb062d0b127aa3b796251c4 OP_EQUAL",
                    "type": "scripthash",
                    "value": 332159,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "3AxrjmLJsKCGswwSKvhKzXw8wxkjeMiM9D"
                    ],
                    "asm": "OP_HASH160 65b81e970090b03acbacfeefe330c5493affe743 OP_EQUAL",
                    "type": "scripthash",
                    "value": 4894110,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "3AEDTJKxTQ7BM2tPXJSyn1vbyND9VfU5wK"
                    ],
                    "asm": "OP_HASH160 5da786acae68798ae8f6c18af66ff42ea5dae9c3 OP_EQUAL",
                    "type": "scripthash",
                    "value": 10720000,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "3GHj4knWoMVmiohwLNqiBTqAkQmbnCYgnn"
                    ],
                    "asm": "OP_HASH160 a0223f37752b5ca7e8365f5b47c2e0d228307333 OP_EQUAL",
                    "type": "scripthash",
                    "value": 16681783,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "3C7rPrty5M4f4tTXj6r6LuxBKWCR66auGJ"
                    ],
                    "asm": "OP_HASH160 7263b3d4b469d9aef92a511e81d66359cca56273 OP_EQUAL",
                    "type": "scripthash",
                    "value": 28739400,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "17A16QmavnUfCW11DAApiJxp7ARnxN5pGX"
                    ],
                    "asm": "OP_DUP OP_HASH160 43849383122ebb8a28268a89700c9f723663b5b8 OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 8833115145,
                    "reqsigs": 1
                }
            ],
            "locktime": 0,
            "inputs": [
                {
                    "addresses": [
                        "17A16QmavnUfCW11DAApiJxp7ARnxN5pGX"
                    ],
                    "coinbase": false,
                    "prev_hash": "723f5edb67ec898bb545e43bcb2a3c851a2fe395e8a89bab7ecc29696f17524a",
                    "output_value": 8894582598,
                    "output_index": 4,
                    "script": {
                        "asm": "30440220218214c370a2a95705eb22a137addf7fcd52c638cf226a5612495822a6bd482f02200758b687f8477f42b370a7e580db70369579c46f310c5dc15e927fa3d421ce55[ALL] 047146f0e0fcb3139947cf0beb870fe251930ca10d4545793d31033e801b5219abf56c11a3cf3406ca590e4c14b0dab749d20862b3adc4709153c280c2a78be10c"
                    },
                    "vout": 4
                }
            ],
            "txid": "8cb9e121571230c947abc68283d76a1194588931ca432ca34ff5e25a16aa35a8",
            "block_hash": "0000000000000000002647c65b97083eacc60466990151cfe08e6cc95175ee1b",
            "confirmations": 2,
            "version": 2,
            "block_time": 1544169571,
            "size": 383,
            "time": "2018-12-07 07:59:31 UTC",
            "vin_sz": 1,
            "hash": "8cb9e121571230c947abc68283d76a1194588931ca432ca34ff5e25a16aa35a8",
            "vout_sz": 6,
            "timestamp": 1544169571
        },
        {
            "outputs": [
                {
                    "addresses": [
                        "18BxkeF5pzfG63fJqYWRYrRGeXwxK2XYdf"
                    ],
                    "asm": "OP_DUP OP_HASH160 4edb9474ba3b2823402cd77cecc6c8ab1e8eaecd OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 160077989,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "3LL5fozq3yVaTz3aGGHWCUY5ko4HjFuBuQ"
                    ],
                    "asm": "OP_HASH160 cc74c81cb8e56a22cb3cd57c552e6597b586da8c OP_EQUAL",
                    "type": "scripthash",
                    "value": 1617000,
                    "reqsigs": 1
                }
            ],
            "locktime": 0,
            "inputs": [
                {
                    "addresses": [
                        "1PvXFLmXkDDdXHDz8y5ULccyH6qcw33nwU"
                    ],
                    "coinbase": false,
                    "prev_hash": "425be953ed51fb656e52daad9583d86d0d97bab3a24ad5e061ddad597689acd6",
                    "output_value": 161744989,
                    "output_index": 0,
                    "script": {
                        "asm": "3045022100b259768c9146e25660136b411b995fcdf13abdba8579df36461fc1d5f4481dbc02204b682045003a1151b8bc12d0022365eece56c8436c0855824600ceffb96d219e[ALL] 033d10badc614cbe5032e5130f3b8caa1245d9b9d6f256160bd1b2a8babb62d00b"
                    },
                    "vout": 0
                }
            ],
            "txid": "efcd059d7c08280f07426da02ff081ff93d0504ee4a2c7403db65ba0e3062067",
            "block_hash": "0000000000000000002647c65b97083eacc60466990151cfe08e6cc95175ee1b",
            "confirmations": 2,
            "version": 1,
            "block_time": 1544169571,
            "size": 224,
            "time": "2018-12-07 07:59:31 UTC",
            "vin_sz": 1,
            "hash": "efcd059d7c08280f07426da02ff081ff93d0504ee4a2c7403db65ba0e3062067",
            "vout_sz": 2,
            "timestamp": 1544169571
        }
    ]
}

Info

The Transaction Index Endpoint by Index, Limit and Block Height returns detailed information about transactions for the block height defined, starting from the index defined up to the limit defined . In the example above index is 0 and limit is 4, therefore the response will be an array of 4 transactions starting from index 0. The highest number for the limit is 50.

HTTP Request

GET /v1/bc/btc/${NETWORK}/txs/block/${BLOCK_HEIGHT}?index=${TX_INDEX}&limit=${LIMIT}

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. mainnet or testnet)
TX_INDEX ------- Index - start from
LIMIT ------- Limit - up to
BLOCK_HEIGHT ------- Block height

TX_INDEX is a integer representing the order of the transaction within the block, for example:

0

LIMIT is a integer representing limit for transactions, for example:

4

BLOCK_HEIGHT is a integer representing the height of the block, for example:

552875

Unconfirmed Transactions Endpoint

Code samples


curl -X POST 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/txs HTTP/1.1
Host: api.cryptoapis.io
X-API-Key: my-api-key
Content-Type: application/json


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs",
  "method": "GET",
  "headers": {
    "authorization": "my-api-key",
    "content-type": "application/json"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "port": null,
  "path": "/v1/bc/btc/mainnet/txs",
  "headers": {
    "authorization": "my-api-key",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'content-type' => 'application/json',
  'authorization' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
request["authorization"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import requests

url = "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs"

headers = {
    'content-type': "application/json",
    'authorization': "my-api-key"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs")
  .get()
  .addHeader("authorization", "my-api-key")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();


package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("authorization", "my-api-key")
	req.Header.Add("content-type", "application/json")

	res, _ := http.Defaubtclient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response Body

{
    "unconfirmed": [
        "c3141fedbb95cd009202f48f5e2f6ea830593d0c245685bbdd90887d6111a513",
        "6b87504a8ebc5f4aa8c6dc7cfbce20374dee72a1aa2c8a1e2e07c3a2715f7751",
        "7485aaeafa74caf7f598c1386ebcfce0af0f89f50a2caab345e5ef2799436e9a",
        "86716ddfd0fd43960a7dddf990559810441a4e2d802e3c8dc4be65a745db4e03",
        "4b25c926542969531a8d8aef583f8c18faa8b56bbc5d1bf03cd657ef3744b1dc",
        "65fb71c0d2986ee771bcdc4b7e4d9388825c5b0cae85fbda6e1e571497bbf2de",
        "5b3a140d9757523f906a8e6b61a4d9ea3f816a850139d3213d2292d2d2420212",
        "dab4d418865333a677ef20f18b15e0b0e464fbc03b60d209e97074a231b4c75d",
        "72376b18a261b5bcd4b21928d7ee5f23bcfcd8efd4405273fc4e968321efbe71",
        "e12a33376707af065c20612fcbe42a206bc12a457bd22569252fd652de3adeec",
        "a0799124e33459c770ec6e21845aa3aa94f92d7ebadbcdc33665804fd2b70e75",
        "9ed4a3e5d60124c628d41aa5d129d93558b3995fa4a7c16aea7e9104ca352591",
        "d653d120155758524c31de715eb06285e85a8d04140842c095a94f0cf55f070a",
        "5cce3cdcef03ff3c45957e22969caf7f3f271a1f367a3449434fda3639d9eb28",
        "10748fb76ae621159d3c4f576defbe8164f593aa915b294ea52ae737a70fed25"
    ]
}
Info

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.

HTTP Request

GET /v1/bc/btc/${NETWORK}/txs

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)

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).

Transaction Trace Endpoint

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/trace \
  -H 'content-type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
	"txs":["4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970", "2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba", "b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce"]
}'


POST /v1/bc/btc/mainnet/txs/trace HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
	"txs":["4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970", "2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba", "b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce"]
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/trace",
  "method": "POST",
  "headers": {
    "content-type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"txs\":[\"4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970\", \"2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba\", \"b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce\"]\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/trace",
  "headers": {
    "content-type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ txs: 
   [ '4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970',
     '2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba',
     'b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce' ] }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/trace');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'content-type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
	"txs":["4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970", "2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba", "b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce"]
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/trace")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"txs\":[\"4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970\", \"2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba\", \"b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce\"]\n}"

response = http.request(request)
puts response.read_body


import requests

url = "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/trace"

payload = "{\n\t\"txs\":[\"4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970\", \"2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba\", \"b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce\"]\n}"
headers = {
    'Content-Type': "application/json",
    "X-API-Key": "my-api-key"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"txs\":[\"4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970\", \"2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba\", \"b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce\"]\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/trace")
  .post(body)
  .addHeader("content-type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/trace"

	payload := strings.NewReader("{\n\t\"txs\":[\"4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970\", \"2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba\", \"b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce\"]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("content-type", "application/json")
	req.Header.Add("X-API-Key", "my-api-key")

	res, _ := http.Defaubtclient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response Body

{
    "result": [
        {
            "outputs": [
                {
                    "addresses": [
                        "16v19QgXeHL6nyDyddtb7m5Kf1xKCg2Qox"
                    ],
                    "asm": "OP_DUP OP_HASH160 40decbc0b459eebb89b8781eb2f01e7e55914a85 OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 113215,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "12NkmrYt3XdcnaeagdYFdLjCobiYBxj2VP"
                    ],
                    "asm": "OP_DUP OP_HASH160 0f1566b0b530dba3849a20e5e60c2deefa63e0b3 OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 4018961,
                    "reqsigs": 1
                }
            ],
            "locktime": 0,
            "inputs": [
                {
                    "addresses": [
                        "19fPHKKLc7djfjaXJoKyuLP7L4NdunidJW"
                    ],
                    "prev_hash": "9ff2067fffb0337664cf1328337312494cc7e6e9196690e1fcd2688f4d50178a",
                    "output_value": 115769,
                    "output_index": 0,
                    "script": {
                        "asm": "3045022100dc6c7be500effa61e3bbbc0a9c775e91eaef025c569a1f02fef06948ea707ae50220165ada26cae19db3d3452b14dc6e90491dac3c45a25657df1c5c74dae52d4f2b[ALL] 0347a1ae7ea68ef877aec3da02928d6a2f3cc9e4c05d5de54c9e13c0810c3e0a46"
                    },
                    "vout": 0
                },
                {
                    "addresses": [
                        "1FW1VqMokd8tw5QUr9jAJwvmYtjxoYDrYx"
                    ],
                    "prev_hash": "e0ccfea8faf91b6ad9d9cdd86d5983f04da84ad8219b6292c123eca22b60f3f5",
                    "output_value": 4023000,
                    "output_index": 1,
                    "script": {
                        "asm": "304402202c9840c4dc781940327e46ad93dbb284f739a45626891a13b834ab6e5f4fe583022022c69e3b5cc113b107b9b44af5dbda238fe23cee6fb90dc82a2362a5d59cea70[ALL] 032f3a68e71133e12877f1c9365078de251f2945ba8131c298fa80bdc564458015"
                    },
                    "vout": 1
                }
            ],
            "txid": "4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970",
            "block_hash": "0000000000000000001de440ce7b924722ef75468f46b579bf4d530a1bbb6b5b",
            "confirmations": 6486,
            "version": 1,
            "block_time": 1538872192,
            "size": 373,
            "time": "2018-10-07 00:29:52 UTC",
            "vin_sz": 2,
            "hash": "4a66a02d3409239865d6da073fbf28f6c819edb354d0374a3d26d4d66fef6970",
            "vout_sz": 2,
            "timestamp": 1538872192
        },
        {
            "outputs": [
                {
                    "addresses": [
                        "3Dm27YTWAopdSahqrMxATwXkVVNh5Tfmyz"
                    ],
                    "asm": "OP_HASH160 846354e123d7c84f970794850e02f3217447f51a OP_EQUAL",
                    "type": "scripthash",
                    "value": 1452458,
                    "reqsigs": 1
                },
                {
                    "addresses": [
                        "12hrCWMPs5Vyj9nSHXL2PuUGP1ef5nB463"
                    ],
                    "asm": "OP_DUP OP_HASH160 12b1d53f2a880d6ec68557feb601ab209bff7e19 OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 37562,
                    "reqsigs": 1
                }
            ],
            "locktime": 0,
            "inputs": [
                {
                    "addresses": [
                        "3ECZJ3ivjkjW897WgsXKyy3XBWcpLiUaN2"
                    ],
                    "prev_hash": "dd0964feb1f0e173440c60c36cfb6b94b830184172beb12e5c46544e2213db58",
                    "output_value": 1465633,
                    "output_index": 1,
                    "script": {
                        "asm": "0 3044022035c7d09557814f4a8d25205260af2ee48e2a454d0f68245a7f201626a2fbdcc202205b388b48cf5f6ad61ab0986a31b8d442f417ea5a86f2293f209e55568d02fb1b[ALL] 3045022100eea63a1741540521e4bad4a4e072cb0aca4c38853eecf1805ff53ed91f5348b402206bf6c3d4e65580e1483c0e285bf13837b270c8445cdf2bf086ef371b94217a2c[ALL] 522102907a54bed8ad74b3f35638c60114ca240a308cb986f3f2f306178869a8880b612103ea2a83324a933ffdb0884092bff8c11b652802169f8db367c45bec60a4c7b53952ae"
                    },
                    "vout": 1
                },
                {
                    "addresses": [
                        "1Ef3MNwrBwjKZr4pnJQvVFtbL8QFAtikFf"
                    ],
                    "prev_hash": "dc159cc9a99c02e0d71d7890bdd5f5f0dca73920583a6332b9f6f096f854e4f3",
                    "output_value": 29846,
                    "output_index": 1,
                    "script": {
                        "asm": "3044022020ebb4a596c29974e3c3583d6a10244ac1b20ba268825632a69c1cafd14dbda402206a9a8faa094e65db7ab7bde24db181fd6c7f3e787322540d8b7643a538971029[ALL] 02481a66b31817f8c140b621e42e5105e9385fa1170a9edc4857defde4a0021964"
                    },
                    "vout": 1
                }
            ],
            "txid": "2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba",
            "block_hash": "0000000000000000001de440ce7b924722ef75468f46b579bf4d530a1bbb6b5b",
            "confirmations": 6486,
            "version": 1,
            "block_time": 1538872192,
            "size": 482,
            "time": "2018-10-07 00:29:52 UTC",
            "vin_sz": 2,
            "hash": "2db850f40b65e9f05318b7a1d15e564b365373dff2926feee05452c2f92cf9ba",
            "vout_sz": 2,
            "timestamp": 1538872192
        },
        {
            "outputs": [
                {
                    "asm": "OP_RETURN 0000f7c400012c6e928a2ac211c6ea17e005468fe44532b65f145e23725bd46c473614725bc6dcd04b04b9c037c31d86b0c9564a5bb953670612cd0ba7df530b1d100759d4ba30d2c37bb011d97e02cf",
                    "type": "nulldata",
                    "value": 0
                },
                {
                    "addresses": [
                        "1GA6EU7GQwAnqjm5Rrh1kurQdy6JBK1zdv"
                    ],
                    "asm": "OP_DUP OP_HASH160 a641ff7ee85bb5fcd3b137637e047f704a36f682 OP_EQUALVERIFY OP_CHECKSIG",
                    "type": "pubkeyhash",
                    "value": 815137,
                    "reqsigs": 1
                }
            ],
            "locktime": 0,
            "inputs": [
                {
                    "addresses": [
                        "1CzsAexBEboHPvbVX5w7WuLK2ZBtWRjt9x"
                    ],
                    "prev_hash": "d41b6162553812a26a40d338d0754a09f517e06c1863e031f1d75e893b60fb21",
                    "output_value": 816136,
                    "output_index": 1,
                    "script": {
                        "asm": "3045022100bd828ede19e8b9bda825c946c07cf35ebb7fddc64fb6381592367dbf3907a2ff02202634152790597508827d17b76b011079ae3b3d4a564fe5bcd2f39c4e23ec1ac3[ALL] 03fada907cca023d94f2d69f59293d6841e4eb379db03d44ac913afd3aaa947f92"
                    },
                    "vout": 1
                }
            ],
            "txid": "b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce",
            "block_hash": "0000000000000000001de440ce7b924722ef75468f46b579bf4d530a1bbb6b5b",
            "confirmations": 6486,
            "version": 1,
            "block_time": 1538872192,
            "size": 284,
            "time": "2018-10-07 00:29:52 UTC",
            "vin_sz": 1,
            "hash": "b4a38d136972ba446fd2a6eb76f65d9eef3cde12dbfaefbf3a5ff7d14a7c85ce",
            "vout_sz": 2,
            "timestamp": 1538872192
        }
    ]
}
Info

The Transaction Trace Endpoint returns detailed information about a given set of transactions based on theirs hashes.

HTTP Request

POST /v1/bc/btc/${NETWORK}/txs/trace

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
Request Trace Object

{ "txs" : [${TX1}, ${TX2}, ${TX3},...] }

The returned object contains information about the block in JSON format, 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.

Latest Transactions Endpoint

Code samples


curl -X POST 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/latest' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


POST /v1/bc/btc/mainnet/txs/latest HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


$.ajaxSetup({
  headers:{
    "Content-Type": "application/json" ,
    "X-API-Key": "my-api-key"
  }
});

$.post('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/latest')
  .then(function(d) {console.log(d)});


const https = require('https');

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/latest",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/latest');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();
  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/latest")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
response = http.request(request)
puts response.read_body


import requests
url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/latest'
headers = {
  "Content-Type": "application/json",
  "X-API-Key": "my-api-key"
}
response = requests.post(url, headers=headers, data={})


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/latest")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


import (
  "gopkg.in/resty.v0"
)

func main()
{
    resp, err := resty.R().
      SetHeader("Content-Type", "application/json").
      SetHeader("X-API-Key", "my-api-key").
      Post("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/latest")
}

Response Body

{
    "txs": [
        {
            "receivedtime": 1544546004707,
            "id": "1a6b038f92dab8620590ba62ed00b9fc61b4dc7ef699dc847b0df18eb675aa98"
        },
        {
            "receivedtime": 1544546004080,
            "id": "0a7a10252bf2ca06cef685fe734cc8e0b28589dda4069115f3f42b9f1441543a"
        },
        ...
        {
            "receivedtime": 1544545991534,
            "id": "f5731490a9d1ae8c9148a93564460e073fb6d03cc80e56ce453efcbfcb4fb8b6"
        },
        {
            "receivedtime": 1544545991512,
            "id": "9cf95c8b852552afcca09fdac921d4a252f32ffaa15608157e78d8e8ec4c2a5d"
        }
    ]
}
Info

The Latest Transactions Endpoint returns an array of the latest transactions relayed by nodes in a blockchain that could be mined or not.

HTTP Request

GET /v1/bc/btc/${NETWORK}/txs/latest

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
limit 50 Number of transaction after the index

The returned object is an array of transactions that are confirmed or unconfirmed, arranged in reverse chronological order (latest is first, then older transactions follow).

Historical Transactions Endpoint

Code samples


curl -X GET \
    'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/history'' \
    -H 'content-type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/txs/history HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/history",
  "method": "GET",
  "headers": {
    "content-type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/history"",
  "headers": {
    "content-type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();



<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/history');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'content-type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/history")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["content-type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import requests

url = 'https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/history'

headers = {
    'content-type': "application/json",
  "X-API-Key": "my-api-key"
    }

response = requests.request("GET", url, headers=headers)

print(response.text)



OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/history"")
  .get()
  .addHeader("content-type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/history"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("content-type", "application/json")
      SetHeader("X-API-Key", "my-api-key").

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Response Body

{
    "limit": 50,
    "count": 15757,
    "index": 0,
    "txs": [
        {
            "receivedtime": 1541355684009,
            "id": "4f90831a0aff23a9b831cdedb614515a7ab7258e3baa496b1097b475f2373922"
        },
        {
            "receivedtime": 1541355684009,
            "id": "939c6cfbbf7694e9f28066c67f4b1a69522d2158a8ae0e5b687301301ebc2020"
        },
        {
            "receivedtime": 1541355684009,
            "id": "2a4892dc53295accacf0b332a0299a11cdb3505162bfcf0f860aba1102638e15"
        },
        {
            "receivedtime": 1541355684009,
            "id": "633181349f331d836f767a8c876972912c7c5b33bbe3c63e544c3b4d5ce4620e"
        },
        {
            "receivedtime": 1541355684009,
            "id": "b1711cd587c2a4127fc346db5e41e30bea6fd95d99106604459bf2f87d4e0b0d"
        },
        {
            "receivedtime": 1541355684009,
            "id": "363449a8c78b1bbd0b91a2206050fa5ac279a54f19fae5d1810dcb3f171a870c"
        },
        {
            "receivedtime": 1541355684009,
            "id": "8911d31e374413a5104f9bfabf200a66f875dfd8ab7a02295fd99f5b32da3004"
        },
        {
            "receivedtime": 1541355684009,
            "id": "570f50138d8afde1eb20bfd19c1288d8a81cbdf0c3025eacc473dff27e93c466"
        },
        {
            "receivedtime": 1541355684009,
            "id": "616304b1446e236501d654af26c8f8e2fc64cbd795807d5b38b939380ad1066f"
        },
        {
            "receivedtime": 1541355684009,
            "id": "d84cc3fbe7f5a120ecc3969f77120a5e3998bec1e426c63baec4ee87fb6b591c"
        },
        {
            "receivedtime": 1541355684009,
            "id": "2f2cdb2fad238c94f11e628b5fb1f83c605361042f70e63fab4275840330ebb9"
        },
        {
            "receivedtime": 1541355684009,
            "id": "54247824324289886fb6ab2564471ed804dc62b413652139b37627215fd6a97b"
        },
        {
            "receivedtime": 1541355684009,
            "id": "7420097ff9bf242ad7280f8c9d5efc22c77d58056586168256ee311163bfd84f"
        },
        {
            "receivedtime": 1541355684009,
            "id": "1a5b19c4655e3cce2a513391f617f0a329382aba03ff42eb5074739dd8a9314f"
        },
        {
            "receivedtime": 1541355684009,
            "id": "7e77ad313dc58e0eb9828f4e75916cafc9dcb62e6e0b6c85fc144513f8b63b00"
        },
        {
            "receivedtime": 1541355684009,
            "id": "712b063796135508181c41a90dd6bfb313a840d93b3189d1cf5af877d9654ef5"
        },
        {
            "receivedtime": 1541355684009,
            "id": "76072dead4c7adef299347cce4b695831d83608a0505dd68abc0e6326c1c8313"
        },
        {
            "receivedtime": 1541355684009,
            "id": "978b7a7b14afa187bb3c23b74269a7942ec2abd01f654f2b97c793d8feaed951"
        },
        {
            "receivedtime": 1541355684009,
            "id": "96d4be6e8bbdcf95ced0e871b72b78d22920cd7de84cf9ee300cfb0d3aa9447e"
        },
        {
            "receivedtime": 1541355684009,
            "id": "50ce817892c807b397a646cdd1ce7304546ab13b1fd6e8f1d15b068729039c17"
        },
        {
            "receivedtime": 1541355684009,
            "id": "d8971ba0c949f6c438885a67b9ef61feb8157522ec03bc17d02b9f71330ff888"
        },
        {
            "receivedtime": 1541355684009,
            "id": "66445db49ff4f2f85c676a6bed6117181db000c8f74ef6f3aacffdf6f98ff9e0"
        },
        {
            "receivedtime": 1541355684009,
            "id": "eddf05c1685ddee1aa3fcee9a382b50256d8e104365329360ba652450801987b"
        },
        {
            "receivedtime": 1541355684009,
            "id": "230eafede9ea905fb969818b82676c9de26e09bfbfb55f106c4a160754f8b024"
        },
        {
            "receivedtime": 1541355684009,
            "id": "d729b11cabe87d2891768bbe66dacd338499e46b572350055e675b51e3e2c943"
        },
        {
            "receivedtime": 1541355684009,
            "id": "8ee7bf5b59d353687b653557574a8a5d8cce35e1dbdd5acfc5d881d2d3e6c548"
        },
        {
            "receivedtime": 1541355684009,
            "id": "5d816dd70e4b842e9a54c24b5e0014460c9bac66a6a30407b5ce65b301c81f5a"
        },
        {
            "receivedtime": 1541355684009,
            "id": "755bc57ef48a60b72b3a4cbb325d762ea0c902b2195f392c9a1022f80a423c8f"
        },
        {
            "receivedtime": 1541355684009,
            "id": "b78f39fbc892039f6a040d3b1aa0319b3e6fda5933c802e2d88e15f9af186ce3"
        },
        {
            "receivedtime": 1541355684009,
            "id": "38023baef8bad65a8cf79915a32c99c05112c3ef3015be55f425a793d214f39c"
        },
        {
            "receivedtime": 1541355684009,
            "id": "bf13dc2bfabb259061300921ab7eb58e9c531b306bc0d03204118619b6f14692"
        },
        {
            "receivedtime": 1541355684009,
            "id": "4ffc7a56453d5b8db498d37e3de4baafaaa968224fb1795df9a398162729828d"
        },
        {
            "receivedtime": 1541355684009,
            "id": "cc4849ca06f46eeef4abd023d42490aa5d6d69e5e57068609a806c83485fad76"
        },
        {
            "receivedtime": 1541355684009,
            "id": "5468e8b8faf398ddafe0721f89c2f7031408007c785af4f87487cbe879eb4249"
        },
        {
            "receivedtime": 1541355684009,
            "id": "84e43adf1ab2513cb89204b7a8d9db0a37443980271212d0811f81302f49a63c"
        },
        {
            "receivedtime": 1541355684009,
            "id": "ecf5f6351bda8656fb14a81e64772cc3cffcfbb525214ffe339c25e0d04dd139"
        },
        {
            "receivedtime": 1541355684009,
            "id": "36d26d52f96f09a801b24821b8d884620a1b136d82b4eccb7593d2578439ec18"
        },
        {
            "receivedtime": 1541355684009,
            "id": "87adff0b6860b1a0ed5223fb4bcfb64e1759b9453f58c0445e9899176d69fbe4"
        },
        {
            "receivedtime": 1541355684009,
            "id": "4b60759668efae61cc92088286018e92cd9fb47c1cb4d908669218f5d62d2fdf"
        },
        {
            "receivedtime": 1541355684009,
            "id": "a480d7fc33c84d250584d9b83dc2685f9fee0c787e27638aef5a3eda0a7c0935"
        },
        {
            "receivedtime": 1541355684009,
            "id": "e1e4753ab2b070e35fc44d569fd08feeeacfcb9f79c32d3777b2195f760b0d43"
        },
        {
            "receivedtime": 1541355684009,
            "id": "324c3b42426986293b4ec6ad3eca0046af45f3669ffed15d5d1c14469f4361d3"
        },
        {
            "receivedtime": 1541355684009,
            "id": "d237489b14314ee1dc716623c7a817f4161a49590308a8bebd442aaaaffed990"
        },
        {
            "receivedtime": 1541355684009,
            "id": "1ff7e585cc7ef43d917fba5ff177e4e4d47ac62ab254cb2310a28b50ac3726ff"
        },
        {
            "receivedtime": 1541355684009,
            "id": "392bc8a448deabb7110d9e809acd81fff24eadf15bf73e05632ba7f11229a441"
        },
        {
            "receivedtime": 1541355684009,
            "id": "a1f7c91990f4dd1da52c290505040714f1756b27c274d98e4a9cf4262377d8de"
        },
        {
            "receivedtime": 1541355684009,
            "id": "bf95deaec883f8b2337ce0f4f23d913a3e8a73f30c80995dce3370a7821f0afd"
        },
        {
            "receivedtime": 1541355684009,
            "id": "f045d214fb19ded8a264db3373fe37a2073c9c123b25240c76efaee2ba552ded"
        },
        {
            "receivedtime": 1541355684009,
            "id": "fb267cf7e0744f7a5077c530c8fdc794fa5f0514ef3699d432e9cc67c1c1e1d4"
        },
        {
            "receivedtime": 1541355684009,
            "id": "3545f48df5188a8ee9fb5a49c5641763308cc6be51694e16e7f5b400514214d3"
        }
    ]
}
Info

The Historical Transactions Endpoint returns an array of the latest transactions relayed by nodes in a blockchain that haven’t been included in any blocks. By default it is for last 24 hours

HTTP Request

GET /v1/bc/btc/${NETWORK}/txs/history

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. testnet or mainnet)
txs-included true Whether transactions to be included in response included in response
index 0 Index of first transaction
limit 50 Number of transaction after the index
datetime-from (24h) Transaction From date
datetime-to (now) Transaction To date

The returned object is an array of transactions that are unconfirmed, arranged in reverse chronological order (latest is first, then older transactions follow).

Creating Transactions
Info

Using Crypto APIs, you can push transactions to blockchains one of two ways:

Use a third party library to create your transactions and push raw transactions Use our two-endpoint process outlined below, wherein we generate a TXSkeleton based on your input address, output address, and value to transfer. In either case, for security reasons, we never take possession of your private keys. We do use private keys with our Microtransaction API, but they are for low-value transactions and we discard them immediately from our servers’ memory.

New Transaction Endpoint

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/new \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{"inputs":[{"address": "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9", "value" : 0.54}, {"address" : "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q", "value": 1.0}],"outputs":[{"address": "1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF", "value": 1.54}], "fee" : 0.00001500}'


POST /v1/bc/btc/mainnet/txs/new HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{"inputs":[{"address": "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9", "value" : 0.54}, {"address" : "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q", "value": 1.0}],"outputs":[{"address": "1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF", "value": 1.54}], "fee" : 0.00001500}




var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/new",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\"inputs\":[{\"address\": \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\", \"value\" : 0.54}, {\"address\" : \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\", \"value\": 1.0}],\"outputs\":[{\"address\": \"1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF\", \"value\": 1.54}], \"fee\" : 0.00001500}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/new",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ inputs: 
   [ { address: '1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9', value: 0.54 },
     { address: '1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q', value: 1 } ],
  outputs: [ { address: '1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF', value: 1.54 } ],
  fee: 0.000015 }));
req.end();

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/new');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{"inputs":[{"address": "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9", "value" : 0.54}, {"address" : "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q", "value": 1.0}],"outputs":[{"address": "1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF", "value": 1.54}], "fee" : 0.00001500}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/new")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\"inputs\":[{\"address\": \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\", \"value\" : 0.54}, {\"address\" : \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\", \"value\": 1.0}],\"outputs\":[{\"address\": \"1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF\", \"value\": 1.54}], \"fee\" : 0.00001500}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\"inputs\":[{\"address\": \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\", \"value\" : 0.54}, {\"address\" : \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\", \"value\": 1.0}],\"outputs\":[{\"address\": \"1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF\", \"value\": 1.54}], \"fee\" : 0.00001500}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/txs/new", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"inputs\":[{\"address\": \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\", \"value\" : 0.54}, {\"address\" : \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\", \"value\": 1.0}],\"outputs\":[{\"address\": \"1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF\", \"value\": 1.54}], \"fee\" : 0.00001500}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/new")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/new"

    payload := strings.NewReader("{\"inputs\":[{\"address\": \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\", \"value\" : 0.54}, {\"address\" : \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\", \"value\": 1.0}],\"outputs\":[{\"address\": \"1EdcP2TSFsiQHNGvbbgsxgH7HfaFC54GwF\", \"value\": 1.54}], \"fee\" : 0.00001500}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body

{
    "tosign": "0200000002fba29356aed5f478c9a3ca49937e1574e7437b90f1c5e68cf2806c8d25b598e20000000000ffffffff224693e22c8c442ed336c0ad0f9d7e0c20d960eeef9224e28d8c9dd198ca27480000000000ffffffff0332400f00000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac80da2d09000000001976a9141a96349a5025735fe18f3e783098e471edbad83388acb2929800000000001976a9140c63413d9b2c5d7333e2dfec21c6efa27cf8bbe888ac00000000"
}

To use Crypto APIs 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.

HTTP Request

POST /v1/bc/btc/${NETWORK}/txs/new

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or mainnet)

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.

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 JSON 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 Crypto APIs 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 JSON, which you can use in the following way:

Locally Sign Your Transaction

With your JSON 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.

Send Transaction Endpoint

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/send \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "toSend" : "02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000"
}'


POST /v1/bc/btc/mainnet/txs/send HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "toSend" : "02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/send",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"toSend\" : \"02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/send",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ toSend: '02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/send');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "toSend" : "02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/send")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"toSend\" : \"02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"toSend\" : \"02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/txs/send", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"toSend\" : \"02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/send")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/send"

    payload := strings.NewReader("{\n\t\"toSend\" : \"02000000013f810859c03252a897dc1f5707ed9a3a5234ec4ef0ddafca9d933a0d32375380000000006a4730440220789cf627bc7e84e97dae9e94b97f6a790492511ad0be63afe424953846f9306a02206b99656cc96e58a717d5f47126b2ba49d612d9ef5ffb2d8b707d64d7629a776d0121023cf830a861754675344b72f0ef3654d5d47f156f7800cc6926b10309acf68899ffffffff011ced3200000000001976a914b20ecbedbb8c648e263487d40ab234cecefd34d588ac00000000\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body

{
    "txout": "dd033f3d0639f9ed7fdcef5966d931e833f13364cdf7c742af0ea5f04806bc62"
}

Once you’ve finished signing the tosign array locally, put that (hex-encoded) data into the signatures array of the JSON. 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.

HTTP Request

POST /v1/bc//${NETWORK}/txs/send

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or testnet)

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

Decode Raw Transaction Endpoint

Code samples


curl -X POST \
 https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/decode \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "txHex": "0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f730A30341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000"
}'


POST /v1/bc/btc/mainnet/txs/decode HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "txHex": "0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/decode",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"txHex\": \"0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/txs/decode",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ txHex: '0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/decode');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "txHex": "0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/decode")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"txHex\": \"0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"txHex\": \"0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/txs/decode", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"txHex\": \"0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/decode")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/txs/decode"

    payload := strings.NewReader("{\n\t\"txHex\": \"0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body

{
    "block_time": null,
    "outputs": [
        {
            "addresses": [
                "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9"
            ],
            "asm": "OP_DUP OP_HASH160 1a96349a5025735fe18f3e783098e471edbad833 OP_EQUALVERIFY OP_CHECKSIG",
            "type": "pubkeyhash",
            "value": 0.01,
            "reqsigs": 1
        }
    ],
    "size": 249,
    "locktime": 0,
    "inputs": [
        {
            "addresses": [
                "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q"
            ],
            "coinbase": null,
            "prev_hash": "59950c2b313b230251ba7c73f3acbfe73feb3427d4552d527f55cc053c66abc1",
            "output_value": 50,
            "output_index": 0,
            "script": {
                "asm": ""
            },
            "vout": 0
        },
        {
            "addresses": [
                "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9"
            ],
            "coinbase": null,
            "prev_hash": "79ed699b0144eee8ebf67b14ce660d796118202cabd088972a9f12c39adcd5bf",
            "output_value": 1.1738,
            "output_index": 1,
            "script": {
                "asm": ""
            },
            "vout": 1
        },
        {
            "addresses": [
                "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9"
            ],
            "coinbase": null,
            "prev_hash": "d4a1daa88b1f46b2afee71aebef341d6410303734f37f9f0c36c245595833728",
            "output_value": 1.0938,
            "output_index": 0,
            "script": {
                "asm": ""
            },
            "vout": 0
        },
        {
            "addresses": [
                "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9"
            ],
            "coinbase": null,
            "prev_hash": "c7f1e1244d64198ce66894a2cd6572e5e3cf6e5e4e70d9249a0b2fca6d1623be",
            "output_value": 5,
            "output_index": 0,
            "script": {
                "asm": ""
            },
            "vout": 0
        },
        {
            "addresses": [
                "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9"
            ],
            "coinbase": null,
            "prev_hash": "8df9163dea5d81613c25902dc09a133b0a7e902b988a12bb003fbbb476419941",
            "output_value": 0.65947742,
            "output_index": 0,
            "script": {
                "asm": ""
            },
            "vout": 0
        }
    ],
    "block_hash": null,
    "time": null,
    "confirmations": null,
    "version": 2,
    "vin_sz": 5,
    "hash": "9e45e9998d376a3f59043d1c81cfc698af92f3e9fd5d8e4a0fa0ec66729b40de",
    "vout_sz": 1
}
Info

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.

HTTP Request

POST /v1/bc/btc/${NETWORK}/txs/decode

Request Object

{ "txHex": "${TXHEX}" }

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. mainnet or mainnet)
TXHEX - hex of raw transaction

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

0200000005c1ab663c05cc557f522d55d42734eb3fe7bfacf3737cba5102233b312b0c95590000000000ffffffffbfd5dc9ac3129f2a9788d0ab2c201861790d66ce147bf6ebe8ee44019b69ed790100000000ffffffff2837839555246cc3f0f9374f73030341d641f3beae71eeafb2461f8ba8daa1d40000000000ffffffffbe23166dca2f0b9a24d9704e5e6ecfe3e57265cda29468e68c19644d24e1f1c70000000000ffffffff41994176b4bb3f00bb128a982b907e0a3b139ac02d90253c61815dea3d16f98d0000000000ffffffff0140420f00000000001976a9141a96349a5025735fe18f3e783098e471edbad83388ac00000000

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

Payment 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 Payment 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.

A way to generate payment-specific addresses for which funds will automatically transfer to a main merchant address. Great for automatic merchandise (whether physical or virtual) processing.

We do not take a fee on payment forwarding, other than the required miner fee; payments 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 Payment Endpoint

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/payments \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "from" : "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9",
    "to": "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q",
    "callback" : "http://myaddress.com/paymet_forwarding_hook",
    "wallet" : "demohdwallet",
    "password" : "SECRET123456"
}'


POST /v1/bc/btc/mainnet/payments HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "from" : "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9",
    "to": "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q",
    "callback" : "http://myaddress.com/paymet_forwarding_hook",
    "wallet" : "demohdwallet",
    "password" : "SECRET123456"
}



var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/payments",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"from\" : \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\",\n\t\"to\": \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\",\n\t\"callback\" : \"http://myaddress.com/paymet_forwarding_hook\",\n\t\"wallet\" : \"demohdwallet\",\n\t\"password\" : \"SECRET123456\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "https://api.cryptoapis.io/v1/bc/btc/mainnet/payments",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ from: '1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9',
  to: '1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q',
  callback: 'http://myaddress.com/paymet_forwarding_hook',
  wallet: 'demohdwallet',
  password: 'SECRET123456' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/payments');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "from" : "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9",
    "to": "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q",
    "callback" : "http://myaddress.com/paymet_forwarding_hook",
    "wallet" : "demohdwallet",
    "password" : "SECRET123456"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/payments")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"from\" : \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\",\n\t\"to\": \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\",\n\t\"callback\" : \"http://myaddress.com/paymet_forwarding_hook\",\n\t\"wallet\" : \"demohdwallet\",\n\t\"password\" : \"SECRET123456\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"from\" : \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\",\n\t\"to\": \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\",\n\t\"callback\" : \"http://myaddress.com/paymet_forwarding_hook\",\n\t\"wallet\" : \"demohdwallet\",\n\t\"password\" : \"SECRET123456\"\n}"

headers = {
    'Content-Type': "application/json",
    'X-API-Key': 'my-api-key'
    }

conn.request("POST", "/v1/bc/btc/mainnet/payments", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"from\" : \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\",\n\t\"to\": \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\",\n\t\"callback\" : \"http://myaddress.com/paymet_forwarding_hook\",\n\t\"wallet\" : \"demohdwallet\",\n\t\"password\" : \"SECRET123456\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/payments")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/payments"

    payload := strings.NewReader("{\n\t\"from\" : \"1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9\",\n\t\"to\": \"1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q\",\n\t\"callback\" : \"http://myaddress.com/paymet_forwarding_hook\",\n\t\"wallet\" : \"demohdwallet\",\n\t\"password\" : \"SECRET123456\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "wallet": "demohdwallet",
    "callback": "http://myaddress.com/paymet_forwarding_hook",
    "from": "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9",
    "to": "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q",
    "uuid": "46e552ac-0537-489f-bc58-68f09e74e02f"
}

Payment Forwarding Request

{
    "currency" : "BTC",
    "network" : "mainnet",
    "type" : "PAYMENT_FORWARDING",
    "tx": "f7a718f20ea4529351892e70a563f1c58af5e720798e475cc677302ebef92513",
    "url" : "http://myaddress.com/paymet_forwarding_hook",
    "status" : "DONE",
    "message" : "Payment forwarding was successful!"
}
Info

First, to create an payment forwarding address, you need to POST a partially filled PaymentForward 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 PaymentForward object details.

When payment forwarding is triggered then you are going to receive notification on url when you created new payment forwarding.

HTTP Request

POST /v1/bc/btc/${NETWORK}/payments

Request Object

{
"from": "${FROM_ADDRESS}",
"to": "${TO_ADDRESS}",
"callback": "${CALLBACK_URL}",
"wallet" : ${HD_WALLET_NAME},
"password" : ${WALLET_PASSWORD}
}

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. mainnet or mainnet)
FROM_ADDRESS - destination bitcoin address
TO_ADDRESS - target bitcoin address
CALLBACK_URL - callback url addres that will be called after forwarding is processed
WALLET_NAME - wallet created by current USER_ID
WALLET_PASSWORD - wallet password

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

List Payment Endpoint

Code samples


curl -X GET \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/payments \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/payments HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/payments",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/payments",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/payments');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/payments")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
    'Content-Type': "application/json" ,
    'X-API-Key': "my-api-key"
}

conn.request("GET", "/v1/bc/btc/mainnet/payments", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/payments")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/payments"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "payments" : [{
        "wallet": "demohdwallet",
        "callback": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
        "from": "1P3t6SKHuymgrs2vvgFvtsmnKen2C8gKU9",
        "to": "1K2huCLxy9tXWc5Yn8ow6vqPGvTaCXHo5q",
        "uuid": "bead7e8c-5ecd-4ece-aa20-6fc557349c9d"
      },
      ...
    ]
}

Info

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

HTTP Request

GET /v1/bc/btc/${NETWORK}/payments

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)

This returns the full array of your currently active payment forwarding addresses, based on your USER_ID.

Delete Payment Endpoint

Code samples


curl -X DELETE \
  https://api.cryptoapis.io/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3 \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


DELETE /v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3",
  "method": "DELETE",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "DELETE",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
    'Content-Type': "application/json" ,
    'Authoization': "my-api-key"
}

conn.request("DELETE", "/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3")
  .delete(null)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/testnet/payments/f0e80c20-434b-4195-a1e4-e3cdfd8585f3"

    req, _ := http.NewRequest("DELETE", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "message": "Payment Forwarding has been deleted successfully",
    "status": "ok"
}

Info

When you’re done with a payment forwarding address, you can delete it via its id and current user id.

HTTP Request

DELETE /v1/bc/btc/${NETWORK}/payments/${PAYID}

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
PAYID - Generated UUID when payment forwarding have been created

PAYID is a string representing the payment 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.

Webhook Notification

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.

A WebHook request expects a response with status code 200 (OK) or it will retry the request.

Types of Events
Info

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 CryptoAPIs API 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 transaction.
ADDRESS Triggered any time an address appears in new block added to the blockchain
Create Unconfirmed Transaction WebHook Endpoint

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "event" : "UNCONFIRMED_TX",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}'


POST /v1/bc/btc/mainnet/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "event" : "UNCONFIRMED_TX",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"event\" : \"UNCONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/hooks",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ event: 'UNCONFIRMED_TX',
  url: 'http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "event" : "UNCONFIRMED_TX",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"event\" : \"UNCONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"event\" : \"UNCONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}"

headers = {
    'Content-Type': "application/json",
    'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/hooks", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"event\" : \"UNCONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks"

    payload := strings.NewReader("{\n\t\"event\" : \"UNCONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "Bearer my-generated-toke")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "id": "3c893843-41f1-4a79-84ab-c84c992c81db",
    "event": "UNCONFIRMED_TX",
    "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}

Using a partially filled out Event, you can create a WebHook using this resource.

HTTP Request

POST /v1/bc/btc/${NETWORK}/hooks

Request Object

{ "event": "UNCONFIRMED_TX", "url":{CALLBACK_URL} }

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
EVENT - Webhook Event
CALLBACK_URL - webhook callback url
Create New Block WebHook Endpoint
Using a partially filled out Event, you can create a WebHook using this resource.

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "event" : "NEW_BLOCK",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}'


POST /v1/bc/btc/mainnet/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "event" : "NEW_BLOCK",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"event\" : \"NEW_BLOCK\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/hooks",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ event: 'NEW_BLOCK',
  url: 'http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "event" : "NEW_BLOCK",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"event\" : \"NEW_BLOCK\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"event\" : \"NEW_BLOCK\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}"

headers = {
    'Content-Type': "application/json",
    'X-API-Key': "Bearer my-genrated-token"
}

conn.request("POST", "/v1/bc/btc/mainnet/hooks", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"event\" : \"NEW_BLOCK\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks"

    payload := strings.NewReader("{\n\t\"event\" : \"NEW_BLOCK\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "Bearer my-generated-toke")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "id": "d0bd12a4-fdda-4ee3-a3a2-0c4782497871",
    "event": "NEW_BLOCK",
    "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}

HTTP Request

POST /v1/bc/btc/${NETWORK}/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

Request Object

{ "event": "NEW_BLOCK", "url":{CALLBACK_URL} }

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
EVENT - Webhook Event
CALLBACK_URL - webhook callback url
Create Confirmed Transaction WebHook Endpoint

Code samples


curl -X POST \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "event" : "CONFIRMED_TX",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
    "transaction": "9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e",
    "confirmations": "6"
}'


POST /v1/bc/btc/mainnet/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "event" : "CONFIRMED_TX",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
    "transaction": "9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e",
    "confirmations": "6"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"event\" : \"CONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"transaction\": \"9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e\",\n\t\"confirmations\": \"6\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/hooks",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ event: 'CONFIRMED_TX',
  url: 'http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5',
  transaction: '9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e',
  confirmations: '6' }));
req.end();



<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "event" : "CONFIRMED_TX",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
    "transaction": "9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e",
    "confirmations": "6"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"event\" : \"CONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"transaction\": \"9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e\",\n\t\"confirmations\": \"6\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"event\" : \"CONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"transaction\": \"9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e\",\n\t\"confirmations\": \"7\"\n}"

headers = {
    'Content-Type': "application/json",
    'X-API-Key': "Bearer my-genrated-token"
}

conn.request("POST", "/v1/bc/btc/mainnet/hooks", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"event\" : \"CONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"transaction\": \"9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e\",\n\t\"confirmations\": \"7\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks"

    payload := strings.NewReader("{\n\t\"event\" : \"CONFIRMED_TX\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"transaction\": \"9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e\",\n\t\"confirmations\": \"7\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "Bearer my-generated-toke")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "id": "5525769a-0378-4972-997a-5e758493d794",
    "event": "CONFIRMED_TX",
    "confirmations": 7,
    "transaction": "9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e",
    "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}

Using a partially filled out Event, you can create a WebHook using this resource.

HTTP Request

POST /v1/bc/btc/${NETWORK}/hooks

Request Object

{ "event": "CONFIRMED_TX", "url":{CALLBACK_URL}, "transaction" : ${TRANSACTION}}, "confirmations" : ${CONFIRMATIONS} }

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
EVENT - Webhook Event
CALLBACK_URL - webhook callback url
TRANSACTION - Transaction hash
CONFIRMATIONS - confirmations of mined transactions
Create Address Transaction WebHook Endpoint

Code samples


curl -X POST \
  'https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key' \
  -d '{
    "event" : "ADDRESS",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
    "address": "1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6"
}'


POST /v1/bc/btc/mainnet/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
    "event" : "ADDRESS",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
    "address": "1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"address\": \"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/hooks",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ event: 'ADDRESS',
  url: 'http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5',
  address: '1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
    "event" : "ADDRESS",
    "url" : "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
    "address": "1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"address\": \"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"address\": \"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\"\n}"

headers = {
    'Content-Type': "application/json",
    'X-API-Key': "my-api-key"
}

conn.request("POST", "/v1/bc/btc/mainnet/hooks", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"address\": \"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "strings"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks"

    payload := strings.NewReader("{\n\t\"event\" : \"ADDRESS\",\n\t\"url\" : \"http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5\",\n\t\"address\": \"1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6\"\n}")

    req, _ := http.NewRequest("POST", url, payload)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "address": "1Eeu3eC2b35LWtjXeRMJMSfrDnfDEjNwW6",
    "id": "3027a4d9-1a3e-478a-ab35-08f48679b238",
    "event": "ADDRESS",
    "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5"
}

Using a partially filled out Event, you can create a WebHook using this resource.

HTTP Request

POST /v1/bc/btc/${NETWORK}/hooks

Request Object

{ "event": "ADDRESS", "url":{CALLBACK_URL}, "address" : ${ADDRESS} }

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
EVENT - Webhook Event
CALLBACK_URL - webhook callback url
ADDRESS - webhook callback url
List WebHooks Endpoint

Code samples


curl -X GET \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


GET /v1/bc/btc/mainnet/hooks HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/hooks",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
    'Content-Type': "application/json' ,
    'X-API-Key': 'my-api-key'
}

conn.request("GET", "/v1/bc/btc/mainnet/hooks", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "webhooks": [
        {
            "address": null,
            "block": null,
            "id": "ed82b0cc-8818-401b-9322-640a4727ffd0",
            "event": "NEW_BLOCK",
            "confirmations": null,
            "transaction": null,
            "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
            "height": 543796
        },
        {
            "address": null,
            "block": null,
            "id": "3c893843-41f1-4a79-84ab-c84c992c81db",
            "event": "UNCONFIRMED_TX",
            "confirmations": null,
            "transaction": null,
            "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
            "height": 1407177
        },
        {
            "address": "n2r77mUPQJtY59pSUXjNj2ZFEJH12nsnjd",
            "block": null,
            "id": "3027a4d9-1a3e-478a-ab35-08f48679b238",
            "event": "ADDRESS",
            "confirmations": null,
            "transaction": null,
            "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
            "height": 1407186
        },
        {
            "address": null,
            "block": null,
            "id": "5525769a-0378-4972-997a-5e758493d794",
            "event": "CONFIRMED_TX",
            "confirmations": 7,
            "transaction": "9bba7c4a8121f4bf9819ea481f4abd5e501db40815e23a70dfcb9e99eb9ba05e",
            "url": "http://www.mocky.io/v2/5b0d4b5f3100006e009d55f5",
            "height": 1407191
        }
    ]
}

Using this resource you can list all web hooks that you have created.

HTTP Request

GET /v1/bc/btc/${NETWORK}/hooks

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
Delete WebHook Endpoint

Code samples


curl -X DELETE \
  https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: my-api-key'


DELETE /v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db",
  "method": "DELETE",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "DELETE",
  "hostname": "api.cryptoapis.io",
  "path": "/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db');
$request->setMethod(HTTP_METH_DELETE);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}

?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
    'Content-Type': "application/json' ,
    'X-API-Key': 'my-api-key'
}

conn.request("DELETE", "/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db")
  .delete(null)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "https://api.cryptoapis.io/v1/bc/btc/mainnet/hooks/3c893843-41f1-4a79-84ab-c84c992c81db"

    req, _ := http.NewRequest("DELETE", url, nil)

    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", "my-api-key")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}

Response Body


{
    "status": "ok"
}

You can delete a WebHook by WEBHOOK_ID using this resource.

HTTP Request

DELETE /v1/bc/btc/${NETWORK}/hooks/${WEBHOOK_ID}

Query Parameters
Parameter Default Description
NETWORK - Newtork name (e.g. testnet or mainnet)
WEBHOOK_ID - Webhook id

ETH

Blockchain API

Some of Ethereum’s main points:

Chain Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/rinkeby/info \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/rinkeby/info HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/info",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "info"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php
$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/info');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/info")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,rinkeby,info", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/info")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/info"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")
  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "timestamp": "2018-11-01 14:52:49.283",
  "chain": "rinkeby",
  "height": 3263219,
  "difficulty": "6033453",
  "bestBlockHash": "0x93a4dd08d2f8bfb2f502f9cace4b75f6380f7f283bf3ae62de357c1dceeaec14",
  "txs_count": 19382613,
  "synced": true
}
Info

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

HTTP Request

GET /v1/bc/eth/${NETWORK}/info

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

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

Block Hash Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/rinkeby/blocks/0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "blocks",
    "0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,rinkeby,blocks,0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.rinkeby",
  "height": 523442,
  "hash": "0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383",
  "parent_hash": "0x3e3ad7b9a63de7a1f1f564ee5393876caf61eff04d7c330bfe6df9b942c606d6",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "gas_used": 21000,
  "total": 42000000000000,
  "size": "658 bytes",
  "timestamp": 1447237199,
  "date": "2015-11-11 10:19:59 +UTC",
  "transactions": 1,
  "difficulty": 7657563137253,
  "total_difficulty": 2874342750898990991,
  "gas_limit": 3141592,
  "nonce": "0x32dd2d75a55f1463",
  "mined_by": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
  "uncles": [],
  "extra_data": "0xd983010203844765746887676f312e342e328777696e646f7773",
  "confirmations": 5911230,
  "total_fees": 1050000000000000
}
Info

Block Hash Endpoint gives you detail information for particular block in the blockchain

HTTP Request

GET /v1/bc/eth/${NETWORK}/blocks/${BLOCK_HASH}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)
BLOCK_HASH - Hash of the block in blockchain

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

0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383

The returned object contains information about the block in JSON format, including its height, the total amount of wei 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.

Block Height Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/523442 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/rinkeby/blocks/523442 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/523442",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


const https = require('https');

var options = {
  "method": "GET",
  "hostname": "https://api.cryptoapis.io",
  "path": "/v1/bc/eth/rinkeby/blocks/523442",
  "headers": {
    'Content-Type': 'application/json',
    'X-API-Key': 'my-api-key'
  }
};

var request = https.request(options, function (response) {
  response.on("data", function (data) {
    console.log(data);
  });
});

request.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/523442');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/523442")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,rinkeby,blocks,523442", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/523442")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/523442"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.rinkeby",
  "height": 523442,
  "hash": "0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383",
  "parent_hash": "0x3e3ad7b9a63de7a1f1f564ee5393876caf61eff04d7c330bfe6df9b942c606d6",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "gas_used": 21000,
  "total": 42000000000000,
  "size": "658 bytes",
  "timestamp": 1447237199,
  "date": "2015-11-11 10:19:59 +UTC",
  "transactions": 1,
  "difficulty": 7657563137253,
  "total_difficulty": 2874342750898990991,
  "gas_limit": 3141592,
  "nonce": "0x32dd2d75a55f1463",
  "mined_by": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
  "uncles": [],
  "extra_data": "0xd983010203844765746887676f312e342e328777696e646f7773",
  "confirmations": 5911230,
  "total_fees": 1050000000000000
}
Info

Block Height Endpoint gives you detail information for particular block in the blockchain

HTTP Request

GET /v1/bc/eth/${NETWORK}/blocks/${BLOCK_HEIGHT}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)
BLOCK_HEIGHT - Height of the block in blockchain

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

523442

The returned object contains information about the block in JSON format, including its height, the total amount of wei transacted within it, the number of transactions in it and more.

Latest Block Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/latest \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/rinkeby/blocks/latest HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/latest",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "port": "8021",
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "blocks",
    "latest"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/latest');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/latest")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,rinkeby,blocks,latest", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/latest")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/blocks/latest"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.rinkeby",
  "height": 523442,
  "hash": "0x79230d974f6cea8c11cc2f3a58c2b811313af17a2f7391de6665502910d4d383",
  "parent_hash": "0x3e3ad7b9a63de7a1f1f564ee5393876caf61eff04d7c330bfe6df9b942c606d6",
  "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
  "gas_used": 21000,
  "total": 42000000000000,
  "size": "658 bytes",
  "timestamp": 1447237199,
  "date": "2015-11-11 10:19:59 +UTC",
  "transactions": 1,
  "difficulty": 7657563137253,
  "total_difficulty": 2874342750898990991,
  "gas_limit": 3141592,
  "nonce": "0x32dd2d75a55f1463",
  "mined_by": "0xf8b483dba2c3b7176a3da549ad41a48bb3121069",
  "uncles": [],
  "extra_data": "0xd983010203844765746887676f312e342e328777696e646f7773",
  "confirmations": 5911230,
  "total_fees": 1050000000000000
}
Info

Latest Block Endpoint gives you detail information for the latest block in the blockchain

HTTP Request

GET /v1/bc/eth/${NETWORK}/blocks/latest

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

The returned object contains information about the latest block in JSON format, including its height, the total amount of wei transacted within it, the number of transactions in it and more.

Address API

Whereas the Bitcoin blockchain was purely a list of transactions, Ethereum’s basic unit is the account. The Ethereum blockchain tracks the state of every account, and all state transitions on the Ethereum blockchain are transfers of value and information between accounts. There are two types of accounts:

Crypto APIs Address API allows you to look up information about public Ethereum addresses/accounts and generate your own low-value Ethereum addresses/public-private key pairs.

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:

More about Ethereum Account Management can be found in the offical documents.

Address Balance Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/balance \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'

GET /v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/balance HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/balance",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "address",
    "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
    "balance"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/balance');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/balance")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,ropsten,address,0x0cb1883c01377f45ee5d7448a32b5ac1709afc11,balance", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/balance")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/balance"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.ropsten",
  "address": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "balance": "7237346859530149966"
}
Info

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

HTTP Request

GET /v1/bc/eth/${NETWORK}/address/${ADDRESS}/balance

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)
ADDRESS - Address in blockchain

ADDRESS is a string representing the public address you’re interested in querying, for example:

0x0cb1883c01377f45ee5d7448a32b5ac1709afc11

The returned object contains information about the address, including its balance in wei 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

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "address",
    "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,ropsten,address,0x0cb1883c01377f45ee5d7448a32b5ac1709afc11", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.ropsten",
  "address": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "txs_count": 25,
  "from": 18,
  "to": 7
}
Info

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).

HTTP Request

GET /v1/bc/eth/${NETWORK}/address/${ADDRESS}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)
ADDRESS - Address in blockchain

ADDRESS is a string representing the public address you’re interested in querying, for example:

0x0cb1883c01377f45ee5d7448a32b5ac1709afc11

The returned object contains information about the address, including its balance in wei 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.

Transactions By Address Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/transactions?index=0&limit=15  \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/transactions?index=0&limit=15 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/transactions?index=0&limit=15",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "address",
    "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
    "transactions"
  ],
    "qs": {
    "index": 0,
    "limit": 15
  },
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/transactions?index=0&limit=15');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/transactions?index=0&limit=15")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

querystring = {"index": 0, "limit": 15}

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,ropsten,address,0x0cb1883c01377f45ee5d7448a32b5ac1709afc11,transactions", headers=headers, params=querystring))

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/transactions?index=0&limit=15")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/address/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/transactions?index=0&limit=15"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
    "address": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
    "txs": [
      {
        "from": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "to": "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
        "hash": "0xcdcafec2af803df923a4ddb6c06e3985dc52f39073bcb0b3dcd57677fc9493cf",
        "value": "537000000000000000",
        "timestamp": "2018-10-08 11:13:28 +UTC",
        "nonce": "152",
        "confirmations": "11915"
      },
      {
        "from": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "to": "0x04887ec7273c8ab8f3c96bf7c8347b744609c8b0",
        "hash": "0x10b1525a7420a267eda8e116c1007b27569713177587f0492b9c8139b34dece5",
        "value": "137000000000000000",
        "timestamp": "2018-10-05 09:35:39 +UTC",
        "nonce": "151",
        "confirmations": "29012"
      },
      {
        "from": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "to": "0x04887ec7273c8ab8f3c96bf7c8347b744609c8b0",
        "hash": "0x6e6eb8a2fdad2a7fb1b883c43baa28db3adc4edb5129e6017f5b0daba136f063",
        "value": "143000000000000000",
        "timestamp": "2018-10-04 15:18:28 +UTC",
        "nonce": "150",
        "confirmations": "35146"
      },
      {
        "from": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "to": "0x04887ec7273c8ab8f3c96bf7c8347b744609c8b0",
        "hash": "0x6b1497425fd494dec9c88229eef32df587cfc286b1aa4de17fb70d40162d6890",
        "value": "43000000000000000",
        "timestamp": "2018-10-03 15:46:08 +UTC",
        "nonce": "149",
        "confirmations": "39804"
      },
      {
        "from": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "to": "0x04887ec7273c8ab8f3c96bf7c8347b744609c8b0",
        "hash": "0xd46e087489b80d3f08c84f3d82649007274cd1ac668044fd24471e5244181eb4",
        "value": "43000000000000000",
        "timestamp": "2018-10-03 15:44:09 +UTC",
        "nonce": "148",
        "confirmations": "39818"
      }
    ]
}
Info

The Transactions By Address Endpoint returns all transactions specified by the query params: index and limit; The maxim value of limit is 50.

HTTP Request

GET /v1/bc/eth/${NETWORK}/address/${ADDRESS}/transactions?index=${INDEX}&limit=${LIMIT}

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)
ADDRESS ------- Address in blockchain
INDEX ------- start from
LIMIT ------- limit up to n transactions

ADDRESS is a string representing the public address you’re interested in querying, for example:

0x0cb1883c01377f45ee5d7448a32b5ac1709afc11

INDEX is a integer representing the order of the transaction, for example:

0

LIMIT is a integer representing limit for transactions, for example:

15

Generate Address Endpoint

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/address \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


POST /v1/bc/eth/ropsten/address HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/address",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "address"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/address');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/address")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,address", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/address")
  .post(null)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/address"

  req, _ := http.NewRequest("POST", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "address": "0x9418badac83421c6d1e07ff6d5758f7bcaccfb1d",
  "privateKey": "c75dcb770fa596d2954b616389cdd78622fc34c3b29d28006247b7e852892c1a",
  "publicKey": "437ba79a8927471a7e3e45dac91854afbfddc577bece9960cc1287950ea467a503de5c4b1ca8b2685f88246ade41e1e4cac188e1eb5de56c0344fdecffb2b4e9"
}
Info

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.

HTTP Request

POST /v1/bc/eth/${NETWORK}/address

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

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

Generate Account Endpoint

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/account \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "password":"yourpassword"
    }'


POST /v1/bc/eth/ropsten/account HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "password":"yourpassword"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/account",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"password\":\"yourpassword\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "account"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ password: 'yourpassword' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/account');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "password":"yourpassword"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/account")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"password\":\"yourpassword\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n  \"password\":\"yourpassword\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,account", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"password\":\"yourpassword\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/account")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/account"

  payload := strings.NewReader("{\n\t\"password\":\"yourpassword\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "success": "keystore saved",
  "address": "0xb8c572d068a4cd4bf76c8d24e5561915fb5da8a6"
}
Info

The Generate Account Endpoint allows you to generate private-public key-pairs along with an associated public address encoded in a keyfile. A password and user id are required with this POST request. Keyfiles are stored in a keystore subdirectory on our servers. The critical component of the keyfile, the account’s private key, is always encrypted, and it is encrypted with the password entered when the account was created.

The user id is needed in order to associate the keyfile with the specific user.

HTTP Request

POST /v1/bc/eth/${NETWORK}/account

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

The returned object contains a public address.

Transaction API

Crypto APIs Transaction API allows you to look up information about pending transactions, query transactions based on hash, create and propagate your own transactions and embed data on the blockchain—all based on the coin/chain resource you’ve selected for your endpoints.

Unlike Bitcoin, Ethereum has no concept of UTXOs. Instead, addresses have a running balance, and use an ever-increasing sequence/nonce for every transaction to maintain proper address state. You can read more about this design decision here. Transaction signing and generation are also different in Ethereum, but for basic transactions, the process is very similar to our Bitcoin API.

Transaction Hash Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/hash/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/mainnet/txs/hash/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/hash/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "eth",
    "bc",
    "mainnet",
    "txs",
    "hash",
    "0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/hash/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/hash/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,mainnet,txs,hash,0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/hash/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/hash/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.mainnet",
  "status": "0x1",
  "index": 79,
  "hash": "0x5d41df69ee87f712e76ee5f4dd6c0ccbec114b9d871340b7e2b34bf6d8d26c2c",
  "value": 0,
  "from": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
  "to": "0x946048a75af11c300a274344887ec39452218b3d",
  "date": "2018-10-17 08:31:13 +UTC",
  "block_hash": "0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c",
  "block_number": 6530876,
  "gas": 340977,
  "gas_price": 6000000000,
  "gas_used": 227318,
  "nonce": 61,
  "confirmations": 762,
  "token_transfers": [
    {
        "from": "0x0000000000000000000000000000000000000000",
        "to": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
        "tokenName": "MyCryptoHeroes:Hero",
        "symbol": "MCHH",
        "tokenType": "ERC-721",
        "tokenID": "30060053"
    },
    {
        "from": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
        "to": "0x946048a75af11c300a274344887ec39452218b3d",
        "value": "11.10948334",
        "tokenName": "EtheremonToken",
        "symbol": "EMONT",
        "tokenType": "ERC-20"
    }
  ],
  "input": "0x0396dcb00000000000000000000000000000000000000000000000000000000000000bbe0000000000000000000000000000000000000000000000000000000042e369c00000000000000000000000000000000000000000000000000000000000000000"
}
Info

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

HTTP Request

GET /v1/bc/eth/${NETWORK}/txs/hash/${TX_HASH}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)
TX_HASH - Hash of the transaction in blockchain

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

0x5d41df69ee87f712e76ee5f4dd6c0ccbec114b9d871340b7e2b34bf6d8d26c2c

The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.

Transactions Index Endpoint by Index, Limit and Block Number

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/block/4173655?index=0&limit=4 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/ropsten/txs/block/4173655?index=0&limit=4 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/block/4173655?index=0&limit=4",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "block",
    "4173655"
  ],
  "qs": {
    "index": 0,
    "limit": 4
  },
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/block/4173655?index=0&limit=4');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/block/4173655?index=0&limit=4")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

querystring = {"index": 0, "limit": 4}

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,ropsten,txs,block,4173655", headers=headers, params=querystring)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/block/4173655?index=0&limit=4")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/block/4173655?index=0&limit=4"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

[
  {
    "chain": "ETH.ropsten",
    "status": "0x1",
    "index": 0,
    "hash": "0x7fc78d0e9a386076cd216ea207f19997d281163aee30204b7ec0a84791c0021f",
    "value": 60000000000000,
    "from": "0x31d69f8cb2a0c33d43f6a1eac1b5940483d6c40a",
    "to": "0x4709ab0acdb83b382240122fe360810668efa728",
    "date": "2018-10-05 06:26:26 +UTC",
    "block_hash": "0x0114449f2f83df6947c12e91a9d44cf69cdb34eb1d4b169e373ed2ead785e568",
    "block_number": 4173655,
    "gas": 21000,
    "gas_price": 1000000000,
    "gas_used": 21000,
    "nonce": 749,
    "input": "0x",
    "confirmations": 3097
  },
  {
    "chain": "ETH.ropsten",
    "status": "0x1",
    "index": 1,
    "hash": "0xe53df98e05e68eff01afca62a9ab720cbbe60fee88813148bc33d931d1ead98b",
    "value": 60000000000000,
    "from": "0x31d69f8cb2a0c33d43f6a1eac1b5940483d6c40a",
    "to": "0x9d271c0005aafb722d177aa6d0a8145c7be80ed4",
    "date": "2018-10-05 06:26:26 +UTC",
    "block_hash": "0x0114449f2f83df6947c12e91a9d44cf69cdb34eb1d4b169e373ed2ead785e568",
    "block_number": 4173655,
    "gas": 21000,
    "gas_price": 1000000000,
    "gas_used": 21000,
    "nonce": 750,
    "input": "0x",
    "confirmations": 3097
  },
  {
    "chain": "ETH.ropsten",
    "status": "0x1",
    "index": 2,
    "hash": "0xd6f1f418515ee7694c31f99d85feea9dddc8081317f0f76c6781de9009787da2",
    "value": 60000000000000,
    "from": "0x31d69f8cb2a0c33d43f6a1eac1b5940483d6c40a",
    "to": "0x82de76c863d85c4e3a61a6ea8ae3b7eb452ec0cf",
    "date": "2018-10-05 06:26:26 +UTC",
    "block_hash": "0x0114449f2f83df6947c12e91a9d44cf69cdb34eb1d4b169e373ed2ead785e568",
    "block_number": 4173655,
    "gas": 21000,
    "gas_price": 1000000000,
    "gas_used": 21000,
    "nonce": 751,
    "input": "0x",
    "confirmations": 3097
  },
  {
    "chain": "ETH.ropsten",
    "status": "0x1",
    "index": 3,
    "hash": "0xf81f9d0091d8e424545f080a6cbd1b5167926371f90828292452ca9df90b551e",
    "value": 60000000000000,
    "from": "0x31d69f8cb2a0c33d43f6a1eac1b5940483d6c40a",
    "to": "0x33e5208b30dd58495bd0037ab2ba9a8762c0e757",
    "date": "2018-10-05 06:26:26 +UTC",
    "block_hash": "0x0114449f2f83df6947c12e91a9d44cf69cdb34eb1d4b169e373ed2ead785e568",
    "block_number": 4173655,
    "gas": 21000,
    "gas_price": 1000000000,
    "gas_used": 21000,
    "nonce": 752,
    "input": "0x",
    "confirmations": 3097
  }
]
Info

The Transaction Index Endpoint by Index, Limit and Block Number returns detailed information about transactions for the block height defined, starting from the index defined up to the limit defined . In the example above index is 0 and limit is 4, therefore the response will be an array of 4 transactions starting from index 0. The highest number for the limit is 50.

HTTP Request

GET /v1/bc/eth/${NETWORK}/txs/block/${BLOCK_NUMBER}?index=${TX_INDEX}&limit=${LIMIT}

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)
TX_INDEX ------- Index - start from
LIMIT ------- Limit - up to
BLOCK_NUMBER ------- Block height

TX_INDEX is a integer representing the order of the transaction within the block, for example:

0

LIMIT is a integer representing limit for transactions, for example:

4

BLOCK_NUMBER is a integer representing the height of the block, for example:

4173655

Transactions Index Endpoint by Block Number

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/6530876/79 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/mainnet/txs/block/6530876/79 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/6530876/79",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "mainnet",
    "txs",
    "6530876",
    "79"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/6530876/79');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/6530876/79")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,mainnet,txs,6530876,79", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/6530876/79")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/6530876/79"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.mainnet",
  "status": "0x1",
  "index": 79,
  "hash": "0x5d41df69ee87f712e76ee5f4dd6c0ccbec114b9d871340b7e2b34bf6d8d26c2c",
  "value": 0,
  "from": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
  "to": "0x946048a75af11c300a274344887ec39452218b3d",
  "date": "2018-10-17 08:31:13 +UTC",
  "block_hash": "0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c",
  "block_number": 6530876,
  "gas": 340977,
  "gas_price": 6000000000,
  "gas_used": 227318,
  "nonce": 61,
  "confirmations": 762,
  "token_transfers": [
    {
        "from": "0x0000000000000000000000000000000000000000",
        "to": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
        "tokenName": "MyCryptoHeroes:Hero",
        "symbol": "MCHH",
        "tokenType": "ERC-721",
        "tokenID": "30060053"
    },
    {
        "from": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
        "to": "0x946048a75af11c300a274344887ec39452218b3d",
        "value": "11.10948334",
        "tokenName": "EtheremonToken",
        "symbol": "EMONT",
        "tokenType": "ERC-20"
    }
  ],
  "input": "0x0396dcb00000000000000000000000000000000000000000000000000000000000000bbe0000000000000000000000000000000000000000000000000000000042e369c00000000000000000000000000000000000000000000000000000000000000000"
}
Info

The Transaction Index Endpoint by Block Number returns detailed information about a given transaction based on its index and block height.

HTTP Request

GET /v1/bc/eth/${NETWORK}/txs/block/${BLOCK_NUMBER}/${TX_INDEX}

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)
TX_INDEX - Index of the transaction in block
BLOCK_NUMBER - Block height

TX_INDEX is a integer representing the order of the transaction within the block, for example:

79

BLOCK_NUMBER is a integer representing the height of the block, for example:

6530876

The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.

Transactions Index Endpoint by Block Hash

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c/79 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/mainnet/txs/block/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c/79 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c/79",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "mainnet",
    "txs",
    "block",
    "0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c",
    "79"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c/79');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c/79")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,mainnet,txs,block,0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c,79", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c/79")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/block/0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c/79"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "chain": "ETH.mainnet",
  "status": "0x1",
  "index": 79,
  "hash": "0x5d41df69ee87f712e76ee5f4dd6c0ccbec114b9d871340b7e2b34bf6d8d26c2c",
  "value": 0,
  "from": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
  "to": "0x946048a75af11c300a274344887ec39452218b3d",
  "date": "2018-10-17 08:31:13 +UTC",
  "block_hash": "0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c",
  "block_number": 6530876,
  "gas": 340977,
  "gas_price": 6000000000,
  "gas_used": 227318,
  "nonce": 61,
  "confirmations": 762,
  "token_transfers": [
    {
        "from": "0x0000000000000000000000000000000000000000",
        "to": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
        "tokenName": "MyCryptoHeroes:Hero",
        "symbol": "MCHH",
        "tokenType": "ERC-721",
        "tokenID": "30060053"
    },
    {
        "from": "0xc071a1945cff872d30e7f3bdfcd17eca8f46ea19",
        "to": "0x946048a75af11c300a274344887ec39452218b3d",
        "value": "11.10948334",
        "tokenName": "EtheremonToken",
        "symbol": "EMONT",
        "tokenType": "ERC-20"
    }
  ],
  "input": "0x0396dcb00000000000000000000000000000000000000000000000000000000000000bbe0000000000000000000000000000000000000000000000000000000042e369c00000000000000000000000000000000000000000000000000000000000000000"
}
Info

The Transaction Index Endpoint by Block Hash returns detailed information about a given transaction based on its index and block hash.

HTTP Request

GET /v1/bc/eth/${NETWORK}/txs/block/${BLOCK_HASH}/${TX_INDEX}

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)
TX_INDEX ------- Index of the transaction in block
BLOCK_HASH ------- Block hash

TX_INDEX is a integer representing the order of the transaction within the block, for example:

79

BLOCK_HASH is a string representing the hash of the block, for example:

0x0d13e81c01de31060a2830bb53761ef29ac5c4e5c1d43e309ca9a101140e394c

The returned object contains detailed information about the transaction, including the value transfered, fees collected, date received, any scripts associated with an output, and more.

Creating Transactions
Info

Using Crypto APIs, you can push transactions to blockchains one of two ways:

Use a third-party library to create your transactions and push raw transactions Use our two-endpoint process outlined below, wherein we generate a TXSkeleton based on your input address, output address, and value to transfer.

New Transaction Endpoint using keystore file stored on our server

In order to use this endpoint you should have an account(keystore file) stored on our servers.

Then, you need to provide the input address(es), output address, value to transfer (in Ether), gas price and gas limit in wei. If gas limit is not specified, a the default value will be set to 60,000 wei. A standard ETH transfer requires a gas limit of 21,000 units of gas. Even if you set a higher than the required gas limit, only the required limit will be deducted.

If needed, a data hexidecimal string can be provided as well (within the json request), as follows: "data" : "0xbc373585" Be aware that the gas limit will be higher than the minumum amount of 21,000 wei.

The password associated with the keyfile should also be specified in order to unlock the account.

HTTP Request

POST /v1/bc/eth/${NETWORK}/txs/new

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "fromAddress" : "0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff",
        "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "gasPrice" : 21000000000,
        "gasLimit" : 21000,
        "value" : 1.12,
        "password" : "123456"
    }'


POST /v1/bc/eth/ropsten/txs/new HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "gasPrice" : 21000000000,
  "gasLimit" : 21000,
  "value" : 1.12,
  "password" : "123456"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"password\" : \"123456\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "new"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ fromAddress: '0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff',
  toAddress: '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11',
  gasPrice: 21000000000,
  gasLimit: 21000,
  value: 1.12,
  password: '123456' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "fromAddress" : "0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "gasPrice" : 21000000000,
  "gasLimit" : 21000,
  "value" : 1.12,
  "password" : "123456"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

request.body = "{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"password\" : \"123456\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n  \"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n  \"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n  \"gasPrice\" : 21000000000,\n  \"gasLimit\" : 21000,\n  \"value\" : 1.12,\n  \"password\" : \"123456\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,txs,new", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"password\" : \"123456\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new"

  payload := strings.NewReader("{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"password\" : \"123456\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "txs": "0xfebf0691cc92f67ace032897a83587c44c5b2ef437341c6cfd5dbf1f8f4c288d",
}
Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

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, gas price, gas limit and password.

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 transaction hash, for example:

{ "txs_hash": "0xfebf0691cc92f67ace032897a83587c44c5b2ef437341c6cfd5dbf1f8f4c288d" }

This hash can be traced in the explorer. It will be with a pending status until it is mined.

Send All Amount Endpoint using keystore file stored on our server

This endpoint allows users to send all the available ether on their accounts to a specified address. Users should only specify the following information:

Gas limit and price are optional. Gas limit will be calculated by the EVM and the gas price has a default value of 15 Gwei.

HTTP Request

POST /v1/bc/eth/${NETWORK}/txs/new/all

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new/all \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "fromAddress" : "0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff",
        "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "password" : "123456"
    }'


POST /v1/bc/eth/ropsten/txs/new/all HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "password" : "123456"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new/all",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"password\" : \"123456\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "new",
    "all"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ fromAddress: '0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff',
  toAddress: '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11',
  password: '123456' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new/all');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "fromAddress" : "0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "password" : "123456"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new/all")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

request.body = "{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"password\" : \"123456\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n  \"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n  \"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n  \"password\" : \"123456\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,txs,new,all", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"password\" : \"123456\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new/all")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new/all"

  payload := strings.NewReader("{\n\t\"fromAddress\" : \"0xc438d912235ff5facc22c502e5bd6dc1ae14a7ff\",\n\t\"password\" : \"123456\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "txs": "0xfebf0691cc92f67ace032897a83587c44c5b2ef437341c6cfd5dbf1f8f4c288d",
}
Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

As a return object, you’ll receive a transaction hash, for example:

{ "txs_hash": "0xfebf0691cc92f67ace032897a83587c44c5b2ef437341c6cfd5dbf1f8f4c288d" }

This hash can be traced in the explorer. It will be with a pending status until it is mined.

New Transaction Endpoint with a private key

Crypto APIs allows sending transactions for address that are not hold on our servers. In this case the data that should be provided is as follows:

HTTP Request

POST /v1/bc/eth/${NETWORK}/txs/new-pvtkey

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
        -d '{
        "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
        "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "gasPrice" : 21000000000,
        "gasLimit" : 21000,
        "value" : 1.12,
        "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
    }'


POST /v1/bc/eth/ropsten/txs/new-pvtkey HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "gasPrice" : 21000000000,
  "gasLimit" : 21000,
  "value" : 1.12,
  "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
}

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "new-pvtkey"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ fromAddress: '0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be',
  toAddress: '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11',
  gasPrice: 21000000000,
  gasLimit: 21000,
  value: 1.12,
  privateKey: '0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "gasPrice" : 21000000000,
  "gasLimit" : 21000,
  "value" : 1.12,
  "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

request.body = "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n  \"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n  \"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n  \"gasPrice\" : 21000000000,\n  \"gasLimit\" : 21000,\n  \"value\" : 1.12,\n  \"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,txs,new-pvtkey", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey"

  payload := strings.NewReader("{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 21000,\n\t\"value\" : 1.12,\n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "txs_hash": "0x300feeceb350a5e2e955d05bd31adde7f4e2c6d2390a16d9435c704525e61ea4"
}
Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

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, gas price, gas limit and the private key of the address. A standard ETH transfer requires a gas limit of 21,000 units of gas, thefore if gas limit is not priveded the default value will be 60,000 units of gas.

As a return object, you’ll receive a transaction hash, for example:

{ "txs_hash": "0x300feeceb350a5e2e955d05bd31adde7f4e2c6d2390a16d9435c704525e61ea4" }

This hash can be traced in the explorer. It will be with a status pending until it is mined.

Send All Amount Endpoint with a private key

Crypto APIs allows sending transactions (all available eth on a specified address) for address that are not hold on our servers. In this case the data that should be provided is as follows:

Default gas price is 15Gwei, gas limit (if not set) will be calculated by the EVM.

HTTP Request

POST /v1/bc/eth/${NETWORK}/txs/new-pvtkey/all

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey/all \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
        -d '{
        "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
        "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
    }'


POST /v1/bc/eth/ropsten/txs/new-pvtkey/all HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
}

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey/all",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\", privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "new-pvtkey",
    "all"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ fromAddress: '0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be',
  toAddress: '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11',
  privateKey: '0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey/all');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey/all")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

request.body = "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n  \"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n  \"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n  \"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,txs,new-pvtkey,all", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey/all")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/new-pvtkey/all"

  payload := strings.NewReader("{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\", \n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
  "txs_hash": "0x300feeceb350a5e2e955d05bd31adde7f4e2c6d2390a16d9435c704525e61ea4"
}
Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

As a return object, you’ll receive a transaction hash, for example:

{ "txs_hash": "0x300feeceb350a5e2e955d05bd31adde7f4e2c6d2390a16d9435c704525e61ea4" }

This hash can be traced in the explorer. It will be with a status pending until it is mined.

Locally Sign Your Transaction Endpoint

Crypto APIs provides the opportunity to locally sign your transaction. If you want to use third-pary tools for signing your raw transactions you can send to the Locally Sign Your Transaction Endpoint only the following data:

For your convenience we need only this information. We will calculate the nonce for your transaction and add default values for gas price and gas value. After sending the request a JSON will be send to you (see response body). With your JSON returned from the Locally Sign Your Transaction Endpoint you now need to use your private key to sign the data provided.

After signing your JSON locally you will be provided with hex-encoded raw string, for example(depends on your third-party tools):

{ raw: "0xf8690e827d00831e8480940cb1883c01377f45ee5d7448a32b5ac1709afc11877265bab9c48000802aa05be8d75183572592949237b32a9aec605631ca3e7471f038d69fff6a4b320777a00f41b170152f34644c1423b1aaf29b2229f05c35eb7534830d30c974c7f9c7c4", tx: { gas: "0x1e8480", gasPrice: "0x7d00", hash: "0x61710049f64c5187611ebc827d7a9f2479cd7c78e8bf6d66232e8dc57328b09c", input: "0x", nonce: "0xe", r: "0x5be8d75183572592949237b32a9aec605631ca3e7471f038d69fff6a4b320777", s: "0xf41b170152f34644c1423b1aaf29b2229f05c35eb7534830d30c974c7f9c7c4", to: "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11", v: "0x2a", value: "0x7265bab9c48000" } }

We expect the hex-encoded data from the raw field.

HTTP Request

POST /v1/bc/eth/${NETWORK}/txs/send

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/send \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
        "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "value" : 1.212
    }'


POST /v1/bc/eth/ropsten/txs/send HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "value" : 1.212
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/send",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"value\" : 1.212\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "send"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ fromAddress: '0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be',
  toAddress: '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11',
  value: 1.212 }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/send');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "fromAddress" : "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "value" : 1.212
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/send")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"value\" : 1.212\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n  \"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n  \"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n  \"value\" : 1.212\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,txs,send", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"value\" : 1.212\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/send")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/send"

  payload := strings.NewReader("{\n\t\"fromAddress\" : \"0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"value\" : 1.212\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
    "from": "0x1b85a43e2e7f52e766ddfdfa2b901c42cb1201be",
    "gas": 2000000,
    "gasLimit": 21000,
    "gasPrice": 21000000000,
    "nonce": 0,
    "to": "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
    "value": 1212000000000000000
}
Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

If request is successful, you’ll receive a JSON with the completed TX and an HTTP Status Code 200.

Push Raw Transaction Endpoint

Once you’ve finished signing the raw transaction locally, send that raw transaction to our Push Raw Transaction Endpoint.

HTTP Request

POST /v1/bc/eth/${NETWORK}/txs/push

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/push \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "signed_txs" : "0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69"
    }'


POST /v1/bc/eth/ropsten/txs/push HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "signed_txs" : "0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/push",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"signed_txs\" : \"0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "push"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ signed_txs: '0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/push');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "signed_txs" : "0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/push")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"signed_txs\" : \"0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"signed_txs\" : \"0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,txs,push", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"signed_txs\" : \"0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/push")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/push"

  payload := strings.NewReader("{\n\t\"signed_txs\" : \"0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
  "timestamp": "2018-06-29 10:37:29.266",
  "tx_hash": "0x61710049f64c5187611ebc827d7a9f2479cd7c78e8bf6d66232e8dc57328b09c"
}
Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

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

{ signed_txs : 0xf86a22827d00831e8480941b85a43e2e7f52e766ddfdfa2b901c42cb1201be8801b27f33b807c0008029a084ccbf02b27e0842fb1eda7a187a5589c3759be0e969e0ca989dc469a5e5e394a02e111e1156b197f1de4c1d9ba4af26e50665ea6d617d05b3e4047da12b915e69 }

If it succeeds, you’ll receive your transacation hash, for example:

{ tx_hash : "0x61710049f64c5187611ebc827d7a9f2479cd7c78e8bf6d66232e8dc57328b09c" }

Estimate Transaction Gas Endpoint

Crypto APIs provides an endpoint for estimating the gas needed for a successful transaction. This is very useful when sending ether to contracts or making a transaction with additional data in it.

You have to provide the following data:

HTTP Request

POST /v1/bc/eth/${NETWORK}/txs/gas

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/gas \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "fromAddress" : "0x7857af2143cb06ddc1dab5d7844c9402e89717cb",
        "toAddress" : "0xc595B20EEC3d35E8f993d79262669F3ADb6328f7",
        "value" : 0.12,
        "data" : "24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7"
    }'

POST /v1/bc/eth/ropsten/txs/gas HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0x7857af2143cb06ddc1dab5d7844c9402e89717cb",
  "toAddress" : "0xc595B20EEC3d35E8f993d79262669F3ADb6328f7",
  "value" : 0.12,
  "data" : "24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/gas",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n  \"fromAddress\" : \"0x7857af2143cb06ddc1dab5d7844c9402e89717cb\",\n  \"toAddress\" : \"0xc595B20EEC3d35E8f993d79262669F3ADb6328f7\",\n  \"value\" : 0.12,\n  \"data\" : \"24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "ropsten",
    "txs",
    "gas"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ fromAddress: '0x7857af2143cb06ddc1dab5d7844c9402e89717cb',
  toAddress: '0xc595B20EEC3d35E8f993d79262669F3ADb6328f7',
  value: 0.12,
  data: '24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/gas');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "fromAddress" : "0x7857af2143cb06ddc1dab5d7844c9402e89717cb",
  "toAddress" : "0xc595B20EEC3d35E8f993d79262669F3ADb6328f7",
  "value" : 0.12,
  "data" : "24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/gas")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n  \"fromAddress\" : \"0x7857af2143cb06ddc1dab5d7844c9402e89717cb\",\n  \"toAddress\" : \"0xc595B20EEC3d35E8f993d79262669F3ADb6328f7\",\n  \"value\" : 0.12,\n  \"data\" : \"24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n  \"fromAddress\" : \"0x7857af2143cb06ddc1dab5d7844c9402e89717cb\",\n  \"toAddress\" : \"0xc595B20EEC3d35E8f993d79262669F3ADb6328f7\",\n  \"value\" : 0.12,\n  \"data\" : \"24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,ropsten,txs,gas", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n  \"fromAddress\" : \"0x7857af2143cb06ddc1dab5d7844c9402e89717cb\",\n  \"toAddress\" : \"0xc595B20EEC3d35E8f993d79262669F3ADb6328f7\",\n  \"value\" : 0.12,\n  \"data\" : \"24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/gas")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/ropsten/txs/gas"

  payload := strings.NewReader("{\n  \"fromAddress\" : \"0x7857af2143cb06ddc1dab5d7844c9402e89717cb\",\n  \"toAddress\" : \"0xc595B20EEC3d35E8f993d79262669F3ADb6328f7\",\n  \"value\" : 0.12,\n  \"data\" : \"24224747A80F225FD841E7AB2806A2FDF78525B58C1BC1F5D5A5D3943B4214B6C350CE0D973CAD81BD7A6E57048A487939D7CD6373BF8C9F3ADB6328f7\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
    "gas_needed": "21040"
}
Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

If it succeeds, you’ll receive a response with the estimated gas, as follows:

{ "gas_needed": "21040" }

Pending Transactions Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/pending \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/mainnet/txs/pending HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/pending",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "mainnet",
    "txs",
    "pending"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/pending');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/pending")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,mainnet,txs,pending", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/pending")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/pending"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
    "count": 150,
    "pending_txs": [
        {
            "hash": "0x8ddff76c119e5d4b8250d9949d26174c14bb51255521c957b3509dbde540f91b",
            "nonce": "0",
            "blockHash": "0x05ad4613a4e8531e460b3100478f78d8e3622d26a39e20f6661f6412c06e94eb",
            "blockNumber": "7109024",
            "transactionIndex": "0",
            "from": "0x49aa3eeca683903286a9c43804f8211953240f7e",
            "to": "0x92d44b6b3a23b48a93b1bce4d206c0280f96b1cd",
            "value": "8420000000000000",
            "gasPrice": "80000000000",
            "gas": "21000",
            "input": "0x"
        },
        ...
        {
            "hash": "0x722b2699aa6a4e80f96748fd5353499f02efe1e0e3231508bf48a578ed09be9e",
            "nonce": "291898",
            "blockHash": "0x05ad4613a4e8531e460b3100478f78d8e3622d26a39e20f6661f6412c06e94eb",
            "blockNumber": "7109024",
            "transactionIndex": "1",
            "from": "0xb01cb49fe0d6d6e47edf3a072d15dfe73155331c",
            "to": "0xc061eac146de563a7ceff22c61ab81881572e5df",
            "value": "300000000000000000",
            "gasPrice": "61000000000",
            "gas": "21000",
            "input": "0x"
        },
        {
            "hash": "0x850d855e25ab6cf2bbc5135b1fc612aaf71d32b4ace12775183ba15954e04e17",
            "nonce": "291899",
            "blockHash": "0x05ad4613a4e8531e460b3100478f78d8e3622d26a39e20f6661f6412c06e94eb",
            "blockNumber": "7109024",
            "transactionIndex": "2",
            "from": "0xb01cb49fe0d6d6e47edf3a072d15dfe73155331c",
            "to": "0x4e30ca1cdef42e693ab9b38942f3ff6d8020e8af",
            "value": "400000000000000000",
            "gasPrice": "61000000000",
            "gas": "21000",
            "input": "0x"
        }
    ]
}
Info

Pending Transactions Endpoint makes a call to the EVM and returns all pending transactions. The response might be limited if you lack credits.

HTTP Request

GET /v1/bc/eth/${NETWORK}/txs/pending

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)

The returned object contains detailed information about the pending transactions.

Queued Transactions Endpoint

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/queued \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/mainnet/txs/queued HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/queued",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "mainnet",
    "txs",
    "queued"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/queued');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/queued")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,mainnet,txs,queued", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/queued")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/mainnet/txs/queued"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response Body

{
    "count": 78,
    "queued_txs": [
        {
            "hash": "0x8610e97e9c0adad27b9bd3f18fd8b31c5c7247b622f30a242b0e01d7a9b5cbf2",
            "nonce": "17",
            "blockHash": "0x615d8c719830f9b49f5ea2529c17cb5f6c45e15a580a045421031b7799379c1c",
            "blockNumber": "7109297",
            "transactionIndex": "0",
            "from": "0x2af863e7a81b3a787962fc4fdd8c1db6b584c3e3",
            "to": "0x6fe23cd5fd723906e555b7f6f17fcc79faa960d9",
            "value": "0",
            "gasPrice": "82000000000",
            "gas": "60000",
            "input": "0xa9059cbb0000000000000000000000004ab318a97dea7f95091780f3bfcd3f075d012a3200000000000000000000000000000000000000000000006140c056fb0ac80000"
        },
        ...
        {
            "hash": "0x8d23ecf5dbce75525869421480bbe9031b455aa25abf92bdef4c0bb28b6b4aec",
            "nonce": "498724",
            "blockHash": "0x615d8c719830f9b49f5ea2529c17cb5f6c45e15a580a045421031b7799379c1c",
            "blockNumber": "7109297",
            "transactionIndex": "1",
            "from": "0x73957709695e73fd175582105c44743cf0fb6f2f",
            "to": "0xadae38df1360f9656dfb98848ef04efd03fec2fe",
            "value": "7470978010000000000",
            "gasPrice": "76000000000",
            "gas": "90000",
            "input": "0x"
        },
        {
            "hash": "0x50c55b13d5be16e08f8b8c24e32eb84d36c741c484678962937ee8f658833c53",
            "nonce": "203197",
            "blockHash": "0x615d8c719830f9b49f5ea2529c17cb5f6c45e15a580a045421031b7799379c1c",
            "blockNumber": "7109297",
            "transactionIndex": "2",
            "from": "0x5e032243d507c743b061ef021e2ec7fcc6d3ab89",
            "to": "0x60a7ffe99305988ad5a41f1134c5cb1fd67fdad9",
            "value": "24871474890000000000",
            "gasPrice": "61000000000",
            "gas": "45000",
            "input": "0x"
        }
    ]
}
Info

Queued Transactions Endpoint makes a call to the EVM and returns all queued transactions. The response might be limited if you lack credits.

HTTP Request

GET /v1/bc/eth/${NETWORK}/txs/queued

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)

The returned object contains detailed information about the queued transactions.

Contract API

Compared to other blockchains, contracts lie at the heart of Ethereum’s unique value proposition. Contracts can be expressively programmed in languages like Solidity; if you’re not familiar with Ethereum’s contract language you should definitely start there.

We offer a number of API endpoints that significantly simplify contract creation and method calling. Via the methods below, you can embed new contracts into the Ethereum blockchain, check their code and ABI, and initiate contract methods and execution. Essentially, we provide a JSON/HTTP binding for your Ethereum contracts.

With great power comes great responsibility; in other words, it’s easier to shoot yourself in the foot with Ethereum. Don’t The DAO it. Follow best security and safety practices when coding your smart contracts.

Estimate Gas Smart Contract Endpoint

This endpoint retuns the average gas price and gas limit set by the Ethereum Blockchain. At this point for all kinds of deployments the json result will be as follows:

{ "gas_price": 22000000000, "gas_limit": 4300000 }

The actual amount will be known after the deployment is complete.

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts/gas \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/rinkeby/contracts/gas HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts/gas",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [ "https://api.cryptoapis.io:" ],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "contracts",
    "gas"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts/gas');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts/gas")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,rinkeby,contracts,gas", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts/gas")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts/gas"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
  "gas_price": 22000000000,
  "gas_limit": 4300000
}
HTTP Request

GET /v1/bc/eth/${NETWORK}/contracts/gas

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)
Deploy Smart Contract Endpoint

The Deploy Smart Contract Endpoint allows you to push your smart contract to the Ethereum Blockchain. You have to provide the bytecode - compiled to binary solidity code. At this point you can validate and compile your smart contract to bytecode at the Ethereum official website - Solidity IDE. When you finish the solidity code go to Compile -> Choose the name of the contract -> Details and from there go to the part BYTECODE and copy the object propery. It should only be a hexadecimal number, for example:

"object":"60806040523480156200001157600080fd5b50336000................"

A private key (associated with a funded Ethereum external account), fromAddress, byteCode, gasPrice and gasLimit, to publish, Crypto APIs will embed the contract into the blockchain and return the transaction hash that created the contract, for example

{ "privateKey" : "4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1", "fromAddress" : "0xe7cc96ba0562dfba61a55c8dd2e162a30942f402", "gasPrice" : 21000000000, "gasLimit" : 2100000, "byteCode": "0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b5400000000000000000000000000000000000000000000000000000000815250600290805190602001906200009f92919062000128565b506040805190810160405280600d81526020017f6d616166616b6120546f6b656e0000000000000000000000000000000000000081525060039080519060200190620000ed92919062000128565b506012600460006101000a81548160ff021916908360ff16021790555062093a804201600781905550624099804201600881905550620001d7565b828054600181600116 .... ffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029" }

The response will be date and hash of the transaction:

{ "date": "2018-07-20 12:41:39.703", "tx_hash": "0xf24889df3b88f8bfe2898a41ecab8ec62b60839a22eec606afe3dff9025b86f6" }

It is very important to provide enough gas in order the transaction to be successful!

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "privateKey" : "4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1",
        "fromAddress" : "0xe7cc96ba0562dfba61a55c8dd2e162a30942f402",
        "gasPrice" : 21000000000,
        "gasLimit" : 2100000,
        "byteCode": "0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029"
    }'


POST /v1/bc/eth/rinkeby/contracts HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  
  "privateKey" : "4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1",
  "fromAddress" : "0xe7cc96ba0562dfba61a55c8dd2e162a30942f402",
  "gasPrice" : 21000000000,
  "gasLimit" : 2100000,
  "byteCode": "0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029"
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\n\t\"privateKey\" : \"4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1\",\n\t\"fromAddress\" : \"0xe7cc96ba0562dfba61a55c8dd2e162a30942f402\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 2100000,\n\t\"byteCode\": \"0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029\"\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [https://api.cryptoapis.io],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "contracts"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ privateKey: '4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1',
  fromAddress: '0xe7cc96ba0562dfba61a55c8dd2e162a30942f402',
  gasPrice: 21000000000,
  gasLimit: 2100000,
  byteCode: '0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029' }));
req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  
  "privateKey" : "4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1",
  "fromAddress" : "0xe7cc96ba0562dfba61a55c8dd2e162a30942f402",
  "gasPrice" : 21000000000,
  "gasLimit" : 2100000,
  "byteCode": "0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029"
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\n\t\"privateKey\" : \"4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1\",\n\t\"fromAddress\" : \"0xe7cc96ba0562dfba61a55c8dd2e162a30942f402\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 2100000,\n\t\"byteCode\": \"0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029\"\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\n\t\"privateKey\" : \"4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1\",\n\t\"fromAddress\" : \"0xe7cc96ba0562dfba61a55c8dd2e162a30942f402\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 2100000,\n\t\"byteCode\": \"0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029\"\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,rinkeby,contracts", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\n\t\"privateKey\" : \"4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1\",\n\t\"fromAddress\" : \"0xe7cc96ba0562dfba61a55c8dd2e162a30942f402\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 2100000,\n\t\"byteCode\": \"0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029\"\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/contracts"

  payload := strings.NewReader("{\n\t\n\t\"privateKey\" : \"4f75aff19dd7acbf7c4d5d6f736176a3fe2db1ec9b60cc11d30dc3c343520ed1\",\n\t\"fromAddress\" : \"0xe7cc96ba0562dfba61a55c8dd2e162a30942f402\",\n\t\"gasPrice\" : 21000000000,\n\t\"gasLimit\" : 2100000,\n\t\"byteCode\": \"0x60806040523480156200001157600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040805190810160405280600481526020017f4d464b54000000000000000000000000000000000000000000000000000000008fffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373fffff...ffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561170957600080fd5b8183039050929150505600a165627a7a72305820d5c331e320cecd2d4312d2652403d5e25028a60929540b4a8ededb52575622a40029\"\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
    "timestamp": "2018-07-20 12:41:39.703",
    "tx_hash": "0xf24889df3b88f8bfe2898a41ecab8ec62b60839a22eec606afe3dff9025b86f6"
}
HTTP Request

POST /v1/bc/eth/${NETWORK}/contracts

Query Parameters
Parameter Default Description
NETWORK - Network name (e.g. ropsten, rinkeby or mainnet)

Token API

Crypto APIs Token API allows you to get token balances of adressess, as well as to transfer tokens from one address to another.

Get Token Balance

In the request url you should provide the address you want to observe and the contract address that created the token. After sending the request you will receive a json object with the name of the token, the amount and its symbol.

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/0xe7d553c3aab5943ec097d60535fd06f1b75db43e/balance \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/rinkeby/tokens/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/0xe7d553c3aab5943ec097d60535fd06f1b75db43e/balance HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/0xe7d553c3aab5943ec097d60535fd06f1b75db43e/balance",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "token",
    "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
    "0xe7d553c3aab5943ec097d60535fd06f1b75db43e",
    "balance"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/0xe7d553c3aab5943ec097d60535fd06f1b75db43e/balance');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/0xe7d553c3aab5943ec097d60535fd06f1b75db43e/balance")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,rinkeby,token,0x0cb1883c01377f45ee5d7448a32b5ac1709afc11,0xe7d553c3aab5943ec097d60535fd06f1b75db43e,balance", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/0xe7d553c3aab5943ec097d60535fd06f1b75db43e/balance")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/0x0cb1883c01377f45ee5d7448a32b5ac1709afc11/0xe7d553c3aab5943ec097d60535fd06f1b75db43e/balance"

  req, _ := http.NewRequest("GET", url, nil)

  res, _ := http.DefaultClient.Do(req)
  
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
    "name": "maaf Token",
    "token": 3743.999999999998765978,
    "symbol": "MFKT"
}
HTTP Request

GET /v1/bc/eth/${NETWORK}/tokens/{address}/{contract}/balance

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)
ADDRESS ------- address with tokens (e.g. "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11")
CONTRACT ------- contract address (e.g. "0xe7d553c3aab5943ec097d60535fd06f1b75db43e")
Transfer Tokens

In order to transfer tokens from one address to another you should provide the from address, the private key or password (if it is an account stored on our servers), the to address, the contract adress that created the tokens and the amount of tokens you would like to transfer. It is also necessary to provide gas price and gas limit. By default these are set to: 21000000000 wei and 60000 wei, accordingly. The amount of token is per unit, for example: if you want to send 120 tokens you should specify:

"token" : 120;

and for 10.5 tokens:

"token" : 10.5,

etc...;

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/transfer \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "fromAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
        "contract" : "0xe7d553c3aab5943ec097d60535fd06f1b75db43e",
        "password": "abc123456" or "privateKey" : "0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed",
        "gasPrice" : 11500000000,
        "gasLimit" : 60000,
        "token" : 115
    }'

POST /v1/bc/eth/rinkeby/tokens/transfer HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "contract" : "0xe7d553c3aab5943ec097d60535fd06f1b75db43e",
  "password": "abc123456" or "privateKey" : "0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed",
  "gasPrice" : 11500000000,
  "gasLimit" : 60000,
  "token" : 115
}


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/transfer",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n\t\"fromAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"contract\" : \"0xe7d553c3aab5943ec097d60535fd06f1b75db43e\",\n\t \"password\": \"abc123456\" or \n\t\"privateKey\" : \"0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed\",\n\t\"gasPrice\" : 11500000000,\n\t\"gasLimit\" : 60000,\n\t\"token\" : 115\n}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "token",
    "transfer"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ fromAddress: '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11',
  toAddress: '0x0cb1883c01377f45ee5d7448a32b5ac1709afc11',
  contract: '0xe7d553c3aab5943ec097d60535fd06f1b75db43e',
  password: 'abc123456' or privateKey: '0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed',
  gasPrice: 11500000000,
  gasLimit: 60000,
  token: 115 }));
req.end();

<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/transfer');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

$request->setBody('{
  "fromAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "toAddress" : "0x0cb1883c01377f45ee5d7448a32b5ac1709afc11",
  "contract" : "0xe7d553c3aab5943ec097d60535fd06f1b75db43e",
  "password" : "abc123456" or "privateKey" : "0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed",
  "gasPrice" : 11500000000,
  "gasLimit" : 60000,
  "token" : 115
}');

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/transfer")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'
request.body = "{\n\t\"fromAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"contract\" : \"0xe7d553c3aab5943ec097d60535fd06f1b75db43e\",\n\t \"password\": \"abc123456\" or \n\t\"privateKey\" : \"0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed\",\n\t\"gasPrice\" : 11500000000,\n\t\"gasLimit\" : 60000,\n\t\"token\" : 115\n}"

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

payload = "{\n\t\"fromAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"contract\" : \"0xe7d553c3aab5943ec097d60535fd06f1b75db43e\",\n\t \"password\": \"abc123456\" or \n\t\"privateKey\" : \"0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed\",\n\t\"gasPrice\" : 11500000000,\n\t\"gasLimit\" : 60000,\n\t\"token\" : 115\n}"

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("POST", "v1,bc,eth,rinkeby,token,transfer", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n\t\"fromAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"contract\" : \"0xe7d553c3aab5943ec097d60535fd06f1b75db43e\",\n\t \"password\": \"abc123456\" or \n\t\"privateKey\" : \"0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed\",\n\t\"gasPrice\" : 11500000000,\n\t\"gasLimit\" : 60000,\n\t\"token\" : 115\n}");
Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/transfer")
  .post(body)
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/transfer"

  payload := strings.NewReader("{\n\t\"fromAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"toAddress\" : \"0x0cb1883c01377f45ee5d7448a32b5ac1709afc11\",\n\t\"contract\" : \"0xe7d553c3aab5943ec097d60535fd06f1b75db43e\",\n\t \"password\": \"abc123456\" or \n\t\"privateKey\" : \"0xeb38783ad75d8081fb9105baee6ac9413c4abd732ef889116714f271cde6aed\",\n\t\"gasPrice\" : 11500000000,\n\t\"gasLimit\" : 60000,\n\t\"token\" : 115\n}")

  req, _ := http.NewRequest("POST", url, payload)

  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
  "timestamp": "2018-08-10 16:52:52.427",
  "tx_hash": "0xeca1b4ad7b3df4fb65b0e3c1e079f2f6878bd5bd6185fe23319f7dec6a2fc203"
}
HTTP Request

POST /v1/bc/eth/${NETWORK}/tokens/transfer

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)
Get Address Token Transfers

In the request url you should provide the address you want to observe. After sending the request you will receive a json object with a list of each transfer for the specified address that includes the following infromation: the contract, the name, symbol and type of the token.

Code samples


curl -X GET https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/address/0x2b5634c42055806a59e9107ed44d43c426e58258 \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'


GET /v1/bc/eth/rinkeby/tokens/address/0x2b5634c42055806a59e9107ed44d43c426e58258 HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key


var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/address/0x2b5634c42055806a59e9107ed44d43c426e58258",
  "method": "GET",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "GET",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "token",
    "address",
    "0x2b5634c42055806a59e9107ed44d43c426e58258"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();


<?php

$request = new HttpRequest();
$request->setUrl('https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/address/0x2b5634c42055806a59e9107ed44d43c426e58258');
$request->setMethod(HTTP_METH_GET);

$request->setHeaders(array(
  'Content-Type' => 'application/json',
  'X-API-Key' => 'my-api-key'
));

try {
  $response = $request->send();

  echo $response->getBody();
} catch (HttpException $ex) {
  echo $ex;
}
?>


require 'uri'
require 'net/http'

url = URI("https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/address/0x2b5634c42055806a59e9107ed44d43c426e58258")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request["X-API-Key"] = 'my-api-key'

response = http.request(request)
puts response.read_body


import http.client

conn = http.client.HTTPConnection("https://api.cryptoapis.io")

headers = {
  'Content-Type': "application/json",
  'X-API-Key': "my-api-key"
}

conn.request("GET", "v1,bc,eth,rinkeby,token,address,0x2b5634c42055806a59e9107ed44d43c426e58258", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))


OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/address/0x2b5634c42055806a59e9107ed44d43c426e58258")
  .get()
  .addHeader("Content-Type", "application/json")
  .addHeader("X-API-Key", "my-api-key")
  .build();

Response response = client.newCall(request).execute();


package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://api.cryptoapis.io/v1/bc/eth/rinkeby/tokens/address/0x2b5634c42055806a59e9107ed44d43c426e58258"

  req, _ := http.NewRequest("GET", url, nil)

  res, _ := http.DefaultClient.Do(req)
  
  req.Header.Add("Content-Type", "application/json")
  req.Header.Add("X-API-Key", "my-api-key")

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}

Response body

{
    "tokens": [
        {
            "contract": "0xd26114cd6ee289accf82350c8d8487fedb8a0c07",
            "symbol": "OMG",
            "name": "OMGToken",
            "type": "ERC-20"
        },
        {
            "contract": "0x5c3a228510d246b78a3765c20221cbf3082b44a4",
            "symbol": "STQ",
            "name": "Storiqa Token",
            "type": "ERC-20"
        },
        {
            "contract": "0xb97048628db6b661d4c2aa833e95dbe1a905b280",
            "symbol": "PAY",
            "name": "TenX Pay Token",
            "type": "ERC-20"
        },
        {
            "contract": "0x4dc3643dbc642b72c158e7f3d2ff232df61cb6ce",
            "symbol": "AMB",
            "name": "Amber Token",
            "type": "ERC-20"
        },
        {
            "contract": "0x4e15361fd6b4bb609fa63c81a2be19d873717870",
            "symbol": "FTM",
            "name": "Fantom Token",
            "type": "ERC-20"
        },
        {
            "contract": "0x26db5439f651caf491a87d48799da81f191bdb6b",
            "symbol": "CBC",
            "name": "CashBetCoin",
            "type": "ERC-20"
        },
        {
            "contract": "0x41e5560054824ea6b0732e656e3ad64e20e94e45",
            "symbol": "CVC",
            "name": "Civic",
            "type": "ERC-20"
        },
        {
            "contract": "0x9a0242b7a33dacbe40edb927834f96eb39f8fbcb",
            "symbol": "BAX",
            "name": "BAX",
            "type": "ERC-20"
        },
        {
            "contract": "0x4270bb238f6dd8b1c3ca01f96ca65b2647c06d3c",
            "symbol": "FOTA",
            "name": "FOTA",
            "type": "ERC-20"
        },
        {
            "contract": "0xb31c219959e06f9afbeb36b388a4bad13e802725",
            "symbol": "b31c219959e06f9afbeb36b388a4bad13e802725",
            "name": "ONOT",
            "type": "ERC-20"
        },
        {
            "contract": "0x905e337c6c8645263d3521205aa37bf4d034e745",
            "symbol": "MTC",
            "name": "Medical Token Currency",
            "type": "ERC-20"
        }
    ]
}
HTTP Request

GET /v1/bc/eth/${NETWORK}/tokens/address/{address}

Query Parameters
Parameter Default Description
NETWORK ------- Network name (e.g. ropsten, rinkeby or mainnet)
ADDRESS ------- address with tokens (e.g. "0x2b5634c42055806a59e9107ed44d43c426e58258")

Payment 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 Payment 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:

A way to generate payment-specific addresses for which funds will automatically transfer to a main merchant address. Great for automatic merchandise (whether physical or virtual) processing. A method to easily fund a multisignature address from any wallet by providing a classic address that will automatically transfer to the multisignature/pay-to-script-hash address. We do not take a fee on payment forwarding, other than the required 21,000 units of wei for gas fee; payments 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 Payment Forwarding

Code samples


curl -X POST https://api.cryptoapis.io/v1/bc/eth/rinkeby/payments \
    -H 'Content-Type: application/json' \
    -H 'X-API-Key: my-api-key'
    -d '{
        "fromAddress" : "0x195831d0fa4888c3fd577110d23ee464265c551a",
        "toAddress" : "0x12b1883c01377f45ee5d7448a32b5ac1709af076",
        "callBack" : "http://somepoint.point",
        "password": "123456" or "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
    }'

POST /v1/bc/eth/rinkeby/payments HTTP/1.1
Host: api.cryptoapis.io
Content-Type: application/json
X-API-Key: my-api-key

{
  "fromAddress" : "0x195831d0fa4888c3fd577110d23ee464265c551a",
  "toAddress" : "0x12b1883c01377f45ee5d7448a32b5ac1709af076",
   "callBack" : "http://somepoint.point",
  "password": "123456" or "privateKey" : "0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e"
}



var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://api.cryptoapis.io/v1/bc/eth/rinkeby/payments",
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  },
  "processData": false,
  "data": "{\n  \"fromAddress\" : \"0x195831d0fa4888c3fd577110d23ee464265c551a\",\n  \"toAddress\" : \"0x12b1883c01377f45ee5d7448a32b5ac1709af076\", \n\t \"callBack\" : \"http://somepoint.point\", \n\t\"password\": \"123456\" or \n\t\"privateKey\" : \"0x17de216dff24b36c35af535c7d4d9d36f57326f3ee8aaf7fd373715c27a15b7e\"\n}\n"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});


var http = require("http");

var options = {
  "method": "POST",
  "hostname": [
    "https://api.cryptoapis.io"
  ],
  "path": [
    "v1",
    "bc",
    "eth",
    "rinkeby",
    "payments"
  ],
  "headers": {
    "Content-Type": "application/json",
    "X-API-Key": "my-api-key"
  }
};