stats_service

Get result by sql query id

get/api/v1/services/stats/query/{id}

Path parameters

idstring required
Example:03cfc582-b1c3-410a-a9a7-1f3afe326b3b

Query ID

Response

Query result

idstring required
namestring
status'executing' | 'success' | 'error' required
type'graph' | 'base_query' | 'chat_gpt_query'
urlstring
meta_urlstring
spent_timeinteger
last_repeat_dateinteger
total_repetitionsinteger
total_usd_costnumber
usd_costnumber
errorstring
all_data_in_previewboolean
testnetboolean required
is_gptboolean
date_createinteger required

Example response

{
  "id": "03cfc582-b1c3-410a-a9a7-1f3afe326b3b",
  "name": "test query",
  "query": {
    "name": "test query",
    "sql": "select id from accounts limit 1",
    "gpt_message": "give me random id from accounts table",
    "repeat_interval": 10
  },
  "url": "https://sql.io/123.csv",
  "meta_url": "https://sql.io/123_meta.csv",
  "spent_time": 100,
  "last_repeat_date": 1690889913000,
  "total_repetitions": 5,
  "total_usd_cost": 1000000000,
  "usd_cost": 1000000000,
  "error": "invalid something",
  "date_create": 1690889913000
}

Changes

Changed in 11 of the 50 revisions of this API.3321

  • 356252841f50123See the full diff
    • removed the required property estimate/approximate_cost from the response with the 200 status

      response-required-property-removed

    • removed the optional property cost from the response with the 200 status

      response-optional-property-removed

    • removed the optional property total_cost from the response with the 200 status

      response-optional-property-removed

    • added the optional property total_usd_cost to the response with the 200 status

      response-optional-property-added

    • added the optional property usd_cost to the response with the 200 status

      response-optional-property-added

    • added the required property estimate/approximate_usd_cost to the response with the 200 status

      response-required-property-added

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the optional property name to the response with the 200 status

      response-optional-property-added

    • added the optional property query/name to the response with the 200 status

      response-optional-property-added

    • added the required property testnet to the response with the 200 status

      response-required-property-added

    • added the new chat_gpt_query enum value to the type response property for the response status 200

      response-property-enum-value-added

    • added the optional property last_repeat_date to the response with the 200 status

      response-optional-property-added

    • added the optional property total_cost to the response with the 200 status

      response-optional-property-added

    • added the optional property total_repetitions to the response with the 200 status

      response-optional-property-added

    • added the optional property estimate/explain to the response with the 200 status

      response-optional-property-added

    • added the optional property is_gpt to the response with the 200 status

      response-optional-property-added

    • added the optional property query/gpt_message to the response with the 200 status

      response-optional-property-added

    • added the optional property query/repeat_interval to the response with the 200 status

      response-optional-property-added

    • added the optional property all_data_in_preview to the response with the 200 status

      response-optional-property-added

  • e1eca95dfdb611See the full diff
    • the spent_time response's property type/format changed from integer/int32 to integer/int64 for status 200

      response-property-type-changed

    • added the optional property preview to the response with the 200 status

      response-optional-property-added