Back to top
AlphaPoint Public API

Request structure

Requests are intiated using POST method. Data is transmitted to the server using UTF-8 charset.

POST data is expected to be sent as a JSON string.

JSON.stringify({key:'value'})

Response structure

Responses will contain either the key "isAccepted": true, or "isAccepted": false,.

Typically there will be another key "rejectReason" with a textual explanation of the error as shown below.

{"isAccepted": false, "rejectReason": "Incorrect usage",}

Request limits

More than 500 request per 10 minutes will result in IP ban.

For real-time data please refer to the AlphaPoint WebSocket API.

WebSocket API

Our WebSocket API provides real-time order book, trade data, and much more.

Public HTTP API 

Ticker 

Parameters

productPair - trade pair (ex: “BTCUSD”)

Gets the current ticker data for a given currency pair
/ajax/v1/GetTicker
  • Request
  • Headers
    Content-Type: application/json
    Body
    {"productPair": "BTCUSD"}
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"high":253.101,"last":249.76,"bid":248.8901,"volume":5.813354,"low":231.21,"ask":248.9012,"Total24HrQtyTraded":52.654968,"Total24HrProduct2Traded":569.05762,"Total24HrNumTrades":4,"sellOrderCount":7,"buyOrderCount":11,"numOfCreateOrders":0,"isAccepted":true}
    

Trades 

Parameters

ins - instrument code (ex: “BTCUSD”)

startIndex - specifies the index to begin from, -1 being the first trade on AlphaPoint Exchange. To begin from the most recent trade, set startIndex to 0 (default: 0)

Count - specifies the number of trades to return (default: 10)

Fetches past trades for the given currency pair
/ajax/v1/GetTrades
  • Request
  • Headers
    Content-Type: application/json
    Body
    {"ins": "BTCUSD", "startIndex": -1, "count": 20}
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"isAccepted":true,"dateTimeUtc":635507981548085938,"ins":"BTCUSD","startIndex":0,"count":10,"trades":[{"tid":0,"px":231.8379,"qty":4.913,"unixtime":1399951989,"utcticks":635355487898355234,"incomingOrderSide":0,"incomingServerOrderId":2598,"bookServerOrderId":2588},{"tid":1,"px":7895.1487,"qty":0.25,"unixtime":1403143708,"utcticks":635387405087297421,"incomingOrderSide":0,"incomingServerOrderId":284241,"bookServerOrderId":284235},{"tid":2,"px":7935.058,"qty":0.25,"unixtime":1403195348,"utcticks":635387921488684140,"incomingOrderSide":0,"incomingServerOrderId":575845,"bookServerOrderId":574078},{"tid":3,"px":7935.0448,"qty":0.25,"unixtime":1403195378,"utcticks":635387921780090390,"incomingOrderSide":0,"incomingServerOrderId":576028,"bookServerOrderId":575946},{"tid":4,"px":7933.9566,"qty":0.1168,"unixtime":1403195510,"utcticks":635387923108371640,"incomingOrderSide":0,"incomingServerOrderId":576974,"bookServerOrderId":576947},{"tid":5,"px":7961.0856,"qty":0.25,"unixtime":1403202307,"utcticks":635387991073850156,"incomingOrderSide":0,"incomingServerOrderId":600547,"bookServerOrderId":600338},{"tid":6,"px":7961.1388,"qty":0.011,"unixtime":1403202307,"utcticks":635387991073850156,"incomingOrderSide":0,"incomingServerOrderId":600547,"bookServerOrderId":600418},{"tid":7,"px":7961.2451,"qty":0.02,"unixtime":1403202307,"utcticks":635387991073850156,"incomingOrderSide":0,"incomingServerOrderId":600547,"bookServerOrderId":600428},{"tid":8,"px":7947.1437,"qty":0.09,"unixtime":1403202749,"utcticks":635387995498225156,"incomingOrderSide":0,"incomingServerOrderId":602183,"bookServerOrderId":601745},{"tid":9,"px":7818.5073,"qty":0.25,"unixtime":1403219720,"utcticks":635388165206506406,"incomingOrderSide":0,"incomingServerOrderId":661909,"bookServerOrderId":661620}]}    
    

Trades by date 

Parameters

ins - instrument code (ex: “BTCUSD”)

startDate - specifies the starting time in epoch time, type is long

endDate - specifies the end time in epoch time, type is long

