Overview

Run query

Query

This endpoint allows you to query data stored in any edge deployment, but query results are routed through the US East 1 (AWS) deployment. This means that if you store data in an edge deployment other than US East 1 (AWS), query results leave the edge deployment where your data is stored. For more information, see Edge deployments.

The base domain for this endpoint is https://api.axiom.co, irrespective of your edge deployment.

To query data without results leaving the edge deployment where your data is stored, use the Run APL query to edge deployment or Run batch query to edge deployment endpoints.

POST/v1/datasets/_apl
Features

Send the token in the Authorization: Bearer API_TOKEN header. See Tokens for which token types this endpoint accepts.

Input11
Authorizationheaderrequired
Sent from your browser straight to the API — never to Docsbook, never stored.
formatstring · bodyrequired
(query)
nocacheboolean · body
(query)
saveAsKindstring · body
(query)
dataset_namestring · body
(query) When saveAsKind is true, this parameter indicates the name of the associated dataset.
aplstring · bodyrequired
APL query to execute. For more information, see Introduction to APL.
cursorstring · body
endTimestring · body
includeCursorboolean · body
queryOptionsobject · body
Show child attributes22
againststring
againstStartstring
againstTimestampstring
aggChartOptsstring
caseSensitivestring
containsTimeFilterstring
datasetsstring
displayNullstring
editorContentstring
endColumnstring
endLineNumberstring
endTimestring
integrationsFilterstring
openIntervalsstring
quickRangestring
resolutionstring
shownColumnsstring
startColumnstring
startLineNumberstring
startTimestring
timeSeriesVariantstring
timeSeriesViewstring
startTimestring · body
start and end time for the query, these must be specified as RFC3339 strings or using relative time expressions (e.g. now-1h, now-1d, now-1w, etc)
variablesobject · body
Variables is an optional set of additional variables that are inserted into the APL
Output8
bucketsobject
datasetNamesstring[]
fieldsMetaMapobject
FieldsMetaMap contains the unit information (if we have it) for each field in the given dataset entry
formatstring
Format specifies the result set format. Either "legacy" (default) or "tabular".
matchesobject[]
Matches hold the matching events of a filter query in the "legacy" result format
requestobject
statusobject
tablesobject[]
Tables hold the result tables in the "tabular" result format
Responses
200Successful APL result
403Forbidden
Example input
curl -X POST 'https://api.axiom.co/v1/datasets/_apl' \
  -H 'Authorization: Bearer API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"format":"tabular","apl":"[\"dataset-name\"] | limit 10"}'
Example output
{
  "format": "tabular",
  "status": {
    "elapsedTime": 260650,
    "minCursor": "0d8q6stroluyo-07c3957e7400015c-0000c875",
    "maxCursor": "0d8q6stroluyo-07c3957e7400015c-0000c877",
    "blocksExamined": 4,
    "blocksCached": 0,
    "blocksMatched": 0,
    "rowsExamined": 197604,
    "rowsMatched": 197604,
    "numGroups": 0,
    "isPartial": false,
    "cacheStatus": 1,
    "minBlockTime": "2025-03-26T12:03:14Z",
    "maxBlockTime": "2025-03-26T12:12:42Z"
  },
  "tables": [
    {
      "name": "0",
      "sources": [
        {
          "name": "dataset-name"
        }
      ],
      "fields": [
        {
          "name": "_sysTime",
          "type": "datetime"
        },
        {
          "name": "_time",
          "type": "datetime"
        },
        {
          "name": "content_type",
          "type": "string"
        }
      ],
      "order": [
        {
          "field": "_time",
          "desc": true
        }
      ],
      "groups": [],
      "range": {
        "field": "_time",
        "start": "1970-01-01T00:00:00Z",
        "end": "2025-03-26T12:12:43Z"
      },
      "columns": [
        [
          "2025-03-26T12:12:42.68112905Z",
          "2025-03-26T12:12:42.68112905Z",
          "2025-03-26T12:12:42.68112905Z"
        ],
        [
          "2025-03-26T12:12:42Z",
          "2025-03-26T12:12:42Z",
          "2025-03-26T12:12:42Z"
        ],
        [
          "text/html",
          "text/plain-charset=utf-8",
          "image/jpeg"
        ]
      ]
    }
  ],
  "datasetNames": [
    "dataset-name"
  ],
  "fieldsMetaMap": {
    "dataset-name": [
      {
        "name": "status",
        "type": "",
        "unit": "",
        "hidden": false,
        "description": "HTTP status code"
      },
      {
        "name": "resp_header_size_bytes",
        "type": "integer",
        "unit": "none",
        "hidden": false,
        "description": ""
      },
      {
        "name": "geo.city",
        "type": "string",
        "unit": "",
        "hidden": false,
        "description": "the city"
      }
    ]
  }
}

Updated

Was this page helpful?