Method: jobs.getQueryResults

RPC to get the results of a query job.

HTTP request

GET https://bigquery.googleapis.com/bigquery/v2/projects/{projectId}/queries/{jobId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
projectId

string

Required. Project ID of the query job.

jobId

string

Required. Job ID of the query job.

Query parameters

Parameters
startIndex

string (UInt64Value format)

Zero-based index of the starting row.

pageToken

string

Page token, returned by a previous call, to request the next page of results.

maxResults

integer

Maximum number of results to read.

timeoutMs

integer

Optional: Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. By default, this limit is 10 seconds (10,000 milliseconds). If the query is complete, the jobComplete field in the response is true. If the query has not yet completed, jobComplete is false.

You can request a longer timeout period in the timeoutMs field. However, the call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete.

If jobComplete is false, you can continue to wait for the query to complete by calling the getQueryResults method until the jobComplete field in the getQueryResults response is true.

location

string

The geographic location of the job. You must specify the location to run the job for the following scenarios:

  • If the location to run a job is not in the us or the eu multi-regional location
  • If the job's location is in a single region (for example, us-central1)
For more information, see https://cloud.google.com/bigquery/docs/locations#specifying_your_location.

formatOptions

object (DataFormatOptions)

Optional. Output format adjustments.

Request body

The request body must be empty.

Response body

Response object of jobs.getQueryResults.

If successful, the response body contains data with the following structure:

JSON representation
{
  "kind": string,
  "etag": string,
  "schema": {
    object (TableSchema)
  },
  "jobReference": {
    object (JobReference)
  },
  "totalRows": string,
  "pageToken": string,
  "rows": [
    {
      object
    }
  ],
  "totalBytesProcessed": string,
  "jobComplete": boolean,
  "errors": [
    {
      object (ErrorProto)
    }
  ],
  "cacheHit": boolean,
  "numDmlAffectedRows": string
}
Fields
kind

string

The resource type of the response.

etag

string

A hash of this response.

schema

object (TableSchema)

The schema of the results. Present only when the query completes successfully.