---
title: "GET /projects/{projectsId}/queries/{queriesId}"
method: GET
path: "/projects/{projectsId}/queries/{queriesId}"
tags: ["jobs"]
---

# GET /projects/{projectsId}/queries/{queriesId}

`GET /projects/{projectsId}/queries/{queriesId}`

## Request

- Base URL: `https://bigquery.googleapis.com/bigquery/v2`
- URL: `https://bigquery.googleapis.com/bigquery/v2/projects/{projectsId}/queries/{queriesId}`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/bigquery`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/bigquery`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform.read-only`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform.read-only`

RPC to get the results of a query job. # IAM Permissions Requires the following IAM permission(s) to use this method: - `bigquery.jobs.get` on the job. - `bigquery.tables.getData` on the destination table. If the user matches the creator of the job, the following IAM permission(s) are required instead: - `bigquery.jobs.create` on the project. - `bigquery.tables.getData` on the destination table.

## Path parameters

- `projectsId` string, required
- `queriesId` string, required

## Query parameters

- `formatOptions.timestampOutputFormat` 'TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED' | 'FLOAT64' | 'INT64' | 'ISO8601_STRING'
- `formatOptions.useInt64Timestamp` boolean
- `location` string
- `maxResults` integer
- `pageToken` string
- `startIndex` string, uint64
- `timeoutMs` integer

## Response `200`

Successful response

