Register Account

Cloud9Trader API

REST API

The REST API can be queried with standard HTTPS and returns JSON.

The base path for all endpoints is https://api.cloud9trader.com/v1/.


Authentication

To identify your requests you'll need to send your API key in a x-c9t-key header.

The API key can be generated in API Access section of your user settings. The REST API returns public data, so you do not need to send the API secret.


Get Currencies

List available currencies.

GET https://api.cloud9trader.com/v1/currencies

Plan Usage: 1 credit.

Response

Example:

[
    {
        "symbol": "USD",
        "name": "US Dollars"
    },
    {
        "symbol": "EUR",
        "name": "Euro"
    },
    {
        "symbol": "BTC",
        "name": "Bitcoin"
    },
    ...
]

Get Currency Rates

Returns current currency exchange rate and market data.

GET https://api.cloud9trader.com/v1/currency/<symbol>

Plan Usage: 1 credit per quote requested.

Path parameters

ParameterRequiredValues
symbol
The currency symbol
e.g. "BTC"

Query parameters

ParameterRequiredValues
quote
Comma-separated list of currencies to convert to. Defaults to "USD"
e.g. "USD,GBP,EUR"

Request

Example:

curl -H "x-c9t-key: acb383affb802a95" -G "https://api.cloud9trader.com/v1/currency/BTC?quote=USD,EUR,ETH"

Response

Example:

{
    "currency": "BTC",
    "name": "Bitcoin",
    "maxSupply": 21000000,
    "circulatingSupply": 18283137,
    "totalSupply": 18283137,
    "updated": "2020-03-23T14:00:00.000Z",
    "quotes": {
        "USD": {
            "price": 6159.73622,
            "percentChange24h": 1.593,
            "updated": "2020-03-23T13:59:59.874Z"
        },
        "EUR": {
            "price": 5708.21631,
            "percentChange24h": 0.8295,
            "updated": "2020-03-23T13:59:59.060Z"
        },
        "ETH": {
            "price": 47.62456,
            "percentChange24h": 1.3146,
            "updated": "2020-03-23T13:59:25.000Z"
        }
    }
}

Get Historical Currency Rates

Returns OHLC bars for historical currency exchange rates.

GET https://api.cloud9trader.com/v1/currency/<symbol>/historical

Plan Usage: 1 credit per 1000 bars returned.

Path parameters

ParameterRequiredValues
symbol
The currency symbol
e.g. "BTC"

Query parameters

ParameterRequiredValues
interval
The bar interval
"M1", "M2", "M5", "M10", "M15", "M30", "H1", "H2", "H4", "H8", "H12", "D1"
startDate
Range start (ISO 8601 format)
e.g. "2020-01-01T00:00:00.000Z"
endDate
Range end (ISO 8601 format)
e.g. "2020-01-04T00:00:00.000Z". Defaults to now.

Request

Example:

curl -H "x-c9t-key: acb383affb802a95" -G "https://api.cloud9trader.com/v1/currency/BTC/historical?interval=M1&start=2020-01-01"

Response

Example:

[
  {
    "time": "2020-01-01T00:00:00.000Z",
    "open": 6877.16151725,
    "high": 6877.16151725,
    "low": 6877.16151725,
    "close": 6877.16151725
  },
  ...
]

Get Instruments

Fetch configuration for all available instruments (tradeable markets) across exchanges.

GET https://api.cloud9trader.com/v1/instruments

Plan Usage: 1 credit.

Response

Example:

[
    {
        "id": "EUR_USD:OANDA",
        "broker": "OANDA",
        "symbol": "EUR_USD",
        "displaySymbol": "EUR/USD",
        "displayName": "EUR/USD",
        "product": "Forex",
        "productId": 1,
        "dealt": "EUR",
        "quote": "USD",
        "precision": 5,
        "pip": "0.0001",
        "pipSize": 0.0001,
        "pipPrecision": 1,
        "maxTradeUnits": 10000000,
        "maxQuantity": 10000000,
        "minTrailingStop": 5,
        "maxTrailingStop": 10000,
        "marginRate": 0.05,
        "contractMultiplier": 1,
        "factor": 1,
        "lotSize": 1
    },
    ...
]

Get Historical Price

Fetch historical price OHLC bars or recent tick data for market instruments.

GET https://api.cloud9trader.com/v1/historical?instrumentId=<instrumentId>&interval=<interval>&start=<startDate>&end=endDate

Plan Usage: 1 credit per 1000 bars returned, or 12 hours of raw tick data.

Query parameters

ParameterRequiredValues
instrumentId
The instrument ID
e.g. "BTCUSD:Bitfinex"
interval
The bar interval
"Tick", "M1", "M2", "M5", "M10", "M15", "M30", "H1", "H2", "H4", "H8", "H12", "D1"
startDate
Range start (ISO 8601 format)
e.g. "2020-04-02T00:00:00.000Z"
endDate
Range end (ISO 8601 format)
e.g. "2020-04-04T00:00:00.000Z". Defaults to now.

Request

Example:

curl -H "x-c9t-key: acb383affb802a95" -G "https://api.cloud9trader.com/v1/historical/instrumentId=BTCUSD:Bitfinex&interval=M15&start=2020-04-02T00:00:00.000Z"

Response

Responses are minified to reduce transfer sizes.

Example:

[
    [
        "2019-09-07T10:00:00.000Z", // Open time
        10880,                      // Open bid
        10892.17,                   // High bid
        10830.06,                   // Low bid
        10856.79,                   // Close bid
        10881.54,                   // Open ask
        10892.2,                    // High ask
        10832.13,                   // Low ask
        10859.24,                   // Close ask
        48732                       // Volume
    ],
    ...
]

Was this page useful? If you find any errors or have any questions please get in touch at support@cloud9trader.com.