Time Series
Fetch ready-to-chart time series data.
Use cases
Time Series visualization
Visualize time series data in your apps.
In-app sparklines
Create inline visualizations in your apps.
Features
All the common API features, plus:
Aggregate data by time granularities
Aggregate data by time granularities
Aggregate data by various time granularities.
Available granularities:
MINUTE
: Aggregates values by minute intervalsFIVE_MINUTES
: Aggregates values by 5-minute intervalsTEN_MINUTES
: Aggregates values by 10-minute intervalsFIFTEEN_MINUTES
: Aggregates values by 15-minute intervalsHOUR
: Aggregates values by hourly intervalsDAY
: Aggregates values by daily intervalsWEEK
: Aggregates values by weekly intervalsMONTH
: Aggregates values by monthly intervalsYEAR
: Aggregates values by yearly intervals
Group results by columns
Group results by columns
Group results by specific columns.
Zero-fill missing data points
Zero-fill missing data points
Automatically zero-fills missing data points to ensure consistent time series.
Timezone-aware time granularities
Timezone-aware time granularities
Calculates time series granules for the given time zone, allowing for accurate representation of data across different geographical locations.
Example
Example 1: Simple time series query
Get the total taco sales for the last 3 days, filtered by the restaurant name.
Usage
Arguments
The fields for querying a Metric in time series format.
A Metric’s time series query returns the values over a given time range aggregated by a given time granularity; day, month, or year, for example.
The Metric to Query. It can be a pre-created one or it can be inlined here.
The time range for calculating the time series.
The time zone to use. Dates and times are always returned in UTC, but setting the time zone influences relative time ranges and granularities.
You can set this to “America/Los_Angeles”, “Europe/Berlin”, or any other value in the IANA time zone database. Defaults to “UTC”.
The time granularity (hour, day, month, etc.) to aggregate the Metric values by.
The Query Filters to apply before retrieving the time series data, in the form of SQL. If no Query Filters are provided, all data is included.
Columns to group by.
Response
The time series response object. It contains an array of time series labels and an array of Metric values for the given time range and Query Filters.
The time series labels.
The time series values.
The time series values for each group in groupBy
, if specified.
The Query statistics and metadata.