Skip to main content

Parameters in URLs

Input values for filters can be specified as URL query parameters, e.g. for viewing a dashboard. Especially for embedded dashboards, it can be necessary or useful to construct URLs to dashboards with specific filter values pre-selected. This page describes how values for built-in and custom filters are encoded as parameters in the URL.

Built-in Date-Time Aggregation

Input values for the built-in aggregation filter are encoded as a URL query parameters of the form aggregation=<value>, with the possible values being second, minute, hour, day, week, month, quarter and year. The following links illustrate this parameter:

Built-in Date-Time Range

Input values for the built-in timerange filter are encoded as URL query parameters of the form timerange=<value>, with the the value being an absolute or a relative date-time range.

Absolute Range

Absolute date-time ranges are encoded as <unix_timestamp_start>~<unix_timestamp_end>, with both start and end being optional. In other words, ~ is the unbounded time range, ~1679917838 a time range with only an upper bound and 1679917838~ a time range with only a lower bound. A few example URLs:

Relative Range

Relative date-time ranges are encoded in one of the following forms.

Last n (full) units: <number>_full_<unit>

Last n units (ending now): <number>_<unit>:

This full unit: thisfull_<unit>

This unit (ending now): this_<unit>

Previous unit: previous_<unit>

Custom Filters

All input values for custom filters are included in a URL as a URL-encoded JSON structure:

{
"filter_1": ["filter_value_1", "filter_value_2", ...],
"filter_2": [1, 2, ...],
...
}

In JavaScript, the URL-encoding can be obtained via encodeURIComponent, e.g.

encodeURIComponent('{"countries":["United States","Canada"],"origin_airports":["LAX"]}')

yields the string

"%7B%22countries%22%3A%5B%22United%20States%22%2C%22Canada%22%5D%2C%22origin_airports%22%3A%5B%22LAX%22%5D%7D"