API

Public functions

Order book

GET https://indacoin.com/api/orderbook?pair={pair}

Params:

  • pair - 'btc_usd' or 'ltc_usd'

Returns array of orders. Each order is an object with next fields:

  • price - order price
  • amount - base currency amount

Example: https://indacoin.com/api/orderbook?pair=btc_usd

Last trades

GET https://indacoin.com/api/trades/{pair}/{tid}

Params:

  • pair - 'btc_usd' or 'ltc_usd'
  • tid - trade id begging to return list from

Returns list of trades. Each trade is an object with next fields:

  • tid - trade id
  • price - trade price
  • amount - base currency amount
  • date - trade time

Example: https://indacoin.com/api/trades/btc_usd/23

Market price

GET https://indacoin.com/api/GetMarketPrice/{operation}/{pair}/{amount}

Params:

  • operation - 'buy' or 'sell'
  • pair - 'btc_usd' or 'ltc_usd'
  • amount - amount in dollars. Default: 50.

Returns market price.

Example: https://indacoin.com/api/GetMarketPrice/buy/btc_usd/15

Ticker

GET https://indacoin.com/api/ticker

No params.

Returns JSON-object. Object fields is like 'BTC_USD'. Each field contains next fields:

  • last_price - price of the last trade
  • max_price - maximum trade price in the last 24 hours
  • min_price - minimun trade price in the last 24 hours
  • open_price - price of the first trade in the last 24 hours
  • today_open_price - price of the first trade today
  • volume_base - trade volume in the last 24 hours, base currency
  • volume_quote - trade volume in the last 24 hours, quote currency

Authentication

You need to provide 3 headers to authenticate a request:

  • API-Key
  • API-Sign
  • API-Nonce

Make sure the Content-Type is application/json.

API-Key

You can get API-Key in account settings.

API-Sign

Text Signature: method + nonce + API­key, created with ECDSA algorithm using a hash function with sha­1, issued a private key on curve sec256k1.

API-Nonce

nonce is an arbitrary number increasing with every request.

Private functions

getbalance

POST https://indacoin.com/api/getbalance

No params.

Returns JSON dictionary of your balance.

openorders

POST https://indacoin.com/api/openorders

No params.

Returns descending JSON list of orders. Every order contains:

  • 1 - unique identificator
  • 2 - pair of currencies
  • 3 - order type: sell or buy
  • 4 - price
  • 5 - amount, received/spent in the second currency of pair
  • 6 - amount, spent/received in the first currency of pair
  • 7 - creation time
  • 8 - fee in the second currency of pair

gethistory

POST https://indacoin.com/api/gethistory

Params:

  • limit - number of history records to return. Default: 100
  • offset - skip that many records before beginning to return. Default: 0

Returns array of history records. Each record is presented as an array.

Zero element is record type: 'buy', 'sell', 'in' or 'out'.

In 'buy'/'sell' case the whole record array is:

  • 0 - 'buy' or 'sell'
  • 1 - pair of deal: 'btc_usd' or 'ltc_usd'
  • 2 - price
  • 3 - base amount
  • 4 - quote amount
  • 5 - commission
  • 6 - deal time

In 'in'/'out' case the whole record array is:

  • 0 - 'in' or 'out'
  • 1 - number of operation
  • 2 - currency: 'BTC', 'LTC' or 'USD'
  • 3 - amount
  • 4 - operation time

buyorder

POST https://indacoin.com/api/buyorder

Params:

  • pair - 'btc_usd' or 'ltc_usd'
  • price - order price
  • amount - amount crypto to buy

Example: {pair:'BTC_USD',price:'597.0100',amount:'0.02428171'}

Returns JSON-object:

  • i - order ID (to confirm a deal)
  • s - sum in the second currency spent for the execution of more profitable orders
  • a - sum in the first currency got performing more profitable orders
  • p - pair of the order
  • ot - order type

Example: {"i":173409,"s":0.00,"a":0.00000000,"p":"BTC_USD","ot":"BUY"}

sellorder

POST https://indacoin.com/api/sellorder

Params:

  • pair - 'btc_usd' or 'ltc_usd'
  • price - order price
  • amount - amount to sell

Example: {pair:'BTC_USD',price:'591.5584',amount:'0.03675761'}

Returns JSON-object:

  • i - order ID (to confirm a deal)
  • s - sum in the second currency spent for the execution of more profitable orders
  • a - sum in the first currency got performing more profitable orders
  • p - pair of the order
  • ot - order type

Example: {"i":173456,"s":0.00,"a":0.00000000,"p":"BTC_USD","ot":"SELL"}

cancelorder

POST https://indacoin.com/api/cancelorder

Params:

  • i - order ID

Request example: {i:'200389'}

Returns one of:

  • success - order has been found and canceled
  • failed - error case (expired or not existing deal)