- GetQueryResultsResponse: Response object of GetQueryResults.
  - `cacheHit` boolean: Whether the query result was fetched from the query cache.
  - `errors` ErrorProto[]: Output only. The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. For more information about error messages, see [Error messages](https://cloud.google.com/bigquery/docs/error-messages).
    - `debugInfo` string: Debugging information. This property is internal to Google and should not be used.
    - `location` string: Specifies where the error occurred, if present.
    - `message` string: A human-readable description of the error.
    - `reason` string: A short error code that summarizes the error.
  - `etag` string: A hash of this response.
  - `jobComplete` boolean: Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available.
  - `jobReference` JobReference: A job reference is a fully qualified identifier for referring to a job.
    - `jobId` string: Required. The ID of the job. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 characters.
    - `location` string: Optional. The geographic location of the job. The default value is US. For more information about BigQuery locations, see: https://cloud.google.com/bigquery/docs/locations
    - `projectId` string: Required. The ID of the project containing this job.
  - `kind` string: The resource type of the response.
  - `numDmlAffectedRows` string, int64: Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.
  - `pageToken` string: A token used for paging results. When this token is non-empty, it indicates additional results are available.
  - `rows` TableRow[]: An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. Present only when the query completes successfully. The REST-based representation of this data leverages a series of JSON f,v objects for indicating fields and values.
    - `f` TableCell[]: Represents a single row in the result set, consisting of one or more fields.
      - `v` unknown
  - `schema` TableSchema: Schema of a table
    - `fields` TableFieldSchema[]: Describes the fields in a table.
      - `categories` object: Deprecated.
        - `names` string[]: Deprecated.
      - `collation` string: Optional. Field collation can be set only when the type of field is STRING. The following values are supported: * 'und:ci': undetermined locale, case insensitive. * '': empty string. Default to case-sensitive behavior.
      - `dataGovernanceTagsInfo` object: Optional. Specifies the data governance tags on this field. This field works with other column-level security fields as follows: * **Precedence**: If a data governance tag is attached to a column, it takes precedence over the policy tag attached to the column. However, if a data policy is attached to a column, it takes precedence over the data governance tag. * **Patching behavior**: Describes how this field behaves during a `Table.patch` schema update: * **Unset**: If the `data_governance_tags_info` field is omitted from the update request, the existing tags on the column are preserved. * **Empty Field**: To clear data governance tags from a column, send the `data_governance_tags_info` field as an empty object. This removes all tags from the column. * **Updating tags**: To replace an existing tag, send the field with the new tag.
        - `dataGovernanceTags` object: Optional. The data governance tags added to this field are used for field-level access control. Only one data governance tag is currently supported on a field. Tag keys are globally unique. Tag key is expected to be in the namespaced format, for example "parent-id/pii" where parent-id is the ID of the parent organization or project resource for this tag key. Tag value is expected to be the short name, for example "sensitive". See [Tag definitions](https://cloud.google.com/iam/docs/tags-access-control#definitions) for more details. For example: "parent-id/pii": "sensitive", "myProject/cost_center": "sales"
      - `dataPolicies` DataPolicyOption[]: Optional. Data policies attached to this field, used for field-level access control.
        - `name` string: Data policy resource name in the form of projects/project_id/locations/location_id/dataPolicies/data_policy_id.
      - `dataPolicyList` DataPolicyList: A list of data policy options. For more information, see [Mask data by applying data policies to a column](https://docs.cloud.google.com/bigquery/docs/column-data-masking#data-policies-on-column).
        - `dataPolicies` DataPolicyOption[]: Contains a list of data policy options. At most 9 data policies are allowed per field.
          - `name` string: Data policy resource name in the form of projects/project_id/locations/location_id/dataPolicies/data_policy_id.
      - `defaultValueExpression` string: Optional. A SQL expression to specify the [default value] (https://cloud.google.com/bigquery/docs/default-values) for this field.
      - `description` string: Optional. The field description. The maximum length is 1,024 characters.
      - `fields` TableFieldSchema[]: Optional. Describes the nested schema fields if the type property is set to RECORD.
      - `foreignTypeDefinition` string: Optional. Definition of the foreign data type. Only valid for top-level schema fields (not nested fields). If the type is FOREIGN, this field is required.
      - `generatedColumn` GeneratedColumn: Optional. Definition of how values are generated for the field. Only valid for top-level schema fields (not nested fields).
        - `generatedExpressionInfo` GeneratedExpressionInfo: Definition of the expression used to generate the field.
          - `asynchronous` boolean: Optional. Whether the column generation is done asynchronously.
          - `generationExpression` string: Optional. The generation expression (e.g. AI.EMBED(...)) used to generate the field.
          - `stored` boolean: Optional. Whether the generated column is stored in the table.
        - `generatedMode` 'GENERATED_MODE_UNSPECIFIED' | 'GENERATED_ALWAYS' | 'GENERATED_BY_DEFAULT': Optional. Dictates when system generated values are used to populate the field.
      - `maxLength` string, int64: Optional. Maximum length of values of this field for STRINGS or BYTES. If max_length is not specified, no maximum length constraint is imposed on this field. If type = "STRING", then max_length represents the maximum UTF-8 length of strings in this field. If type = "BYTES", then max_length represents the maximum number of bytes in this field. It is invalid to set this field if type ≠ "STRING" and ≠ "BYTES".
      - `mode` string: Optional. The field mode. Possible values include NULLABLE, REQUIRED and REPEATED. The default value is NULLABLE.
      - `name` string: Required. The field name. The name must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_), and must start with a letter or underscore. The maximum length is 300 characters.
      - `policyTags` object: Optional. The policy tags attached to this field, used for field-level access control. If not set, defaults to empty policy_tags.
        - `names` string[]: A list of policy tag resource names. For example, "projects/1/locations/eu/taxonomies/2/policyTags/3". At most 1 policy tag is currently allowed.
      - `precision` string, int64: Optional. Precision (maximum number of total digits in base 10) and scale (maximum number of digits in the fractional part in base 10) constraints for values of this field for NUMERIC or BIGNUMERIC. It is invalid to set precision or scale if type ≠ "NUMERIC" and ≠ "BIGNUMERIC". If precision and scale are not specified, no value range constraint is imposed on this field insofar as values are permitted by the type. Values of this NUMERIC or BIGNUMERIC field must be in this range when: * Precision (P) and scale (S) are specified: [-10P-S + 10-S, 10P-S - 10-S] * Precision (P) is specified but not scale (and thus scale is interpreted to be equal to zero): [-10P + 1, 10P - 1]. Acceptable values for precision and scale if both are specified: * If type = "NUMERIC": 1 ≤ precision - scale ≤ 29 and 0 ≤ scale ≤ 9. * If type = "BIGNUMERIC": 1 ≤ precision - scale ≤ 38 and 0 ≤ scale ≤ 38. Acceptable values for precision if only precision is specified but not scale (and thus scale is interpreted to be equal to zero): * If type = "NUMERIC": 1 ≤ precision ≤ 29. * If type = "BIGNUMERIC": 1 ≤ precision ≤ 38. If scale is specified but not precision, then it is invalid.
      - `rangeElementType` object: Represents the type of a field element.
        - `type` string: Required. The type of a field element. For more information, see TableFieldSchema.type.
      - `roundingMode` 'ROUNDING_MODE_UNSPECIFIED' | 'ROUND_HALF_AWAY_FROM_ZERO' | 'ROUND_HALF_EVEN': Optional. Specifies the rounding mode to be used when storing values of NUMERIC and BIGNUMERIC type.
      - `scale` string, int64: Optional. See documentation for precision.
      - `timestampPrecision` string, int64: Optional. Precision (maximum number of total digits in base 10) for seconds of TIMESTAMP type. Possible values include: * 6 (Default, for TIMESTAMP type with microsecond precision) * 12 (For TIMESTAMP type with picosecond precision)
      - `type` string: Required. The field data type. Possible values include: * STRING * BYTES * INTEGER (or INT64) * FLOAT (or FLOAT64) * BOOLEAN (or BOOL) * TIMESTAMP * DATE * TIME * DATETIME * GEOGRAPHY * NUMERIC * BIGNUMERIC * JSON * RECORD (or STRUCT) * RANGE Use of RECORD/STRUCT indicates that the field contains a nested schema.
    - `foreignTypeInfo` ForeignTypeInfo: Metadata about the foreign data type definition such as the system in which the type is defined.
      - `typeSystem` 'TYPE_SYSTEM_UNSPECIFIED' | 'HIVE': Required. Specifies the system which defines the foreign data type.
  - `totalBytesProcessed` string, int64: The total number of bytes processed for this query.
  - `totalRows` string, uint64: The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when the query completes successfully.

## Changes

- **2026-11-05** `33188b5cf151`: 4 info
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2c`
- **2026-10-29** `1c22958240fa`: 4 info
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/bigquery` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform.read-only` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/bigquery/changes/projects/:projectsId/queries/:queriesId/get.md)

---

[API](https://skmtc.dev/google/apis/bigquery.md) - [All operations](https://skmtc.dev/google/apis/bigquery/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/bigquery/revisions/33188b5cf151?raw)
