Base URL

https://www.cfbenchmarks.com/api/v1/

Authorization

This API requires users to specify an API key. This key can be obtained by contacting CF Benchmarks for a license.

Once given a username and key, you would provide both in the request header with a header field of the form Authorization: Basic <credentials> where credentials is the Base64 encoding of the username and key joined by a single colon ':'.

Values
Request

Path: /api/v1/values

Parameters:

  • id=[ String ] Required. ID of stream.

Example: https://www.cfbenchmarks.com/api/v1/values?id=BRTI

Response

Will return the most recent values in ascending order of time (10 minutes for RTIs and 1 year for RRs).

Each value object is composed as follows:

  • value Published index value.
  • time Milliseconds since Unix epoch.
{
  "serverTime": "2019-08-13T23:27:03.170Z",
  "payload": [
    {
      "value": "10855.99",
      "time": 1565739760000
    },
    {
      "value": "10856.06",
      "time": 1565739761000
    }
  ]
}
Stats
Request

Path: /api/v1/stats

Parameters:

  • id=[ String ] Mandatory. ID of stream. Must be a reference rate.
  • streamtype=[ String ] Mandatory. Type of stream. Must be one of volume, weight.

Example: https://www.cfbenchmarks.com/api/v1/stats?id=BRR&streamtype=volume

Response (volume)

Will return the most recent volume records in ascending order of time. Note that the volume exchanges may not add up exactly to 100 due to the effects of rounding.

{
  "serverTime": "2019-08-13T23:27:03.170Z",
  "payload": [
    {
      "value": "10856.29",
      "time": 1565739900000,
      "volume": "123.45",
      "volumes": {
        "bitstamp": {
          "volumePercent": "58.21"
        },
        "coinbase": {
          "volumePercent": "7.70"
        },
        "gemini": {
          "volumePercent": "7.73"
        },
        "itbit": {
          "volumePercent": "24.61"
        },
        "kraken": {
          "volumePercent": "2.26"
        }
      }
    }
  ]
}
Response (weight)

Will return the most recent basket weight records in ascending order of time. Note that the weights may not add up exactly to 100 due to the effects of rounding.

{
  "serverTime": "2020-09-11T08:47:39.031Z",
  "payload": [
    {
      "time": 1599814058000,
      "value": "1313.31",
      "weights": {
          "BCH": {
              "weightPercent": "1.37"
          },
          "ETH": {
              "weightPercent": "18.93"
          },
          "LTC": {
              "weightPercent": "1.52"
          },
          "XBT": {
              "weightPercent": "74.75"
          },
          "XRP": {
              "weightPercent": "3.44"
          }
      }
    }
  ]
}
Summary
Request

Path: /api/v1/summary

Parameters:

  • id=[ String ] Required. ID of stream.

Example: https://www.cfbenchmarks.com/api/v1/summary?id=BRTI

Response

Will return a summary of the given stream.

The summary object is composed as follows:

  • value Most recently published index value.
  • time Milliseconds since Unix epoch of value.
  • last24Hours Value and time for each of the last published values over the last 24 hours.
{
    "payload": {
        "last24Hours": [
            {
                "value": "9093.68",
                "time": 1583406000000
            },
            {
                "value": "9111.76",
                "time": 1583409600000
            },
            {
                "value": "9086.05",
                "time": 1583413200000
            },
            {
                "value": "9094.99",
                "time": 1583416800000
            },
            {
                "value": "9041.78",
                "time": 1583420400000
            },
            {
                "value": "9099.04",
                "time": 1583424000000
            },
            {
                "value": "9101.01",
                "time": 1583427600000
            },
            {
                "value": "9112.52",
                "time": 1583431200000
            },
            {
                "value": "9129.84",
                "time": 1583434800000
            },
            {
                "value": "9168.75",
                "time": 1583438400000
            },
            {
                "value": "9131.45",
                "time": 1583442000000
            },
            {
                "value": "9116.60",
                "time": 1583445600000
            },
            {
                "value": "9074.97",
                "time": 1583449200000
            },
            {
                "value": "9068.55",
                "time": 1583452800000
            },
            {
                "value": "9003.90",
                "time": 1583456400000
            },
            {
                "value": "9031.42",
                "time": 1583460000000
            },
            {
                "value": "9063.96",
                "time": 1583463600000
            },
            {
                "value": "9048.93",
                "time": 1583467200000
            },
            {
                "value": "9059.72",
                "time": 1583470800000
            },
            {
                "value": "9122.05",
                "time": 1583474400000
            },
            {
                "value": "9109.43",
                "time": 1583478000000
            },
            {
                "value": "9110.24",
                "time": 1583481600000
            },
            {
                "value": "9127.09",
                "time": 1583485200000
            },
            {
                "value": "9128.67",
                "time": 1583488800000
            }
        ],
        "value": "9141.73",
        "time": 1583495915000
    },
    "serverTime": "2020-03-06T11:58:36.518Z"
}
Latest Values
Request

Path: /api/v1/latest_values

Parameters:

  • id=[ String ] Required. ID(s) of stream. May contain up to 30 differents IDs, separates by commas.

Example: https://www.cfbenchmarks.com/api/v1/latest_values?id=BRR,BRTI

Response

Will return the latest values for the given stream(s).

The latest_values object is a map with an entry for each stream. In each case the value is composed as follows:

  • value Most recently published index value.
  • time Milliseconds since Unix epoch of value.
{
    "payload": {
        "latest_values": {
            "BRR": {
                "time": 1599750000000,
                "value": "10437.33"
            },
            "BRTI": {
                "time": 1599814290000,
                "value": "10291.07"
            }
        }
    },
    "serverTime": "2020-09-11T08:51:31.149Z"
}
Errors

Example: https://www.cfbenchmarks.com/api/v1/asdf

{
  "serverTime": "2019-08-13T23:30:53.992Z",
  "error": "api function was not found"
}