---
title: "Get result by sql query id"
method: GET
path: "/api/v1/services/stats/query/{id}"
tags: ["stats_service"]
---

# Get result by sql query id

`GET /api/v1/services/stats/query/{id}`

## Path parameters

- `id` string, required

## Response `200`

Query result

- StatsQueryResult
  - `id` string, required
  - `name` string
  - `status` 'executing' | 'success' | 'error', required
  - `query` StatsQuery
    - `name` string
    - `addresses` string[]
    - `only_between` boolean
    - `sql` string
    - `gpt_message` string
    - `repeat_interval` integer — cyclic execution of requests
  - `type` 'graph' | 'base_query' | 'chat_gpt_query'
  - `estimate` StatsEstimateQuery
    - `approximate_time` integer, required
    - `approximate_usd_cost` number, required
    - `explain` string
  - `url` string
  - `meta_url` string
  - `spent_time` integer
  - `last_repeat_date` integer
  - `total_repetitions` integer
  - `total_usd_cost` number
  - `usd_cost` number
  - `error` string
  - `all_data_in_preview` boolean
  - `preview` array[]
    - string[]
  - `testnet` boolean, required
  - `is_gpt` boolean
  - `date_create` integer, required

## Other responses

- `400` — Something went wrong on client side
- `403` — Access token is missing or invalid
- `404` — The specified resource was not found
- `500` — Something went wrong on server side

---

[API](https://skmtc.net/tonkeeper/apis/rest-api-to-ton-console.md) · [All operations](https://skmtc.net/tonkeeper/apis/rest-api-to-ton-console/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tonkeeper/rest-api-to-ton-console/revisions/bffcc11719d3/schema)
