Export a chart's data and query
Download the points of a Real-Time Metrics chart as a CSV file, or copy its GraphQL query and run it in the GraphiQL Playground or with curl.
You can export the points of a Real-Time Metrics chart, or copy its GraphQL query, from the chart menu in Azion Console. A copied query runs in the GraphiQL Playground or with curl. To narrow the data before you export it, refer to Filter a Real-Time Metrics dashboard.
The examples on this page use the Edge Cache chart of the Data Transferred dashboard, under Build › Applications.
Prerequisites
- Access to Azion Console. To sign in, refer to How to access Azion Console.
- A chart with data in the selected time range. To read your first numbers, refer to Real-Time Metrics quickstart.
- A personal token and
curl, to send a copied query from a terminal. To create a token, refer to How to manage a personal token.
Export a chart’s points as CSV
Export CSV downloads the points of one chart as a comma-separated values (CSV) file. The file covers the time range and the filters set in the filter row.
To export a chart in Azion Console:
Access Azion Console > Real-Time Metrics.
Select the category, the product tab, and the dashboard. For example, select Build, Applications, and Data Transferred.
The file holds only the points that the range and the filters select. For each control, refer to Filters and time range.
In the chart card, select the menu button, labeled More options.
The browser downloads a file named after the chart, such as Edge Cache.csv.
On a time chart, the file holds one line per point that the chart plots. The first line names the columns: ts, then one column per series, named after its field. For Edge Cache, the first line reads ts;dataTransferredTotal;dataTransferredOut;dataTransferredIn.
Each following line holds the time of one point, such as 10/02/2026, 11:15:00 AM, then the value of each series. The values carry no unit: the Edge Cache columns are in bytes. For the separator and date rules, refer to Export CSV.
Copy a chart’s query
Copy query puts the GraphQL query of one chart and its variables on the clipboard. The menu item opens nothing, so you paste the text where you want to run it.
To copy the query in Azion Console:
Access Azion Console > Real-Time Metrics.
Select the category, the product tab, and the dashboard. For example, select Build, Applications, and Data Transferred.
In the chart card, select the menu button, labeled More options.
The clipboard holds the chart’s query for the time range and the filters of the dashboard. For the Edge Cache chart over 24 hours, the text reads:
The text is in two parts. Under # QUERY, the query reads the range from the variables $tsRange_begin and $tsRange_end. Under # VARIABLES, a JSON object holds their values. Each filter applied on the dashboard adds variables of its own. The query does not run without its variables, so each part goes to its own place.
Run the copied query
A copied query calls the API that the chart reads, https://api.azion.com/v4/metrics/graphql. You can run it in the GraphiQL Playground or send it with curl.
Run the query in the GraphiQL Playground
The GraphiQL Playground takes the query and its variables in two separate panes.
To run the copied query in the GraphiQL Playground:
To reach it, refer to GraphiQL Playground.
In the query editor, paste the copied text from # QUERY up to the line before # VARIABLES.
In the variables pane, paste the JSON object that follows # VARIABLES.
The playground sends the query with its variables and returns the rows of the chart as JSON.
Send the query with curl
To send a copied query with curl, put the query on one line in the query key of the body. Put the JSON object that follows # VARIABLES in the variables key. To read another period, change tsRange_begin and tsRange_end.
Replace [TOKEN VALUE] with your personal token, and send the request:
The API answers 200 with one row per minute that has traffic, oldest first:
The dataTransferredTotal values of the rows add up to the same 24-hour total that the Real-Time Metrics quickstart reads for the range. The API leaves out the minutes with no traffic, such as 13:05, which the chart plots as zero.
For every field of the httpMetrics dataset, refer to Real-Time Metrics GraphQL fields.