bit4you API Docs (v1.0.0)

Download OpenAPI specification:Download

bit4you provides restricted api's to the developpers. This API is documented in OpenAPI format and use the ReDoc template.

Security

Every API call has to be done using SSL. Calls who are not done using https will be ignored. Api's containg a security issue will been patched on all the versions of our api's (including the old versions). This can impact your code and generate some compatibility issues. However we will try to made the older versions also compatibly during this updates.

Access Point

bit4you API's can be accessed using HTTPS calls starting with https://www.bit4you.io/api/. Or by using WebSockets with the SockJS library using the following endpoint: https://www.bit4you.io/socketapi. When using WebSockets a json object is sent to the server containing the api name and the post data.

NodeJS Library

We currently only release an official NodeJs package on NPM under the name @chainius/bit4you-client https://www.npmjs.com/package/@chainius/bit4you-client

This client can be used to access our api's. Additional libraries will be released for GoLang and Python.

Websockets

bit4you offers the possibility of streaming services through websocket technology. You may use our websocket service to:

  • Call regular api in through a websocket
  • Get live orderbook, history and summary updates

Our websockets api's are created on top of sockjs, and communicates with json data. Most of calls done though websockets support and extra salt data attribute, which will be returned with the response to identify each request. For instance if you call a market/list api, and provide a salt with value "1", the websocket will return a response container salt "1" to identify your original request.

Authentication

bit4you offers the possibility to authenticate through the openid standards. Two authentification flows are possible:

  • using api key's
  • standard authentification using bit4you.io

OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. It's recommended for API keys to restrict the access to a limited set of IP addresses on the security settings of your account. Currently restricting permissions and IP accessing of an API key requires contacting the support team of bit4you at support@bit4you.io

oauth2

Get access to data while protecting your account credentials. OAuth2 is also a safer and more secure way to give you access.

Security Scheme Type OAuth2
authorizationCode OAuth Flow
Authorization URL: https://auth.bit4you.io/
Token URL: https://auth.bit4you.io/token
Scopes:
  • openid -

    Get basic openid connection informations

  • wallets:read -

    Get a list of the crypto asset wallets and their balances

  • wallets:write -

    Create a transaction from your crypto asset balance

  • portfolio:read -

    View all the open orders/portfolio/history

  • portfolio:write -

    Create or cancel orders

openid

All api's that requires data linked to your account require an authentification token. This token could be generated through our openid servers.

The first step to connect to our api's will be to get a token through the openid token endpoint. Once you got the token, you will need to put it in the "Authorization" header of each api call. For instance "Authorization: Bearer sample_token"

Token

Authenticate using your api keys and get an access token. The grant_type parameter has to be set to 'password' if you want to authenticate using api keys. The username field will be your api key and the password field, your secret key.

Request Body schema: application/json
grant_type
string
scope
string
username
string
password
string

Responses

Request samples

Content type
application/json
{
  • "grant_type": "password",
  • "scope": "openid,wallets:read,portfolio:read",
  • "username": "api_key_example",
  • "password": "api_secret_example"
}

UserInfo

Get all the personal informations your account. This will retuns your personal informations in the common openid format

path Parameters
scope
required
string

Comma separated array of requested scopes

Responses

markets

All market data's are publicly available and doesn't need any authentification token. Those api's provides informations about the markets available on bit4you such as their names, values, ...

Market List

Get a list of all the available markets

Responses

Response samples

Content type
application/json
{
  • "iso": "UDST-BTC",
  • "name": "Bitcoin",
  • "precision": 2,
  • "value": 6455.24,
  • "change": 1.24,
  • "spread": 0.6,
  • "category": "Crypto"
}

Market Summaries

Get the summaries of all the markets

Responses

Response samples

Content type
application/json
{
  • "market": "USDT-BTC",
  • "marketCap": 104903502392,
  • "high": 7690.52,
  • "low": 7650.21,
  • "volume": 211007403.75525382,
  • "last": 7633.51,
  • "prevDay": 7576.01,
  • "bid": 7556.64,
  • "ask": 7710.86,
  • "open": 7534.53
}

Market Ticks

Get markets ticks for a given market, the interval value is a number representing how many seconds are elapsed in each tick. For intance if you want ticks per minute, you will provide the interval 60 (60 seconds = 1 minute), 5 min = 300, ... The supported intervals are: minute, five muntes, quarter, 30 minutes, hour, 4 hours, 12 hours, day

Request Body schema: application/json
market
string
interval
number

Responses

Request samples

Content type
application/json
{
  • "market": "USDT-BTC",
  • "interval": 60
}

Market Order Book

The market orderbook api will return the bids and the asks for a given market. You can ask a depth up to 50 items per side (bid/ask). An extra state argument can be provided in order to get the state id and follow up every update of the orderbook live.

Request Body schema: application/json
market
string
limit
number
Default: 10
state
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "market": "USDT-BTC",
  • "limit": 50,
  • "state": false
}

Market History

Get markets history for a given market. You can listen live for new history updates through the websockets. If any state is missing, you can require the missing states by specifing the from and to attributes in your market history api call. The from attribute would be the id of the last item you got. You can also limit the number of received items by specifying the id from the last state of what you received in the websocket in the to parameter. This will let you request only the states that are missing between your cache and the new received history items.

Request Body schema: application/json
market
string
limit
number
Default: 20
from
string
to
string

Responses

Request samples

Content type
application/json
{
  • "market": "USDT-BTC",
  • "limit": 50,
  • "from": "string",
  • "to": "string"
}

wallet

Access to the multiple wallets and generated transactions

Wallets Balances