CryptAPI.io - Payment API Documentation (v2.0)

CryptAPI.io is a cryptocurrency payment API.

It is designed with the intent to allow you to integrate multiple coin payments in your service with the least effort possible.

There are no sign-ups, lengthy implementations or API keys required, it is as easy as a simple CURL request to create a new payment address.

The only thing required is that you implement the logic on your server to handle the callbacks sent to your server when the transaction from the client is confirmed.

For the documentation on CryptAPI Pro click here.

Bitcoin

API endpoint to receive payments in Bitcoin.

Check coin information

This endpoint is used to check the information for Bitcoin.

Request
query Parameters
prices
integer

If you want to receive also the coin prices, set to 0 to disable the prices (default: 1)

Responses
200

Info fetched successfully

Response Schema: application/json
coin
string

Human readable name of the currency

minimum_transaction
integer

Minimum transaction value for this currency, values below this value are disregarded

minimum_fee
integer

CryptAPI's minimum fee for this currency, in atomic units

fee_percent
number

Fee percentage for this currency

prices_updated
string

Datetime of the last price update

status
string

Status

prices
object

Object with the exchange rate of this currency in various FIAT currencies.

Keys are the names of the currencies, values are the exchange rates.

updated every 5min.

400

Error fetching info

get/btc/info/
Request samples
import requests

url = "https://api.cryptapi.io/btc/info/"

query = {
  "prices": "0"
}

response = requests.get(url, params=query)

data = response.json()
print(data)
Response samples
application/json
{
  • "coin": "Bitcoin",
  • "minimum_transaction": "20000",
  • "minimum_fee": "200",
  • "fee_percent": "1.00",
  • "prices_updated": "2019-10-14T13:00:09.585Z",
  • "status": "success",
  • "prices": "{'DKK': '56281.94', 'CAD': '10985.14', 'AED': '30517.01', 'BRL': '34243.36', 'USD': '8308.47', 'MXN': '160193.26', 'CNY': '58740.88', 'INR': '591471.72', 'JPY': '899719.16', 'HKD': '65173.93', 'GBP': '6616.08', 'EUR': '7535.35'}"
}

Create new address

This method is used to generate a new Bitcoin address to give your clients, where they can send payments.

This service's minimum value can be checked on the pricing page, any values below that will be ignored.

Fee is calculated as follows:  max(min_fee, 0.01 * amount)

Which means that the fee is 1% or the minimum fee, whichever is greater.

Notice: The length of this request can't surpass the 8192 characters!

Request
query Parameters
callback
required
string

The URL the callbacks will be sent to. Must be a valid URL.

Attention:

- The callback URL should be unique. Duplicated callback URLs will return the same address_in. You can make your callback URL unique by adding GET parameters, like: ?user_id=1234

- The callback URL needs to be urlencoded, otherwise the GET parameters you add may be lost.

address
required
string

Address or addresses where the payment will be forwarded to.

In case of multiple addresses, it should be in the following format: <percentage_1>@<address_1>|<percentage_2>@<address_2> and so on.

Percentages are set from 0.0001 (0.01%) to 1.0 (100%) and must add up to 1.00 (100%).

Addresses must be valid.

Note: For multiple addresses the minimum value per transaction (see pricing page) is multiplied by the following formula: 1 + (N - 1) / 3, where N is the number of output addresses. Be aware that, if you proceed with a transaction lower to the minimum, CryptAPI will ignore the transaction.

pending
integer

