Get query results

Endpoint to get query results for a finished query. Please also see async queries.

GET https://api.supermetrics.com/enterprise/v2/query/results
  • api_key string
    Conditional. API key when not using an authorization header. See authentication for more.
  • schedule_id string
    Required. Schedule ID for the query.
  • offset int
    Optional. Pagination offset for the number of result rows to return. Defaults to 0. Relevant only when query output format supports pagination.
  • limit int
    Optional. Maximum number of result rows to return. Defaults to none. Relevant only when query output format supports pagination.

Request

GET https://api.supermetrics.com/enterprise/v2/query/results?json={
    "api_key": "<api key>",
    "schedule_id": "<query schedule id>"
}

Response

Endpoint responds with HTTP status code 200 OK for queries that have been performed with the given API key, have finished successfully, and have results still available. All other requests respond with error code QUERY_RESULTS_UNAVAILABLE.

Results are delivered according to the originally requested output format. For example, if query requested data in CSV format, then this endpoint replies with content type header text/csv and provides data for that format. See all supported output formats.

Expiry of results

By default, results can be retrieved up to 1 hour after query process has finished successfully. This is counted from the moment query status changes from RUNNING into SUCCESS.

Best practices

  • Please do not poll for results. If query does not succeed, results will remain unavailable indefinitely. Poll query status from the status endpoint instead.

Errors

StatusErrorDescription
404QUERY_RESULTS_UNAVAILABLENo results found for this query.
Last updated 2022-09-14 UTC.