Get query result

Prev Next

Available in VPC

Get the query execution result.

Request

This section describes the request format. The method and URI are as follows:

Method URI
GET /api/v2/queries/{executionId}

Request headers

For information about the headers common to all Data Query APIs, see Data Query request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
executionId String Required Query ID

Request query parameters

You can use the following query parameters with your request:

Field Type Required Description
offset Long Optional Offset to use when querying pages (default: 0)
pageSize Integer Optional Number of items per page
  • 1-1000 (default: 100)

Request example

The request example is as follows:

curl --location --request GET 'https://kr.dataquery.naverncp.com/api/v2/queries/eab65f48-****-****-****-c87f0db59b49' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
id String - Execution ID
columns Array - Column information: Column
data Array - Query execution result
  • Returns an array where each row is mapped one-to-one to the column order of Column.
  • For composite type (row) columns, serializes as a string of the form {field name=value}.
    • Separated by commas (,) if returning more than one.
offset Long - Offset to use for page query
  • If isFinished is false, use it for the next page query request.
isFinished Boolean - Whether all pages have been queried
  • true | false
    • true: Completed (Next page does not exist.)
    • false: Incomplete (Next page exists.)

Column

The following describes Column.

Field Type Required Description
name String - Column name
type String - Column type
typeSignature Object - Column type information
typeSignature.rawType String - Default type name
typeSignature.arguments Array - Type parameter list: ClientTypeSignatureParameter

ClientTypeSignatureParameter

The following describes ClientTypeSignatureParameter.

Field Type Required Description
kind String - Type parameter type
  • TYPE | NAMED_TYPE | LONG | VARIABLE
value Union - Type parameter value
  • Object | Number | String
    • Object: If kind is TYPE or NAMED_TYPE (composite type)
    • Number: If kind is LONG
    • String: If kind is VARIABLE
value.fieldName Object - Field name object of composite type
value.fieldName.name String - Field name
value.typeSignature Object - Field type object of composite type
value.typeSignature.rawType String - Default type name
value.typeSignature.arguments Array - Type parameter list: ClientTypeSignatureParameter

Response status codes

For information about the HTTP status codes common to all Data Query APIs, see Data Query response status codes.

Response example

The response example is as follows:

{
    "id": "eab65f48-****-****-****-c87f0db59b49",
    "columns": [
        {
            "name": "date",
            "type": "varchar",
            "typeSignature": {
                "rawType": "varchar",
                "arguments": [
                    {
                        "kind": "LONG",
                        "value": 2147483647
                    }
                ]
            }
        },
        {
            "name": "area_name",
            "type": "varchar",
            "typeSignature": {
                "rawType": "varchar",
                "arguments": [
                    {
                        "kind": "LONG",
                        "value": 2147483647
                    }
                ]
            }
        },
        {
            "name": "fine_dust_per_day",
            "type": "varchar",
            "typeSignature": {
                "rawType": "varchar",
                "arguments": [
                    {
                        "kind": "LONG",
                        "value": 2147483647
                    }
                ]
            }
        }
    ],
    "data": [
        [
            "202211302300",
            "downtown",
            "67"
        ],
        [
            "202211302300",
            "downtown",
            "100"
        ],
        [
            "202211302300",
            "downtown",
            "68"
        ],
        ...
    ],
    "offset": 596,
    "isFinished": true
}