URLs below are relative to our API server endpoint, so that /version is mapped to https://bgogo.com/api/version and so on.
We require both the IPv4 address and the user agent stay the same for a session token to be usable. Please make sure you set the correct user agent.
All APIs require the Accept header to be set as application/json.
================================================================================ GET /version Response: { status: 'ok', version: '1.0.0' } ================================================================================ POST /send-security-code Request: { email: '[email protected]' } Errors: 500 unable to send security code ================================================================================ POST /sign-in Request: { email: '[email protected]', password: '03f7495b51cc70b76872ed019d19dee1b73e89b6' } The password field is the SHA1 hash of the password clear text. Response: { status: 'ok', web_session_id: 123456, uid: 19260817, token: 'BEUefwxcbBdDQ39voteckb7amOOagOFM4MVe4ctDQeI=' } In case of signing in from an unconfirmed device, it returns HTTP code 422 with the following response: { status: 'error', otp_enabled: true, reason: 'unconfirmed device' } NOTE: 'otp_enabled' is only present when Google 2FA is enabled Errors: 500 unable to get uid 500 unable to sign in 422 wrong password 422 unconfirmed device ================================================================================ POST /confirm-current-device Request: { email: '[email protected]', security_code: '123456', otp: '123456', password: '03f7495b51cc70b76872ed019d19dee1b73e89b6' } NOTE: 'otp' is only required if Google 2FA is enabled. Errors: 500 unable to confirm current device 422 wrong password ================================================================================ GET /balances Headers: Authorization: Bearer BEUefwxcbBdDQ39voteckb7amOOagOFM4MVe4ctDQeI= Response: { status: 'ok', otp_enabled: true, balances: [ { currency: 'ETH', available: '0.12345600', frozen: '0.00000000', step: '0.00000001', deposit_enabled: true, withdraw_enabled: false }, { currency: 'BTC', available: '0.12345600', frozen: '0.00646616', step: '0.00000001', deposit_enabled: true, withdraw_enabled: false } ] } Errors: 500 unable to get balances 422 account not ready ================================================================================ GET /snapshot/ETH/BTC Headers: Authorization: Bearer BEUefwxcbBdDQ39voteckb7amOOagOFM4MVe4ctDQeI= *** NOTE: It has an unauthorized (public-only) version. See comments below. *** Response: { status: 'ok', all_symbols: [ 'ETH/BTC', 'YANG/MEOW' ], last_prices: [ '0.0527', '1.00010001' ], past_24hrs_price_changes: [ '23.12%', '-42.40%' ], price_step: '0.0001', amount_step: '0.0001', order_book: { bids: [{ price: '0.0528', amount: '0.1234' }, { price: '0.0527', amount: '0.1234' }, { price: '0.0526', amount: '0.1234' }, { price: '0.0525', amount: '0.1234' }, { price: '0.0524', amount: '0.1234' }], asks: [{ price: '0.0529', amount: '0.1234' }, { price: '0.0530', amount: '0.1234' }, { price: '0.0531', amount: '0.1234' }, { price: '0.0532', amount: '0.1234' }, { price: '0.0533', amount: '0.1234' }] }, trade_history: [ { price: '0.0528', amount: '0.1234', timestamp: 1507785073, side: 'buy' }, { price: '0.0528', amount: '0.1234', timestamp: 1507785072, side: 'sell' } ], my_account_balances: [ { currency: 'ETH', available: '0.12345600', frozen: '0.00000000', step: '0.00000001' }, { currency: 'BTC', available: '0.12345600', frozen: '0.00646616', step: '0.00000001' } ], my_orders: [ { id: '987654323', side: 'buy', price: '0.0524', amount: '0.1235', create_time: 1507785072, update_time: 1507785073, status: 'open', volume: '0.0001', turnover: '0.00000524' }, { id: '987654322', side: 'sell', price: '0.0524', amount: '0.1235', create_time: 1507785072, update_time: 1507785073, status: 'cancelled', volume: '0.0001', turnover: '0.00000524' }, { id: '987654321', side: 'buy', price: '0.0524', amount: '0.1235', create_time: 1507785072, update_time: 1507785073, status: 'closed', volume: '0.1235', turnover: '0.00647140' } ], my_fee_rate: '0.0025' } ******************************************************************************* * * * If the Authorization header is missing, the API returns public-only data, * * which excludes my_account_balances, my_orders, and my_fee_rate. * * * * If the account is not ready, it also returns public-only data. * * * ******************************************************************************* Errors: 500 unable to get snapshot 422 invalid symbol ================================================================================ GET /candlesticks/ETH/BTC?start-timestamp-s=1548051300&end-timestamp-s=1548051900&andlestick=5m Response: { status: 'ok', candlesticks: [ [ 1548051600, "0.032850", "0.032868", "0.032809", "0.032868", "43.1793", "2019-01-21 14:20:00" ], [ 1548051900, "0.032879", "0.032880", "0.032845", "0.032862", "48.1536", "2019-01-21 14:25:00" ] ] } Valid candlestick: 1m 5m 15m 30m 1hr 4hr 1d ================================================================================ GET /tickers Response: { status: 'ok', tickers: { 'ETH/BTC': { 'last_price': '0.0527', 'lowest_ask_price': '0.0400', 'highest_bid_price': '0.0600', 'past_24hrs_price_change': '23.12%', 'past_24hrs_base_volume': 5.234, 'past_24hrs_quote_turnover': 52.34, 'past_24hrs_high_price': '0.0700', 'past_24hrs_low_price': '0.0300' } } } Semantics of each field: - last_price: latest trade's strike price - lowest_ask_price: lowest ask price (the first entry of asks in order book) - highest_bid_price: highest bid price (the first entry of bids in order book) - past_24hrs_price_change: price change of last 24 hours in percentage - past_24hrs_base_volume: total traded volume in past 24 hours - past_24hrs_quote_turnover: total traded turnover in past 24 hours - past_24hrs_high_price: highest trade price in past 24 hours - past_24hrs_low_price: lowest trade price in past 24 hours Errors: 500 unable to get snapshot 500 snapshot order_book missing 500 snapshot all_symbols missing 500 snapshot my_symbol missing ================================================================================ POST /place-order Headers: Authorization: Bearer BEUefwxcbBdDQ39voteckb7amOOagOFM4MVe4ctDQeI= Request: { symbol: 'ETH/BTC', side: 'buy', price: '0.0529', amount: '0.1234' } Response: { status: 'ok', order_id: '987654321' } Errors: 422 invalid symbol 422 invalid side 500 unable to place order 422 account not ready 422 invalid price 422 invalid amount 422 balance not enough ================================================================================ POST /cancel-order/987654321 Headers: Authorization: Bearer BEUefwxcbBdDQ39voteckb7amOOagOFM4MVe4ctDQeI= Errors: 500 unable to cancel order 422 account not ready 422 order is closed 422 invalid order id ================================================================================ GET /trade-history?start=1507766400&end=1508112000 Note: 'start' and 'end' parameters are optional. By default, it returns the most recent 10 records. Additionally, the parameters below could be set to further control pagination. - 'page_size' specifies the number of records to return. - 'page' specifies the page number. Headers: Authorization: Bearer BEUefwxcbBdDQ39voteckb7amOOagOFM4MVe4ctDQeI= Response: { status: 'ok', page_max: 1, orders: [ { order_id: 19260817, create_time: 1496844012, symbol: 'ETH/BTC', side: 'buy', price: '0.0010', amount: '2000.0000', status: 'cancelled', fee: '0.00000000 ETH', turnover: '0.00000000', volume: '0.00000000', trades: [] }, { order_id: 19260817, create_time: 1496844012, symbol: 'ETH/BTC', side: 'sell', price: '0.0543', amount: '1.0000', status: 'closed', fee: '0.00013575 BTC', turnover: '0.00100000', volume: '1.0000', trades: [ { create_time: 1496844012, price: '0.0010', amount: '1.0000', fee: '0.00013575 BTC' } ] } ] } Errors: 500 unable to get trade history 422 account not ready
© bgogo.com, 2019, All rights reserved
Server Time: 2024-09-15 02:13:30 UTC