API

The best way to discover all the features of our API is to go to the Swagger testing page. You can find more detailed information about connecting to our HTTP API on our Github Page. All input parameters (if any), with a POST request, need to be encoded in JSON format.

  • General Usage

    Request URL

                                                            
                                                                https://api.gatecoin.com/
                                                            
                                                        

    Step 1: Get your API key

    Authentication is required before starting to trade. To get the API key you need go to our Api Key Management Page.

    The API key requires the following information
    Key Name The name you want to give to the API key
    Key validity duration The Gatecoin API key has a maximum validity of 1 year.
    Allow IP's If empty, all IPs are accepted. Multiple IPs are allowed if they are comma separated.

    Step 2: Create your signature

                                                            
                                                                var contentType = (httpMethod == "GET") ? "" : ct;
                                                                var message = settings.type + settings.url + contentType + now;
                                                                var hash = CryptoJS.HmacSHA256(message.toLowerCase(), key);
                                                                var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
                                                            
                                                        

    Explanation

    contentType For GET requests this field should be empty. For POST and PUT requests it should be application/json
    message GET, POST, PUT Link of the API contentType Unix timestamp
    Example message POST https://api.gatecoin.com/Ping?Message=ExampleInputapplication/json1421393683.201
    hash HMAC SHA256 signed message Key, is the private key
    hashInBase64 Base64 encoded hash

    Step 3: Create the request Header

                                                            
                                                                jqXHR.setRequestHeader("API_PUBLIC_KEY", publicKey);
                                                                jqXHR.setRequestHeader("API_REQUEST_SIGNATURE", hashInBase64);
                                                                jqXHR.setRequestHeader("API_REQUEST_DATE", now);
                                                            
                                                        

    Explanation

    publicKey Your public API Key generated in step 1
    hashInBase64 Your signature created in step 2
    now Unix timestamp including milliseconds
  • GET Tickers

    Note: the ticker is public data. Authentication is not required

    Link

        GET https://api.gatecoin.com/Public/LiveTickers

    Response

                                                                                                        {
                                                                "tickers": [
                                                                {
                                                                "currencyPair": "BTCUSD",
                                                                "open": 200,
                                                                "last": 200,
                                                                "lastQ": 0.1,
                                                                "high": 200,
                                                                "low": 200,
                                                                "volume": 50,
                                                                "bid": 200,
                                                                "bidQ": 27.7099,
                                                                "ask": 203,
                                                                "askQ": 10,
                                                                "vwap": 0,
                                                                "createDateTime": "1421252904"
                                                                }
                                                                ]
                                                                }
                                                            
                                                        

    Explanation

    Key Value Explanation
    open 200 The last price of the previous ticker was 200 USD
    last 200 The last transaction price was 200 USD
    lastQ 0.1 The last transaction quantity traded was 0.1 BTC
    high 200 The highest transaction price in the last 24 hours was 200 USD
    low 200 The lowest transaction price in the last 24 hours was 200 USD
    volume 50 The volume traded in the last 24 hours was 50 BTC
    bid 200 The current best bid order is 200 USD for 1 BTC
    bidQ 27.7099 The current best bid quantity is open for 27.7099 BTC
    ask 203 The current best ask order is 203 USD for 1 BTC
    askQ 10 The current best ask quantity is open for 10 BTC
    vwap 0 Volume Weighted Average Price
    createDateTime 1421252904 Unix timestamp
  • GET MarketDepth

    Note: the MarketDepth is public data. Authentication is not required

    Link

        GET https://api.gatecoin.com/Public/MarketDepth/:CurrencyPair

    Parameters

    Parameter Data Type Description Parameter Type
    CurrencyPair string The currency pair for which prices are wanted path

    Response

    { "asks": [ { "price": 203, "volume": 10 }, { "price": 204, "volume": 1 } ] }

    Explanation

    Key Value Explanation
    price 203 There is an available ask order to sell BTC at 203 USD
    volume 10 The available quantity at that price is 10 BTC
  • GET Transactions

    Note: the Transactions are public data. Authentication is not required

    Path

        GET https://api.gatecoin.com/Public/Transactions/:CurrencyPair

    Parameters

    Parameter Data Type Description Parameter Type
    CurrencyPair string Currency Pair path
    Count int Number of transactions to get. Max 1000 (optional) query
    TransactionId long Get transactions from specific transaction id (optional) query

    Response

                                                                                                        {
                                                                "transactions": [
                                                                {
                                                                "transactionId": 4263196,
                                                                "transactionTime": "1416212760",
                                                                "price": 405.52,
                                                                "quantity": 0.33,
                                                                "currencyPair": "BTCUSD"
                                                                }
                                                                ]
                                                                }
                                                            
                                                        

    Explanation

    Key Value Description
    transactionId 4263196 Transaction ID
    transactionTime 1416212760 Transaction Unix timestamp
    price 405.52 Price of the transaction
    quantity 0.33 Quantity traded in the transaction
    currencyPair BTCUSD Currency pair traded in the transaction
  • GET Balances

    Path

        GET https://api.gatecoin.com/Balance/Balances/:currency

    Parameters

    Parameter Data Type Description Parameter Type
    Currency string Currency to query path

    The currency is optional. If left blank: all currencies will be within the request.

    Response

                                                                                                        {
                                                                "balances": [
                                                                {
                                                                "currency": "BTC",
                                                                "balance": 4.817085,
                                                                "availableBalance": 7.690765,
                                                                "pendingIncoming": 0,
                                                                "pendingOutgoing": -0.12632,
                                                                "openOrder": -3,
                                                                "isDigital": true
                                                                },
                                                                {
                                                                "currency": "USD",
                                                                "balance": 5857.8,
                                                                "availableBalance": 4347.8,
                                                                "pendingIncoming": 0,
                                                                "pendingOutgoing": -1200,
                                                                "openOrder": -310,
                                                                "isDigital": false
                                                                }
                                                                ]
                                                                }
                                                            
                                                        

    Explanation

    Key Value Description
    currency BTC Name of the currency
    balance 4.817085 Total balance in the account
    availableBalance 7.690765 Balance available for trade or withdrawal
    pendingIncoming 0 Balance pending from incoming credit requests
    pendingOutgoing -0.12632 Balance pending for outgoing withdrawals
    openOrder -3 Balance reserved for open orders
    isDigital true true for digital currencies and false for fiat currencies
  • POST Orders

    Path

    POST https://api.gatecoin.com/Trade/Orders

    Parameters

    Parameter Data Type Description Parameter Type
    Code string The code of the currency pair used in the order: BTCUSD, BTCHKD, BTCEUR, ETHBTC query
    Way string Ask or Bid query
    Amount decimal Amount expressed in the first currency of the currency pair. BTCUSD - both buy and sell orders are expressed in BTC query
    Price decimal Price expressed in the second currency of the currency pair(Empty if placing market order). BTCUSD : The price is always expressed as the price of one BTC in USD query
    ValidationCode string Validation code if you requested two factor validation for trading query

    Response

                                                                                                        {
                                                                "clOrderId": "BK11407560831",
                                                                "responseStatus": {
                                                                "message": "OK"
                                                                }
                                                                }
                                                            
                                                        

    Explanation

    Key Value Description
    clOrderId BK11407560831 OrderId of the order
  • GET Orders

    Path

        GET https://api.gatecoin.com/Trade/Orders

    Parameters

    GET /Trade/Orders will return all Orders

    GET /Trade/Orders/{orderID} will require an order ID and will return one specific order.

    Parameter Data Type Description Parameter Type
    clOrderId string Client order Id. Use as order Id Path

    Response

                                                                                                        {
                                                                "orders": [
                                                                {
                                                                "code": "BTCHKD",
                                                                "clOrderId": "BK11407560831",
                                                                "side": 1,
                                                                "price": 1500,
                                                                "initialQuantity": 1,
                                                                "remainingQuantity": 1,
                                                                "status": 1,
                                                                "statusDesc": "New",
                                                                "tranSeqNo": 0,
                                                                "type": 0,
                                                                "date": "1421400169"
                                                                }
                                                                ]
                                                                }
                                                            
                                                        

    Explanation

    Key Value Description
    code BTCHKD CurrencyPair
    clOrderId BK11407560831 OrderId of the order
    side 1 0 : Bid, 1 : Ask
    price BTCHKD Order Price
    status 1 1 : New, 2 : Filling
    statusDesc New New : Filling
    tranSeqNo 0 Sequence number of the trade
    type 0 0 : Limit, 1: Market Order
    date 1421400169 Unix timestamp
  • DELETE Orders

    Note: If you do not specify the Order ID, this command will cancel all orders for the user.

    Path

        DELETE https://api.gatecoin.com/Trade/Orders/{orderId}

    Parameters

    Parameter Data Type Description Parameter Type
    clOrderId string OrderID of the order to be cancelled Path

    Response

                                                                                                        {
                                                                "responseStatus": {
                                                                "message": "OK"
                                                                }
                                                                }
                                                            
                                                        

    Explanation

    Key Value Description
    message OK Order cancellation successfully executed
  • POST Withdrawal

    Path

        POST https://api.gatecoin.com/ElectronicWallet/Withdrawals/:DigiCurrency

    Parameters

    Parameter Data Type Description Parameter Type
    DigiCurrency string The currency used in withdrawal: BTC, ETH query
    Address Name string The address label user added for withdrawal query
    Amount decimal The amount user request to send out query
    Comment decimal Comment in the transaction query
    ValidationCode string Validation code if you requested two factor validation for withdrawal query

    Response

                                                                                                        {
                                                                "responseStatus": {
                                                                "message": "OK"
                                                                }
                                                                }
                                                            
                                                        
  • API Rate Limits

    The following APIs are rate-limited:

    Balance

    Maximum allowed requests per minute: 30

    Applicable to:

                                    GET /Balance/Balances : Gets the available balance for each currency for the logged in account.
                                    GET /Balance/Balances/{Currency}:  Gets the available balance for s currency for the logged in account.
                                

    Order

    Maximum allowed requests per minute: 150

    Applicable to:

                                    GET /Trade/Orders:  Gets open orders for the logged in trader.
                                    GET /Trade/Orders/{OrderID}:  Gets an order for the logged in trader.
                                    POST /Trade/Orders:  Place an order at the exchange.
                                    DELETE /Trade/Orders:  Cancels all existing order.
                                    DELETE /Trade/Orders/{OrderID}:  Cancels an existing order.
                                    POST /Trade/QuickChange/Quote: Request a quote for quick order.
                                    POST /Trade/QuickChange: Place a quick order to trade again market maker.
                                

    Recaptcha

    Maximum allowed requests per minute: 150

    Applicable to:

                                    POST /Public/Contact: Post a contact.
                                

    Note: There is no rate limit on any public API.

  • More Information

    Please note that the API calls are rate limited. If you need an increase please contact us. Please also note that in case of DDoS attack attempt on the website, direct API calls may be blocked by the protection system. Please contact us if you want to have your IP address white-listed permanently.