Ripio XCHG REST API

The platform that bring trader into cryptocurrencies world

WebSocket

WebSocket provide public updates of the orderbook and the trade history.

The base URI is wss://api.exchange.ripio.com/ws/v2/consumer/non-persistent/public/default/

Topics:

There are two kinds of topics: orderbook and trades which has to be concatenated with the pair. E.g.: The topic for the orderbook of BTC/DAI pair is orderbook_btc_dai and for the trade history trades_btc_dai. There is special topic that notify the user's new trades. This is get in the paylod received when a user succesfully login.

Suscription:

The suscription is a token which identify you as suscriber so the web sockets know which messages was or wasn't deliver. Make sure use the same token to prevent missing updates. Each received message has to be aknowledge so the web socket don't send it again.

var my_suscription = btoa("[email protected]")
var topic = "orderbook_btc_ars"
var ws = new WebSocket("wss://api.exchange.ripio.com/ws/v2/consumer/non-persistent/public/default/" + topic + "/" + my_suscription),
ws.onmessage = function(event) {
    console.log(event.data)
    var ackMsg = {"messageId" : event.data.messageId};
    ws.send(JSON.stringify(ackMsg));
};
ws.onerror = function(event) {console.log(event);}

Public

Public end-points

GET All Rates

https://api.exchange.ripio.com/api/v1/rate/all/

List all rates for all the availables pairs

Headers

Content-Type application/json
Example RequestAll Rates
curl --location --request GET "https://api.exchange.ripio.com/api/v1/rate/all/" \
  --header "Content-Type: application/json"

GET Rate per Pair

https://api.exchange.ripio.com/api/v1/rate/{{pair}}/

Rate for a specific pair

Headers

Content-Type application/json
Example RequestRate per Pair
curl --location --request GET "https://api.exchange.ripio.com/api/v1/rate/{{pair}}/" \
  --header "Content-Type: application/json"

GET Rates per Country

https://api.exchange.ripio.com/api/v1/rate/all/?country=BR

Filter the rates per availables in a specific country

Headers

Content-Type application/json

Params

country BR
Example RequestRates per Country
curl --location --request GET "https://api.exchange.ripio.com/api/v1/rate/all/?country=BR" \
  --header "Content-Type: application/json"

GET Orderbook

https://api.exchange.ripio.com/api/v1/orderbook/{{pair}}/

Get the pair's orderbook

Headers

Content-Type application/json
Example RequestOrderbook
curl --location --request GET "https://api.exchange.ripio.com/api/v1/orderbook/{{pair}}/" \
  --header "Content-Type: application/json"

GET Trade history

https://api.exchange.ripio.com/api/v1/tradehistory/{{pair}}/
Example RequestTrade history
curl --location --request GET "https://api.exchange.ripio.com/api/v1/tradehistory/{{pair}}/"

GET List of Pairs

https://api.exchange.ripio.com/api/v1/pair/

List all available pairs and theirs fees

Headers

Content-Type application/json
Example RequestList of Pairs
curl --location --request GET "https://api.exchange.ripio.com/api/v1/pair/" \
  --header "Content-Type: application/json"

GET List of Currencies

https://api.exchange.ripio.com/api/v1/currency/

List of available currencies

Headers

Content-Type application/json
Example RequestList of Currencies
curl --location --request GET "https://api.exchange.ripio.com/api/v1/currency/" \
  --header "Content-Type: application/json"

Private

Authenticated endpoints

For this endpoints It is required an authentication API key that can be adquire in the API menu of your account.

GET Account's balances

https://api.exchange.ripio.com/api/v1/balances/exchange_balances/

View all the balances of user's account

Headers

Authorization Bearer {{API_KEY}}
Content-Type application/json
Example RequestAccount's balances
curl --location --request GET "https://api.exchange.ripio.com/api/v1/balances/exchange_balances/" \
  --header "Authorization: Bearer {{API_KEY}}" \
  --header "Content-Type: application/json"

POST Create an order

https://api.exchange.ripio.com/api/v1/order/{{pair}}/

Headers

Authorization Bearer {{API_KEY}}
Content-Type application/json

Body

raw (application/json)
{
	"order_type":"LIMIT",
	"amount":"0.04",
	"limit_price":"10",
	"side":"BUY"
}
Example RequestCreate an order
curl --location --request POST "https://api.exchange.ripio.com/api/v1/order/{{pair}}/" \
  --header "Authorization: Bearer {{API_KEY}}" \
  --header "Content-Type: application/json" \
  --data "{
	\"order_type\":\"LIMIT\",
	\"amount\":\"0.04\",
	\"limit_price\":\"10\",
	\"side\":\"BUY\"
}"

POST Cancel an order

https://api.exchange.ripio.com/api/v1/order/{{pair}}/{{order_id}}/cancel/

Headers

Authorization Bearer {{API_KEY}}
Content-Type application/json
Example RequestCancel an order
curl --location --request POST "https://api.exchange.ripio.com/api/v1/order/{{pair}}/{{order_id}}/cancel/" \
  --header "Authorization: Bearer {{API_KEY}}" \
  --header "Content-Type: application/json"

GET User's orders

https://api.exchange.ripio.com/api/v1/order/{{pair}}/

List all user's orders

Headers

Authorization Bearer {{API_KEY}}
Content-Type application/json
Example RequestUser's orders
curl --location --request GET "https://api.exchange.ripio.com/api/v1/order/{{pair}}/" \
  --header "Authorization: Bearer {{API_KEY}}" \
  --header "Content-Type: application/json"

GET Order's details

https://api.exchange.ripio.com/api/v1/order/{{pair}}/{{order_id}}/

Order's details

Headers

Authorization Bearer {{API_KEY}}
Content-Type application/json
Example RequestUser's orders
curl --location --request GET "https://api.exchange.ripio.com/api/v1/order/{{pair}}/{{order_id}}/" \
  --header "Authorization: Bearer {{API_KEY}}" \
  --header "Content-Type: application/json"

GET User's orders filter per status

https://api.exchange.ripio.com/api/v1/order/{{pair}}/?status=OPEN,PART

Headers

Authorization Bearer {{API_KEY}}
Content-Type application/json

Params

status OPEN,PART
Example RequestUser's orders filter per status
curl --location --request GET "https://api.exchange.ripio.com/api/v1/order/{{pair}}/?status=OPEN,PART" \
  --header "Authorization: Bearer {{API_KEY}}" \
  --header "Content-Type: application/json"

GET User's trade history

https://api.exchange.ripio.com/api/v1/trade/{{pair}}/

List all user's trades

Headers

Authorization Bearer {{API_KEY}}
Content-Type application/json
Example RequestUser's trade history
curl --location --request GET "https://api.exchange.ripio.com/api/v1/trade/{{pair}}/" \
  --header "Authorization: Bearer {{API_KEY}}" \
  --header "Content-Type: application/json"