Learn how to use the Axiom API to query data.
This page explains how to query data via the Axiom API using the following:
For an introduction to the basics of the Axiom API and to the authentication options, see Introduction to Axiom API.
The API requests on this page use the query data endpoint. For more information, see the API reference.
To query data with cURL:
startTime
and endTime
. For more information, see the query data API reference.Content-Type
header to application/json
.Authorization
header to Bearer API_TOKEN
.https://AXIOM_DOMAIN/v1/datasets/_apl?format=tabular
.https://AXIOM_DOMAIN/v1/datasets/_apl?format=legacy
.Replace AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.
Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
Example response
Install and configure the Axiom Node.js library.
Build the APL query. For more information, see Introduction to APL.
Pass the APL query as a string to the axiom.query
function.
Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.
For more examples, see the examples in GitHub.
For more information on other libraries you can use to query data, see Send data.