Get trades by date
/ajax/v1/GetTradesByDate
  • Request
  • Headers
    Content-Type: application/json
    Body
    {"ins":"BTCUSD","startDate":1414799400,"endDate":1414800000}
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"isAccepted":true,"dateTimeUtc":635504540880633671,"ins":"BTCUSD","startDate":1414799400,"endDate":1414800000,"trades":[
    {"tid":11505,"px":334.669,"qty":0.1211,"unixtime":1414799403,"utcticks":635503962032459843,"incomingOrderSide":1,"incomingServerOrderId":5185651,"bookServerOrderId":5162440},
    {"tid":11506,"px":334.669,"qty":0.1211,"unixtime":1414799405,"utcticks":635503962058446171,"incomingOrderSide":1,"incomingServerOrderId":5186245,"bookServerOrderId":5162440},
    {"tid":11507,"px":336.498,"qty":0.011,"unixtime":1414799407,"utcticks":635503962072967656,"incomingOrderSide":0,"incomingServerOrderId":5186530,"bookServerOrderId":5178944},
    {"tid":11508,"px":335.948,"qty":0.011,"unixtime":1414799410,"utcticks":635503962108055546,"incomingOrderSide":0,"incomingServerOrderId":5187260,"bookServerOrderId":5186531}]}
    

Order book 

Displays the top 20 asks and bids. For Real-Time data please use AlphaPoint WebSockets API.

Parameters

productPair - trade pair (ex: “BTCUSD”)

Fetches the current orderbook for a given currency pair
/ajax/v1/GetOrderBook
  • Request
  • Headers
    Content-Type: application/json
    Body
    {"productPair":"BTCUSD"}
    
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"bids":[{"qty":725,"px":66},{"qty":1289,"px":65},{"qty":1266,"px":64}],"asks":[{"qty":1,"px":67},{"qty":1,"px":69},{"qty":2,"px":70},],"isAccepted":true}
    

Product pairs 

Gets the currency pairs currently traded on AlphaPoint
/ajax/v1/GetProductPairs
  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"productPairs":[{"name":"LTCUSD","productPairCode":100,"product1Label":"LTC","product1DecimalPlaces":8,"product2Label":"USD","product2DecimalPlaces":6}, {"name":"BTCUSD","productPairCode":99,"product1Label":"BTC","product1DecimalPlaces":8,"product2Label":"USD","product2DecimalPlaces":6}],"isAccepted":true}         
    

Products 

Gets the currency products currently supported on AlphaPoint
/ajax/v1/GetProducts
  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"products": [{"name": "USD","isDigital": false,"productCode": 0,"decimalPlaces": 4,"fullName": "US Dollar"},{"name": "BTC","isDigital": true,"productCode": 1,"decimalPlaces": 6,"fullName": "Bitcoin"}],"isAccepted": true}
    

WebSocket API 

The WebSocket protocol provides full-duplex communications channels over a single persistent TCP connection.

For real-time exchange data or high frequency activity we recommend using our WebSockets API.

AP WebSocket URI: WSS://sim3.alphapoint.com:8401

All WebSocket requests require the trailing “/” in the URI


Get Ticker

/v1/GetTicker/

Parameters

messageType - logon

Get Ticker

var ws = new WebSocket("wss://sim3.alphapoint.com:8401/v1/GetTicker/");
ws.onopen = function()
{
ws.send(JSON.stringify({messageType: 'logon'}));
};
ws.onmessage = function (evt)
{ 
console.log(evt.data);
}

Response

Example shows only a subset of the typical response.

{"messageType":"Ticker","prodPair":"BTCGBP","high":0,"low":0,"last":0,"volume":0,"Total24HrQtyTraded":0,"Total24HrProduct2Traded":0,"Total24HrNumTrades":0,"bid":0,"ask":9223372036.85478,"buyOrderCount":0,"sellOrderCount":0}

Get Trades and Orderbook

/v1/GetL2AndTrades/

Parameters:

ins - instrument code (ex: “BTCUSD”)

ModifyL2Order - 0 for orderbook, 1 for new trades (default: 0)

Get trades

var ws = new WebSocket("wss://sim3.alphapoint.com:8401/v1/GetL2AndTrades/");
ws.onopen = function()
{
ws.send(JSON.stringify({ins:'BTCUSD',ModifyL2Order:'0'}));
};
ws.onmessage = function (evt)
{ 
console.log(evt.data);
}

Response

Example shows only a subset of the typical response.

[[78433227,635586774471555007,225.58,0.7045,0,0],[78433226,635586774471555006,225.6,33,0,0],[78431613,635586774176867505,225.62,37.1979,0,0]]

Get Requests 

Product pairs 