Set this to 1 if you want to be notified of pending transactions (before they're confirmed) (default: False)

confirmations
integer

Number of confirmations you want before receiving the callback (Min. 1) (default: 1)

email
string

E-mail address to receive payment notifications

Note: before getting e-mail payment notifications, you must confirm your e-mail address here.

post
integer

Set this to 1 if you wish to receive the callback as a POST request (default: GET)

priority
string

Set confirmation priority, needs to be one of ['fast', 'default', 'economic', 'x-economic', 'xx-economic', 'xxx-economic', 'xxxx-economic', 'xxxxx-economic']

Attention: this will impact network fees!

These represent confirmation targets, which means it's calculated based on current network fees to be confirmed within X number of blocks, number of blocks for each are:

Enum: Description
fast

10

default

25

economic

75

x-economic

125

xx-economic

200

xxx-economic

300

xxxx-economic

500

xxxxx-economic

1000

Responses
200

Address was created

Response Schema: application/json
address_in
string

Generated Address, give this to your client

address_out
string

Your address(es), where the payment will be forwarded to, should be the same address(es) you provided.

callback_url
string

The callback URL you provided

priority
string

The confirmation priority you requested

status
string

Status

400

Error creating address

get/btc/create/
Request samples
import requests

url = "https://api.cryptapi.io/btc/create/"

query = {
  "callback": "string",
  "address": "string",
  "pending": "0",
  "confirmations": "0",
  "email": "string",
  "post": "0",
  "priority": "fast"
}

response = requests.get(url, params=query)

data = response.json()
print(data)
Response samples
application/json
{
  • "address_in": "14PqCsA7KMgseZMPwg6mJy754MtQkrgszu",
  • "address_out": "1H6ZZpRmMnrw8ytepV3BYwMjYYnEkWDqVP (single address) {1H6ZZpRmMnrw8ytepV3BYwMjYYnEkWDqVP: 0.70, 1PE5U4temq1rFzseHHGE2L8smwHCyRbkx3: 0.30} (multiple addresses)",
  • "callback_url": "example.com/invoice/1234?payment_id=5678",
  • "priority": "default",
  • "status": "success"
}

Generate QR Code

This method generates a base64-encoded image for payments

Request
query Parameters
address
required
string

The payment address (address_in from our system)

value
integer

Value to request the user, in the main coin (BTC, ETH, etc). Optional.

Note: Some user wallets don't support this, only the address. Use at your own discretion.

size
integer

Size of the QR Code image in pixels. Min: 64 Max: 1024 Default: 512

Responses
200

The QR Code

Response Schema: application/json
status
string

Status

qr_code
string

Base64-encoded image of the QR Code. Use it like this: <img src='data:image/png;base64,{qr_code}' alt='Payment QR Code'/>

payment_uri
string

Payment URI, useful if you want to make a clickable payment button.

get/btc/qrcode/
Request samples
import requests

url = "https://api.cryptapi.io/btc/qrcode/"

query = {
  "address": "string",
  "value": "0",
  "size": "0"
}

response = requests.get(url, params=query)

data = response.json()
print(data)
Response samples
application/json
{
  • "status": "success",
  • "qr_code": "...",
  • "payment_uri": "..."
}

Estimate Blockchain Fees

This method allows you to estimate blockchain fees to process a transaction.

Attention: This is an estimation only, and might change significantly when the transaction is processed. CryptAPI is not responsible if blockchain fees when forwarding the funds differ from this estimation.

Note: These not include CryptAPI's fees.

Request
query Parameters
addresses
integer

The number of addresses to forward the funds to. Default: 1

priority
string

Confirmation priority, needs to be one of ['fast', 'default', 'economic', 'x-economic', 'xx-economic', 'xxx-economic', 'xxxx-economic', 'xxxxx-economic']

These represent confirmation targets, which means it's calculated based on current network fees to be confirmed within X number of blocks, number of blocks for each are:

Enum: Description
fast

10

default

25

economic

75

x-economic

125

xx-economic

200

xxx-economic

300

xxxx-economic

500

xxxxx-economic

1000

Responses
200

Estimated cost

Response Schema: application/json
status
string

Status

estimated_cost
integer

Estimated cost in the coin

estimated_cost_currency
object

Object with the estimated cost in various FIAT currencies.

Keys are the names of the currencies, values are the estimated costs.

400

Your request couldn't be processed, please try again later

get/btc/estimate/
Request samples
import requests

url = "https://api.cryptapi.io/btc/estimate/"

query = {
  "addresses": "0",
  "priority": "fast"
}

response = requests.get(url, params=query)

data = response.json()
print(data)
Response samples
application/json
{
  • "status": "success",
  • "estimated_cost": "0.00001",
  • "estimated_cost_currency": "{'USD': '0.09', 'EUR': '0.08', 'GBP': '0.07', 'CAD': '0.11', 'JPY': '10.21', 'AED': '0.33', 'DKK': '0.58', 'BRL': '0.46', 'CNY': '0.56', 'HKD': '0.69', 'INR': '6.67', 'MXN': '1.81', 'UGX': '310.74', 'PLN': '0.35', 'PHP': '4.56', 'CZK': '1.91', 'HUF': '27.95', 'BGN': '0.15', 'RON': '0.39', 'LKR': '18.02'}"
}

Convert prices

This method allows you to easily convert prices from FIAT to Crypto or even between cryptocurrencies

Request
query Parameters
value
required
number

Value to convert

from
required
string

Currency to convert from, FIAT or crypto

Responses
200

The value converted

Response Schema: application/json
value_coin
number

The converted value

exchange_rate
number

The exchange rate between the 2 currencies

status
string

Status

400

Your request couldn't be processed, please try again later

get/btc/convert/
Request samples
import requests

url = "https://api.cryptapi.io/btc/convert/"

query = {
  "value": "0",
  "from": "string"
}

response = requests.get(url, params=query)

data = response.json()
print(data)
Response samples
application/json
{
  • "value_coin": "0.01",
  • "exchange_rate": "47000",
  • "status": "success"
}

Check payment logs

This method is used to check logs for your callback URLs.

Request
query Parameters
callback
required
string

The URL of the callback

Responses
200

List of payments sent to this callback

Response Schema: application/json
address_in
string

Generated Address, give this to your client

address_out
string

Your address(es), where the payment will be forwarded to, should be the same address(es) you provided.

callback_url
string

The callback URL you provided

status
string

Status

notify_pending
boolean

Get notified of pending transactions

notify_confirmations
integer

Number of confirmations required before sending the callback

priority
string

The confirmation priority you requested

Array of objects (log_items_btc)

List of payments made to this address

400

Your request couldn't be processed, please try again later

404

No request or no payment callbacks found

get/btc/logs/
Request samples
import requests

url = "https://api.cryptapi.io/btc/logs/"

query = {
  "callback": "string"
}

response = requests.get(url, params=query)

data = response.json()
print(data)
Response samples
application/json
{
  • "address_in": "14PqCsA7KMgseZMPwg6mJy754MtQkrgszu",
  • "address_out": "1H6ZZpRmMnrw8ytepV3BYwMjYYnEkWDqVP (single address) {1H6ZZpRmMnrw8ytepV3BYwMjYYnEkWDqVP: 0.70, 1PE5U4temq1rFzseHHGE2L8smwHCyRbkx3: 0.30} (multiple addresses)",
  • "callback_url": "example.com/invoice/1234?payment_id=5678",
  • "status": "success",
  • "notify_pending": true,
  • "notify_confirmations": 1,
  • "priority": "default",
  • "callbacks": [
    ]
}