Difference between revisions of "Intersango/API"

From Bitcoin Wiki
Jump to: navigation, search
Line 1: Line 1:
 +
=== common information ===
 +
 +
To maintain backwards compatibility the following britcoin.co.uk urls are rewritten
 +
 +
{| class="wikitable"
 +
|-
 +
|----
 +
|/api/ticker.php
 +
|/api/ticker.php?currency_pair_id=1
 +
|----
 +
|/api/ticker
 +
|/api/ticker.php?currency_pair_id=1
 +
|----
 +
|/api/getTrades.php
 +
|/api/trades.php?currency_pair_id=1
 +
|----
 +
|/api/getTrades
 +
|/api/trades.php?currency_pair_id=1
 +
|----
 +
|/api/getDepth.php
 +
|/api/depth.php?currency_pair_id=1
 +
|----
 +
|/api/getDepth
 +
|/api/depth.php?currency_pair_id=1
 +
|}
 +
 +
 +
On error a json dictionary will be returned with 'error' set to the error.
 +
 +
Example {'error':'missing api key'}
 +
 
=== Data API ===
 
=== Data API ===
  
Line 7: Line 38:
 
* 4 = BTC:PLN
 
* 4 = BTC:PLN
  
* https://intersango.com/api/ticker.php
+
{| class="wikitable"
* https://intersango.com/api/trades.php
+
|-
* https://intersango.com/api/depth.php
+
! URL !! Description !! Parameters !! Return Values
 +
|----
 +
| https://intersango.com/api/ticker.php
 +
|
 +
|
 +
|
 +
|----
 +
| https://intersango.com/api/trades.php
 +
|
 +
|
 +
Filters
 +
* currency_pair_id
 +
* last_trade_id
 +
* last_trade_time
 +
| if currency_pair_id not specified the return value is a dict indexed by the currency pair ids<br/>
 +
if currency_pair_id is specified than an array is returned
 +
|----
 +
| https://intersango.com/api/depth.php
 +
|
 +
|
 +
|
 +
|}
  
 
=== Authenticated API ===
 
=== Authenticated API ===
Line 16: Line 68:
  
 
All API calls are POST and must include the api key as api_key
 
All API calls are POST and must include the api key as api_key
 
https://intersango.com/api/authenticated/v0.1/
 
  
 
All return values are json encoded.  All decimal values are sent as strings.
 
All return values are json encoded.  All decimal values are sent as strings.
  
On error a json dictionary will be returned with 'error' set to the error.
+
The base url for all calls is
 
+
https://intersango.com/api/authenticated/v0.1/
Example {'error':'missing api key'}
 
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 89: Line 138:
 
|account_id order_id
 
|account_id order_id
 
|dict with 'result' set to 'success'
 
|dict with 'result' set to 'success'
 +
|----
 +
|cancelWithdrawalRequest.php
 +
|Cancel request to withdrawal funds
 +
|account_id withdrawal_request_id
 +
|dict with 'result' set to 'success'
 +
|}
 +
 +
===Withdrawing and Depositing===
 +
Withdrawing and depositing BTC is not possible using the official API, but it is possible by impersonating a web-browser. See [[Ad-hoc transfers]]

Revision as of 10:34, 23 September 2011

common information

To maintain backwards compatibility the following britcoin.co.uk urls are rewritten

/api/ticker.php /api/ticker.php?currency_pair_id=1
/api/ticker /api/ticker.php?currency_pair_id=1
/api/getTrades.php /api/trades.php?currency_pair_id=1
/api/getTrades /api/trades.php?currency_pair_id=1
/api/getDepth.php /api/depth.php?currency_pair_id=1
/api/getDepth /api/depth.php?currency_pair_id=1


On error a json dictionary will be returned with 'error' set to the error.

Example {'error':'missing api key'}

Data API

currency_pair_id is an optional GET parameter to all data api calls

  • 1 = BTC:GBP
  • 2 = BTC:EUR
  • 3 = BTC:USD
  • 4 = BTC:PLN
URL Description Parameters Return Values
https://intersango.com/api/ticker.php
https://intersango.com/api/trades.php

Filters

  • currency_pair_id
  • last_trade_id
  • last_trade_time
if currency_pair_id not specified the return value is a dict indexed by the currency pair ids

if currency_pair_id is specified than an array is returned

https://intersango.com/api/depth.php

Authenticated API

Version 0.1

All API calls are POST and must include the api key as api_key

All return values are json encoded. All decimal values are sent as strings.

The base url for all calls is https://intersango.com/api/authenticated/v0.1/

Relative URL Description Parameters Return Values
listAccounts.php Accounts. No parameters. array of accounts
  • id
  • balance
  • outstanding_total
  • currency_abbreviation
  • currency_id
  • reference_code
listOrders.php List orders for an account. account_id array of orders
  • id
  • selling
  • rate
  • quantity
  • outstanding
  • base_account_id
  • quote_account_id
  • currency_pair_id
  • fulfilled
  • placed
  • processed
  • expire
  • cancelled
  • partial
  • immediate
listDeposits.php Deposits for an account account_id array of deposits
  • account_id
  • amount
  • deposit_id
listWithdrawalRequests.php Withdraws for an account. account_id array of withdrawal request
placeLimitOrder.php Place limit order.
  • quantity
  • rate
  • selling "true" or "false"
  • base_account_id
  • quote_account_id
order_id
requestCancelOrder.php Request that an order be cancelled.

Orders are not guaranteed to have been cancelled
until the cancelled property of the order is the time it was cancelled.

account_id order_id dict with 'result' set to 'success'
cancelWithdrawalRequest.php Cancel request to withdrawal funds account_id withdrawal_request_id dict with 'result' set to 'success'

Withdrawing and Depositing

Withdrawing and depositing BTC is not possible using the official API, but it is possible by impersonating a web-browser. See Ad-hoc transfers