Документація API

Before you start

The Bitcoin Global API is created for programmers who want to create applications to interface with Bitcoin Global.

Certain API endpoints can be accessed without authentication, API endpoints that have to do with user account actions almost always require authentication. A few API requests can be made without authentication, but will return more information if you send authenticated API requests.

The primary way to authenticate with our API is using HMAC. HMAC is based on a secret code that only you and Bitcoin Global knows. This secret is used to sign your API requests, to ensure that it's really you who is making the requests.

Making requests to the API

Most API requests need to be encoded with application/x-www-form-urlencoded and sent as HTTP GET or POST requests to the appropriate API endpoint. When uploading files multipart/form-data encoding is also supported. A total of three HTTP header fields are needed:

  • Apiauth-Key HMAC authentication key that you got when you created your HMAC authentication from the API settings page.
  • Apiauth-Nonce A unique number given with each API request. It's value needs to be greater with each API request.
  • Apiauth-Signature Your API request signed with your HMAC secret that you got when you create your HMAC authentication from the API settings page.

Example on python:

import json
import base64
import requests
import time
import hmac
import hashlib
#general, ads, trade endpoints
api_key = 'YOUR_API_KEY' #put here your public key
secret_key = 'YOUR_SECRET_KEY' #put here your secret key
path = '/api/v1/dashboard' #put here request path. 
getParams = 'ticker=BTC' #request params (if any)
nonce = str(int(time.time() * 1000)) #nonce is a timestamp in miliseconds
request = '/api/v1/dashboard?ticker=BTC' #put here your request with base URL
baseUrl = 'https://api.bitcoin.global'  #base URL: api.bitcoin.global
#preparing payload
completeUrl = baseUrl + request
payload = nonce + api_key + path + getParams
signature = hmac.new(secret_key.encode('utf-8'), payload.encode('utf-8'), hashlib.sha256).hexdigest().upper()
#preparing headers
headers = {
    'Content-type': 'application/x-www-form-urlencoded',
    'Apiauth-Key': api_key,
    'Apiauth-Nonce': nonce,
    'Apiauth-Signature': signature
#sending request
resp = requests.get(completeUrl, headers=headers)

#wallet endpoints
api_key = 'YOUR_API_KEY'
secret_key = 'YOUR_SECRET_KEY'
data = {'id': 435}
nonce = int(time.time())
if data:
    dumped = json.dumps(data, ensure_ascii=False)
    dumped = ''
signature = hmac.new(secret_key.encode('utf-8'),
                "{}{}".format(nonce, dumped)
                .encode('utf-8'), hashlib.sha256).hexdigest()
headers = {
    'Content-Type': 'application/json',
    'X-API-KEY': api_key,
    'X-ACCESS-SIGN': signature,
    'X-ACCESS-TIMESTAMP': str(nonce)
resp = requests.post('https://api.bitcoin.global/api/simple-wallet/wallet/transaction', 

API documentation

Here is the link to API documentation that describes all available endpoints.

Interpreting responses

Return values are UTF-8 encoded JSON with the following metadata structure, which corresponds to an API request with the message return value.

If the API request ended in an unrecoverable error, there is no data top level field. This helps against accidentally using an error message as legitimate data, creating confusing situations. Errors will also return with an appropriate HTTP error code. If the API is requested with invalid data a 400 Bad Request response is returned, but other HTTP error codes can be returned as well.

Instead there is an error field that contains an object with the fields error_code and message. The error object can contain more fields if specified on the error documentation. The error_code field is meant to be read by the application, the message field is meant to be human readable.

If you have any questions, please feel free to contact our support team.