Authorization and headers
The only expected header isAuthorization: Bearer
which is your token to authenticate the request. For more information, see Tokens.
Using Axiom Node.js library to query data
Axiom maintains the axiom-js to provide official Node.js bindings for the Axiom API. Install usingnpm install
:
eval $(axiom config export -f)
to configure your environment variables.
Otherwise, create an API token and export it as AXIOM_TOKEN
.
Create and use a client like this:
Querying via Curl using APL
This section provides a guide on how to leverage the power of APL through curl commands. By combining the flexibility of curl with the querying capabilities of APL, users can seamlessly fetch and analyze their data right from the terminal. Whether you’re looking to fetch specific data points, aggregate metrics over time, or filter datasets based on certain criteria, the examples provided here will serve as a foundation to build upon. As you become more familiar with APL’s syntax and curl’s options, you’ll find that the possibilities are vast and the insights you can derive are profound.Examples
Count of distinct routes
Top 5 routes by count
Average request duration
Requests with duration greater than 1 second
Top 3 routes with the highest average duration
Requests grouped by hour
Requests with errors
Getting the most common user agents
Identifying the server data centers with the highest number of requests
Identifying the average, minimum, and maximum request duration for each method type
Finding the top 3 URIs accessed via TLS connections with a response body size greater than a specified threshold
Calculating the 95th percentile of the request duration for each server datacenter
Active issue contributors
Top Issue Wranglers
Using Curl to query the API
POST api.axiom.co/v1/datasets/\{id\}/query