Gets the currency pairs currently traded on AlphaPoint
/ajax/v1/GetProductPairs
  • Request
  • Headers
    Content-Type: application/json
  • Response  200
  • Headers
    Content-Type: application/json
    Body
    {"productPairs":[{"name":"LTCUSD","productPairCode":100,"product1Label":"LTC","product1DecimalPlaces":8,"product2Label":"USD","product2DecimalPlaces":6}, {"name":"BTCUSD","productPairCode":99,"product1Label":"BTC","product1DecimalPlaces":8,"product2Label":"USD","product2DecimalPlaces":6}],"isAccepted":true}         

Trades 

Parameters

ins - instrument code (ex: “BTCUSD”)

Since - specifies the starting Trade ID (TID)

Get trades
/ajax/v1/Trades
  • Request
  • Headers
    Content-Type: application/json
    https://sim3.alphapoint.com:8400/Trades/BTCUSD/?Since=0
  • Response  200
  • Headers
    Content-Type: application/json
    "trades": [ {"tid":11505,"price":334.669,"amount":0.1211,"date":1414799403}, {"tid":11506,"price":334.669,"amount":0.1211,"date":1414799405}, {"tid":11507,"price":336.498,"amount":0.011,"date":1414799407}, {"tid":11508,"price":335.948,"amount":0.011,"date":1414799410}

GetOrderBook 

Parameters

ins - instrument code (ex: “BTCUSD”)

Get trades
/ajax/v1/GetOrderBook
  • Request
  • Headers
    Content-Type: application/json
    https://sim3.alphapoint.com:8400/GetOrderBook/BTCUSD/
  • Response  200
  • Headers
    Content-Type: application/json
    "bids": [[226.04,24.6696],[226.03,20]], "asks":[[226.85,1.406],[226.86,2.9806]],"isAccepted":true}

Title Goes Here

Close

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam magnam accusamus obcaecati nisi eveniet quo veniam quibusdam veritatis autem accusantium doloribus nam mollitia maxime explicabo nemo quae aspernatur impedit cupiditate dicta molestias consectetur, sint reprehenderit maiores. Tempora, exercitationem, voluptate. Sapiente modi officiis nulla sed ullam, amet placeat, illum necessitatibus, eveniet dolorum et maiores earum tempora, quas iste perspiciatis quibusdam vero accusamus veritatis. Recusandae sunt, repellat incidunt impedit tempore iusto, nostrum eaque necessitatibus sint eos omnis! Beatae, itaque, in. Vel reiciendis consequatur saepe soluta itaque aliquam praesentium, neque tempora. Voluptatibus sit, totam rerum quo ex nemo pariatur tempora voluptatem est repudiandae iusto, architecto perferendis sequi, asperiores dolores doloremque odit. Libero, ipsum fuga repellat quae numquam cumque nobis ipsa voluptates pariatur, a rerum aspernatur aliquid maxime magnam vero dolorum omnis neque fugit laboriosam eveniet veniam explicabo, similique reprehenderit at. Iusto totam vitae blanditiis. Culpa, earum modi rerum velit voluptatum voluptatibus debitis, architecto aperiam vero tempora ratione sint ullam voluptas non! Odit sequi ipsa, voluptatem ratione illo ullam quaerat qui, vel dolorum eligendi similique inventore quisquam perferendis reprehenderit quos officia! Maxime aliquam, soluta reiciendis beatae quisquam. Alias porro facilis obcaecati et id, corporis accusamus? Ab porro fuga consequatur quisquam illo quae quas tenetur.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque similique, at excepturi adipisci repellat ut veritatis officia, saepe nemo soluta modi ducimus velit quam minus quis reiciendis culpa ullam quibusdam eveniet. Dolorum alias ducimus, ad, vitae delectus eligendi, possimus magni ipsam repudiandae iusto placeat repellat omnis veritatis adipisci aliquam hic ullam facere voluptatibus ratione laudantium perferendis quos ut. Beatae expedita, itaque assumenda libero voluptatem adipisci maiores voluptas accusantium, blanditiis saepe culpa laborum iusto maxime quae aperiam fugiat odit consequatur soluta hic. Sed quasi beatae quia repellendus, adipisci facilis ipsa vel, aperiam, consequatur eaque mollitia quaerat. Iusto fugit inventore eveniet velit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque similique, at excepturi adipisci repellat ut veritatis officia, saepe nemo soluta modi ducimus velit quam minus quis reiciendis culpa ullam quibusdam eveniet. Dolorum alias ducimus, ad, vitae delectus eligendi, possimus magni ipsam repudiandae iusto placeat repellat omnis veritatis adipisci aliquam hic ullam facere voluptatibus ratione laudantium perferendis quos ut. Beatae expedita, itaque assumenda libero voluptatem adipisci maiores voluptas accusantium, blanditiis saepe culpa laborum iusto maxime quae aperiam fugiat odit consequatur soluta hic. Sed quasi beatae quia repellendus, adipisci facilis ipsa vel, aperiam, consequatur eaque mollitia quaerat. Iusto fugit inventore eveniet velit.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam magnam accusamus obcaecati nisi eveniet quo veniam quibusdam veritatis autem accusantium doloribus nam mollitia maxime explicabo nemo quae aspernatur impedit cupiditate dicta molestias consectetur, sint reprehenderit maiores. Tempora, exercitationem, voluptate. Sapiente modi officiis nulla sed ullam, amet placeat, illum necessitatibus, eveniet dolorum et maiores earum tempora, quas iste perspiciatis quibusdam vero accusamus veritatis. Recusandae sunt, repellat incidunt impedit tempore iusto, nostrum eaque necessitatibus sint eos omnis! Beatae, itaque, in. Vel reiciendis consequatur saepe soluta itaque aliquam praesentium, neque tempora. Voluptatibus sit, totam rerum quo ex nemo pariatur tempora voluptatem est repudiandae iusto, architecto perferendis sequi, asperiores dolores doloremque odit. Libero, ipsum fuga repellat quae numquam cumque nobis ipsa voluptates pariatur, a rerum aspernatur aliquid maxime magnam vero dolorum omnis neque fugit laboriosam eveniet veniam explicabo, similique reprehenderit at. Iusto totam vitae blanditiis. Culpa, earum modi rerum velit voluptatum voluptatibus debitis, architecto aperiam vero tempora ratione sint ullam voluptas non! Odit sequi ipsa, voluptatem ratione illo ullam quaerat qui, vel dolorum eligendi similique inventore quisquam perferendis reprehenderit quos officia! Maxime aliquam, soluta reiciendis beatae quisquam. Alias porro facilis obcaecati et id, corporis accusamus? Ab porro fuga consequatur quisquam illo quae quas tenetur.

