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 send 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 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 webosckets api's are created on top of sockjs, and communicates with json data. Most of call's done though websockets supports and extra salt data attribute, which will be returned with the resopnse 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 identity your orginal request.

Authentication

bit4you offers the possibility to authenticate thourgh 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.

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

Authentification & user info endpoint

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

200

successful operation

401

successful operation

post /token

OpenId Server

https://auth.bit4you.io/token

Request samples

application/json
Copy
Expand all Collapse all
{
  • "grant_type": "password",
  • "scope": "openid,wallets:read,portfolio:read",
  • "username": "api_key_example",
  • "password": "api_secret_example"
}

UserInfo

Get the user informations

path Parameters
scope
required
string

Comma separated array of requested scopes

Responses

default

Default response

get /userinfo

OpenId Server

https://auth.bit4you.io/userinfo

markets

List of markets available on bit4you

Market List

Get a list of all the available markets

Responses

200

successful operation

get /market/list

Exchange Server

https://www.bit4you.io/api/market/list

Response samples

application/json
Copy
Expand all Collapse all
{
  • "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

200

successful operation

get /market/summaries

Exchange Server

https://www.bit4you.io/api/market/summaries

Response samples

application/json
Copy
Expand all Collapse all
{
  • "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 elapesd 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

200

successful operation

post /market/ticks

Exchange Server

https://www.bit4you.io/api/market/ticks

Request samples

application/json
Copy
Expand all Collapse all
{
  • "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

200

successful operation

post /market/orderbook

Exchange Server

https://www.bit4you.io/api/market/orderbook

Request samples

application/json
Copy
Expand all Collapse all
{
  • "market": "USDT-BTC",
  • "limit": 50,
  • "state": false
}

Market History

Get markets history for a given market. You can listen live for new history updates throught 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 specing the id from the last state your 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 receive history items.

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

Responses

200

successful operation

post /market/history

Exchange Server

https://www.bit4you.io/api/market/history

Request samples

application/json
Copy
Expand all Collapse all
{
  • "market": "USDT-BTC",
  • "limit": 50,
  • "from": "string",
  • "to": "string"
}

wallet

Access to the multiple wallets and generated transactions

Wallets Balances

Get a list of all wallets and their balances (add simulation paramater in post to get balances of simulation orders)

Authorizations:
oauth2 (wallets:read)
Request Body schema: application/json
simulation
boolean
Default: false

Responses

200

successful operation

post /wallet/balances

Exchange Server

https://www.bit4you.io/api/wallet/balances

Request samples

application/json
Copy
Expand all Collapse all
{
  • "simulation": true
}

Wallet Transactions

Get all the transactions of a given wallet

Authorizations:
oauth2 (wallets:read)
Request Body schema: application/json
iso
string
simulation
boolean
Default: false

Responses

200

successful operation

post /wallet/transactions

Exchange Server

https://www.bit4you.io/api/wallet/transactions

Request samples

application/json
Copy
Expand all Collapse all
{
  • "iso": "BTC",
  • "simulation": true
}

Withdraw Funds

Withdraw funds from your wallet to an external wallet

Authorizations:
oauth2 (wallets:write)
Request Body schema: application/json
iso
string
quantity
float
address
string

Responses

200

successful operation

post /wallet/send

Exchange Server

https://www.bit4you.io/api/wallet/send

Request samples

application/json
Copy
Expand all Collapse all
{
  • "iso": "BTC",
  • "quantity": 1.05,
  • "address": "1CK6KHY6MHgYvmRQ4PAafKYDrg1eaaaaaa"
}

portfolio

View and manage all the orders linked to your account

Portfolio Summary

Comming Soon

Authorizations:
oauth2 (portfolio:read)
Request Body schema: application/json
simulation
boolean
Default: false

Responses

200

successful operation

post /portfolio/list

Exchange Server

https://www.bit4you.io/api/portfolio/list

Request samples

application/json
Copy
Expand all Collapse all
{
  • "simulation": true
}

Open Orders

Comming Soon

Authorizations:
oauth2 (portfolio:read)
Request Body schema: application/json
simulation
boolean
Default: false

Responses

200

successful operation

post /portfolio/open-orders

Exchange Server

https://www.bit4you.io/api/portfolio/open-orders

Request samples

application/json
Copy
Expand all Collapse all
{
  • "simulation": true
}

Orders History

Comming Soon

Authorizations:
oauth2 (portfolio:read)
Request Body schema: application/json
simulation
boolean
Default: false

Responses

200

successful operation

post /portfolio/history

Exchange Server

https://www.bit4you.io/api/portfolio/history

Request samples

application/json
Copy
Expand all Collapse all
{
  • "simulation": true
}

Create Order

Comming Soon

Authorizations:
oauth2 (portfolio:write)
Request Body schema: application/json
simulation
boolean
Default: false
market
string
quantity
float
rate
float

Responses

200

successful operation

post /portfolio/create-order

Exchange Server

https://www.bit4you.io/api/portfolio/create-order

Request samples

application/json
Copy
Expand all Collapse all
{
  • "simulation": true,
  • "market": "USDT-BTC",
  • "quantity": 0.55,
  • "rate": 3555.35
}

Cancel Order

Comming Soon

Authorizations:
oauth2 (portfolio:write)
Request Body schema: application/json
simulation
boolean
Default: false
id
integer

Responses

200

successful operation

post /portfolio/cancel-order

Exchange Server

https://www.bit4you.io/api/portfolio/cancel-order

Request samples