API Documentation | Data
The data extraction API is a (beta) read only endpoint to pull the values of a single data point for a given time range.
A string containing a data cid
One or more data structures as defined in the examples
The data endpoint provides a simple way to extact data from Circonus. Please note that this is a BETA API endpoint, and is subject to change without notice.
To extract data you need perform a HTTP GET request on the data cid.
This follows the format "
You must also provide the following parameters:
- The type of data you wish to extract. This must be
- The start time, in epoch seconds, of the duration you wish to export data from
- The end time, in epoch seconds, of the duration you wish to export data from
- For numeric and histogram types only, and not text. The resolution of
data you want to get back (in seconds), valid values are:
Extracting Numeric Metric Data
Numeric data uses objects to return the compiled statistics for the various datapoints:
For numeric data you may also optionally provide the following fields to format your output:
- The format of the data you wish to extract. This can be:
legacy- original format where each record is [<timestamp>, <object of values>] (see example below)
tuple- where each record is a JSON array of just numeric value fields with no field identifiers
object- where each record is a JSON object with field identifier.
- When format is not
legacythis will control which fields come back in the output and their order. Valid fields are listed under the first example below.
Extracting Histogram Metric Data
Histogram data uses objects to return the histogram information. The keys of the object are stringified numbers that represent the lower-bound of a bucket where the upper range is the next value expressible in base 10 with two digits of precision. (e.g "0.12" expresses [0.12,0.13) and "990" expresses [990, 1000))
Extracting Text Metric Data
Text data can be extracted in a similar way, but you do not pass the period parameter. The returned data structure only contains entries where the data changes