Time Series
This request type aggregates the entire set of shipment results for which the provided criteria matches, bounded by the start and end date provided and bucketed by the interval specified.
The available intervals are: week, month, quarter, or year.
The timeseries endpoint only calculates aggregate metrics for shipments.
If instead the desired result is values for specific shipment attributes during a time-period, it is recommended to use a record_date filter using a range constraint and make iterative requests while changing the date range to represent the desired interval.
Time Series Example
In this example, the count of shipment records, along with the total USD Value, is calculated for all shipments destined for the United States. The results are then bucketed by each month in 2020.
{
"data_source": "global",
"filters": {
"shipment_destinations": "United States"
},
// time series parameters
"min_date": "2020-01-01",
"max_date": "2020-12-31",
"interval": "month",
// metrics may be additionally specified and will be
// calculated for each time-interval as well
"metrics": [
{ "metric": "value_usd", op: "sum" }
]
}