The API is still in its early development phase. New functions are being added as we speak.

API Calls

The API supports the following formats
  • JSON
  • XML
The following API calls are available:
API Call Input Output Description
get_security_info ticker ticker
name
currency
number_public_shares
highest_bid
lowest_ask
last_price
volume_24h
volume_5d
volume_30d
Returns a range of information about the security. NOTE: this function caches its answers for a period of 1 Minute, hence returned values might be upto 1 Minute old.
get_securities_info List of ticker symbols with parameter name starting with ticker Same as get_security_info Returns a the same info as the API call get_security_info but for a number of securities if the paranmeter ticker is passed or for all securities if no parameter is passed.
The call the function for e.g. 3 ticker symbols AAA, BBB and CCC use the following
ticker1=AAA;ticker2=BBB;ticker3=CCC
To API function looks for parameters passed that start with the text "ticker", note that the parameter names must be unique.
NOTE: this function caches its answers for a period of 1 Minute, hence returned values might be upto 1 Minute old.
get_list_of_securities currency ticker
name
currency
Returns a list of all securities listed under the specified currency. If no currency is passed as argument, then all securities are returned. NOTE: this function caches its answers for a period of 1 Minute, hence returned values might be upto 1 Minute old.
get_dividend_for_security ticker
One of the following:
days
after_id
after_timestamp
ticker
name
currency
Returns a list of all dividends matching the selection criteria.
get_orderbook ticker ticker
Array of:
quantity,unitprice
Returns the complete orderbook of a security.
get_history_last_50 ticker ticker
Array of:
created at, otype,quantity, unitprice
Returns the last 50 order executions. Otype=0 for buy, Otype=1 for sell.
You need to add the requested format at the end of the function call, e.g.:
https://cryptostocks.com/api/get_security_info.xml?ticker=ABC


Trading API

The trading API is a set of API calls that will allow you to inquire your balances as well as buy and sell shares.

API Call Input Output Description Token calculation
get_coin_balances account
id
token
timestamp
error_number
error_text
timestamp
token
function
account
currencies[]
for each currency: balance, availablebalance, name
Returns a range of information about the security Input token: YourSecurityWord;YoureMailAddress;Timestamp;ID;get_coin_balances
Output token: YourSecurityWord;YoureMailAddress;Timestamp;get_coin_balances
get_share_balances account
id
token
timestamp
error_number
error_text
timestamp
token
function
account
tickers[]
for each ticker: balance, availablebalance
Returns a list of shares owned. Input token: YourSecurityWord;YoureMailAddress;Timestamp;ID;get_share_balances
Output token: YourSecurityWord;YoureMailAddress;Timestamp;get_share_balances
create_order account
id
token
timestamp
ticker
quantity
unitprice
validtill
ordertype
error_number
error_text
timestamp
token
function
account
ticker
quantity
unitprice
validtill
ordertype
ordernumber
Creates an order.

Orderype
0 = buy order
1 = sell orders

Valid till
The format must be in YY-MM-DD. The system will automatically set the validity to 23:59 on that day
Input token: YourSecurityWord;YoureMailAddress;Timestamp;ID;create_order;
ticker;quantity;unitprice;validtill;ordertype
Output token: YourSecurityWord;YoureMailAddress;Timestamp;create_order;
ticker;quantity;unitprice;validtill;ordertype
read_order account
id
token
timestamp
ordernumber
error_number
error_text
timestamp
token
function
account
ordernumber
quantity
unitprice
ostatus
openquantity
ordertype
validtill
ticker
Reads an order.

Orderype
0 = buy order
1 = sell orders

Ostatus
0 = order is open
1 = order is closed/deletedexpired
Input token: YourSecurityWord;YoureMailAddress;Timestamp;ID;read_order;
ordernumber
Output token: YourSecurityWord;YoureMailAddress;Timestamp;read_order;
ordernumber,quantity,openquantity,unitprice,ostatus,otype,validtill
read_orders account
id
token
timestamp
error_number
error_text
timestamp
token
function
account
ordernumbers []
List of order numbers of all open orers

Input token: YourSecurityWord;YoureMailAddress;Timestamp;ID;read_orders
Output token: YourSecurityWord;YoureMailAddress;Timestamp;read_orders;"list of order numbers separated by ;"
Note, if no order number is returned, then there is no trailing ;
delete_order account
id
token
timestamp
ordernumber
error_number
error_text
timestamp
token
function
account
ordernumber
Deletes an order.

Input token: YourSecurityWord;YoureMailAddress;Timestamp;ID;delete_order;
ordernumber
Output token: YourSecurityWord;YoureMailAddress;Timestamp;delete_order;
ordernumber

Details on the input parameters:

ParameterDescription
accountYour eMail address
idAny value. The ID value cannot be reused within a period of 10 minutes. This is to safeguard against accidental double postings as well as URL replays by malicious sources.
tokenA SHA2 hash across a number of input values. See below details on how to calculate it.
timestampA UTC timestamp, must be within 5 minutes of the current time

Timestamps

The timestamp or date format can bei either in UNIX timestamp or in the format yyyy-mm-ddThh:mm:ss+h2:m2 with h2:m2 being the GMT offset. Note the T between the date and time. If you pass a UNIX timestamp then the API will return with a Unixtimestamp, if you use the date/time format, then the API will return with date/time foramt.


Calculation of the Token

The token is calculated by concatenating the input parameters, separated by a semicolon and then calculating a SHA2 hash over the complete string. See the column "Token calculation" in the above function API list for the required fields that need to be included to calculate the hash.

Note, that when calculating the token for the outputstring then you must use the timestamp that is being returned by the API, this will be most likely different from the timestamp that you had supplied.


Frequency for API calls:Please do not call the API more than once a Minute. If you are planning to build a trading bot that requires more frequent calls then please contact us.

List of error codes

Error numberDescription
100Security does not exist
101Insufficient funds
102Insufficient number of shares available
200Unknown transaction type
701Valid till must be at least 1 day from today
7100Order cannot be placed for delisted securities
4000Unknown ticker
4001Authentication failed
4002API function is not activated
4003Parameter missing
4004User is banned from using the API
4005Timestamp not within +/- 5 minute interval
4006ID was used within the last 10 minutes
4007Order does not exist
4008Order is not yours
4009Order is already closed
 
Twitter Facebook Delicious Feed

Trading Volume

BTC
7 day volume127.00
30 day volume874.25
Market cap.41,287.19
LTC
7 day volume11.30
30 day volume230.14
Market cap.7,494.56
DVC
7 day volume2,514,154.42
30 day volume27,364,405.38
Market cap.1,277,115,944.22
Total in BTC
7 day volume127.00
30 day volume874.25
Market cap.41,287.19