API PUBLIC
Endpoints:
https://api.youbtrade.com.br/api/volume
https://api.youbtrade.com.br/api/markets
https://api.youbtrade.com.br/api/trades/BTC_BRL
https://api.youbtrade.com.br/api/ticker/BTC_BRL
https://api.youbtrade.com.br/api/orderbook/BTC_BRL
API - PRIVATE
Authentication
Endpoint: https://api.youbtrade.com.br/api/oauth/token
Example:
Request
curl --location --request POST 'https://api.youbtrade.com.br/api/oauth/token' \
--data-raw '{
"grant_type":"client_credentials",
"api_key":"API_KEY",
"api_secret":"API_SECRET"
}'
Result
{
"success": true,
"token_type": "Bearer",
"access_token": "1ad7dc65762272f17220e742fd9f7605585054451a223ce30ec78c1cdda8a1cf8",
"refresh_token": "1e2819bd0cc337c469f4aafa1e4c1020057d05a57b5400174d147",
"message": "Success"
}
Refresh token
Endpoint: https://api.youbtrade.com.br/api/oauth/token
Example:
Request
curl --location --request POST 'https://api.youbtrade.com.br/api/oauth/token' \
--header 'Authorization: Bearer 1ad7dc65762272f17220e742fd9f7605585054451a223ce30ec78c1cdda8a1cf8' \
--header 'Content-Type: text/plain' \
--data-raw '{
"grant_type":"refresh_token",
"refresh_token":"1e2819bd0cc337c469f4aafa1e4c1020057d05a57b5400174d147"
}'
Result
{
"success": true,
"token_type": "Bearer",
"access_token": "12de3f4e954580ea924d2ca1ce5ab744f90632ec495a6c978733ab20906a2bc92",
"refresh_token": "1b574435e174ac852cebeb6572c1fea5d3d99014da1c826afba35",
"message": "Success"
}
Check session
Endpoint: https://api.youbtrade.com.br/api/checksession
Example:
Request
curl --location --request GET 'https://api.youbtrade.com.br/api/checksession' \
--header 'Authorization: Bearer 12de3f4e954580ea924d2ca1ce5ab744f90632ec495a6c978733ab20906a2bc92'
Result
{
"success": true,
"message": "Success"
}
Buy and Sell
Endpoint:
https://api.youbtrade.com.br/api/buy
https://api.youbtrade.com.br/api/sell
Example:
Request
curl --location --request POST 'https://api.youbtrade.com.br/api/buy' \
--header 'Authorization: Bearer 12de3f4e954580ea924d2ca1ce5ab744f90632ec495a6c978733ab20906a2bc92' \
--header 'Content-Type: text/plain' \
--data-raw '{
"symbol":"BTC-USDT",
"quantity":10.1234,
"price":0.0001,
"type":"LIMIT"
}'
Result
{
"success": true,
"id": "32",
"message": "Ordem criada com sucesso"
}
Cancel order
Endpoint:
https://api.youbtrade.com.br/api/cancel/[order_id]
Example:
Request
curl --location --request DELETE 'https://api.youbtrade.com.br/api/cancel/29' \
--header 'Authorization: Bearer 19bb11478071c5b266e2937480524fd8555adcea61233752d87102f685b7c9a0e'
Result
{
"success": true,
"message": "Sucesso"
}
Get Balance
Endpoint:
https://api.youbtrade.com.br/api/balance/[coin]
Example:
Request
curl --location --request GET 'https://api.youbtrade.com.br/api/balance/BTC' \
--header 'Authorization: Bearer 19bb11478071c5b266e2937480524fd8555adcea61233752d87102f685b7c9a0e'
Result
{
"success": true,
"available": "6.97589805",
"message": "Sucesso"
}
Order list
Endpoint:
https://api.youbtrade.com.br/api/orders/[pair]
Example:
Request
curl --location --request GET 'https://api.youbtrade.com.br/api/orders/BTC-USDT' \
--header 'Authorization: Bearer 12de3f4e954580ea924d2ca1ce5ab744f90632ec495a6c978733ab20906a2bc92'
Result
{
"success": true,
"result": [
{
"id": "32",
"quantity": "10.12340000",
"quantity_executed": "0.00000000",
"price": "0.00010000",
"subtotal": "0.00101234",
"fee": "0.00000000",
"total": "0.00101234",
"type": "BUY",
"status": "OPEN"
},
{
"id": "7",
"quantity": "1.00000000",
"quantity_executed": "1.00000000",
"price": "1.00000000",
"subtotal": "1.00000000",
"fee": "0.00200000",
"total": "1.00200000",
"type": "BUY",
"status": "CONCLUDED"
},
{
"id": "1",
"quantity": "100.00000000",
"quantity_executed": "0.00000000",
"price": "0.00000010",
"subtotal": "0.00001000",
"fee": "0.00000002",
"total": "0.00001002",
"type": "BUY",
"status": "CANCELED"
}
],
"message": "Success"
}