API Documentation

folio.ninja API Details

folio.ninja provides the following API's free of charge to the public and registered users. Any misuse of this API will result in the removal of your access. Examples provided below are using standard linux curl utility. It should be simple to port these API requests to your native language.

Versioning

The API is versioned for backwards compatibility. To access the API you must specifiy a version in the URL.

Currently the following version(s) exist: v1

Usage

API's are strucuted into three distinct components. Version, Endpoint and Arguments.

The API supports both GET and POST methods.

Each endpoint documented below will describe all applicable version(s), endpoint, arguments, and request methods allowed.

To access the API, use the following URL structure:

"https://www.folio.ninja/api/<version>/<endpoint>?<arguments>"

Authentication

Some API endpoints require authentication using an API Key. API Keys can be obtained on the My Account page when logged in. You must specifiy your API key as an argument of the request.

Rate Limiting

Excess usage of the API may result in your IP being rate limited.

As a rule of thumb, please try and keep requests limited to a maximum of 2 requests per second (120 per minute) from a single source.

If you have been rate limited, we'll return a HTTP 429 response code.

API Endpoints

Get Markets

Returns all markets listed on folio.ninja as a JSON array.

Each market returns a Market ID, the Exchange the market is listed on, a Name, and the Base and Quote currencies.

Usage

  • Authentication RequiredNo
  • Compatible Version(s)v1
  • Endpointmarkets
  • ArgumentsNone
  • ResponseJSON Object

Example Request

curl "https://www.folio.ninja/api/v1/markets"

Example Response

[
    {
        "marketId": "1",
        "exchange": "CoinJar",
        "name": "BTCAUD",
        "base": "BTC",
        "quote": "AUD"
    },
    {
        "marketId": "2",
        "exchange": "CEX.io",
        "name": "ETHBTC",
        "base": "ETH",
        "quote": "BTC"
    }
]

Current Price Data

Returns the current bid, mid and ask prices for the requested marketId.

Usage

  • Authentication RequiredNo
  • Compatible Version(s)v1
  • Endpointprice
  • ArgumentsmarketId
  • ResponseJSON Object

Example Request

curl "https://www.folio.ninja/api/v1/price?marketId=1"

Example Response

{
    "bid": "$3,287.11 AUD",
    "mid": "$3,320.31 AUD",
    "ask": "$3,353.51 AUD"
}

Current Mid Price

Returns the current mid price for the requested marketId in plain text.

Usage

  • Authentication RequiredNo
  • Compatible Version(s)v1
  • Endpointcurrent
  • ArgumentsmarketId
  • ResponseText

Example Request

curl "https://www.folio.ninja/api/v1/current?marketId=1"

Example Response

3322.35

Quote Estimator

Attempts to provide a quote for a number of a certain asset represented as another. For example, if you wanted to know how much 42 Monero are worth represented as Australian Dollars, you could use this API. If no natural market exists for the base and quote pair, we will attempt to convert through a secondary market. IE: There are no native XMRAUD markets. So the API will find a market that exists for XMR and also AUD. ie: XMRBTC -> BTCAUD.

Note: This does not factor in trading fees or transaction fees.

Usage

  • Authentication RequiredNo
  • Compatible Version(s)v1
  • Endpointquote
  • Argumentsbase, quote, amount
  • ResponseJSON Object

Example Request

curl "https://www.folio.ninja/api/v1/quote?base=XMR&quote=AUD&amount=42"

Example Response

{
    "request": {
        "baseCurrency": "XMR",
        "baseAmount": "42",
        "quoteCurrency": "AUD"
    },
    "response": {
        "conversionRounds": "1",
        "providedBy": "Poloniex(XMRBTC) -> CoinJar(BTCAUD)",
        "quote": 2372.1205662
    }
}

Example Error Response

{
    "request": {
        "baseCurrency": "XMR",
        "baseAmount": "42",
        "quoteCurrency": "AUD"
    },
    "response": {
        "error": "unable to provide quote"
    }
}

Profit Summary

Provides your profit summary on the selected currencies represented as the quote price.

Usage

  • Authentication RequiredYes
  • Compatible Version(s)v1
  • Endpointprofitsummary
  • ArgumentsuserId, apiKey, currencies (CSV of currencies), quote
  • ResponseText

Example Request

This example shows the demo users profit for all ETH and BTC investments represented as AUD.

Note: The API key shown in the example request below is from a demonstration account. This API Key should not be used for any production workloads!

curl "https://www.folio.ninja/api/v1/profitsummary?userId=27&apiKey=ROVUM4DP9SJHEAM16CX35HUWZMPO01KS&currencies=ETH,BTC&quote=AUD"

Example Response

245,831.53

Example Error Response

"Invalid API Credentials"