Title Goes Here

Close

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quam magnam accusamus obcaecati nisi eveniet quo veniam quibusdam veritatis autem accusantium doloribus nam mollitia maxime explicabo nemo quae aspernatur impedit cupiditate dicta molestias consectetur, sint reprehenderit maiores. Tempora, exercitationem, voluptate. Sapiente modi officiis nulla sed ullam, amet placeat, illum necessitatibus, eveniet dolorum et maiores earum tempora, quas iste perspiciatis quibusdam vero accusamus veritatis. Recusandae sunt, repellat incidunt impedit tempore iusto, nostrum eaque necessitatibus sint eos omnis! Beatae, itaque, in. Vel reiciendis consequatur saepe soluta itaque aliquam praesentium, neque tempora. Voluptatibus sit, totam rerum quo ex nemo pariatur tempora voluptatem est repudiandae iusto, architecto perferendis sequi, asperiores dolores doloremque odit. Libero, ipsum fuga repellat quae numquam cumque nobis ipsa voluptates pariatur, a rerum aspernatur aliquid maxime magnam vero dolorum omnis neque fugit laboriosam eveniet veniam explicabo, similique reprehenderit at. Iusto totam vitae blanditiis. Culpa, earum modi rerum velit voluptatum voluptatibus debitis, architecto aperiam vero tempora ratione sint ullam voluptas non! Odit sequi ipsa, voluptatem ratione illo ullam quaerat qui, vel dolorum eligendi similique inventore quisquam perferendis reprehenderit quos officia! Maxime aliquam, soluta reiciendis beatae quisquam. Alias porro facilis obcaecati et id, corporis accusamus? Ab porro fuga consequatur quisquam illo quae quas tenetur.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Neque similique, at excepturi adipisci repellat ut veritatis officia, saepe nemo soluta modi ducimus velit quam minus quis reiciendis culpa ullam quibusdam eveniet. Dolorum alias ducimus, ad, vitae delectus eligendi, possimus magni ipsam repudiandae iusto placeat repellat omnis veritatis adipisci aliquam hic ullam facere voluptatibus ratione laudantium perferendis quos ut. Beatae expedita, itaque assumenda libero voluptatem adipisci maiores voluptas accusantium, blanditiis saepe culpa laborum iusto maxime quae aperiam fugiat odit consequatur soluta hic. Sed quasi beatae quia repellendus, adipisci facilis ipsa vel, aperiam, consequatur eaque mollitia quaerat. Iusto fugit inventore eveniet velit.