3.9 KiB
3.9 KiB
Google BigQuery Routing Reference
App name: google-bigquery
Base URL proxied: bigquery.googleapis.com
API Path Pattern
/google-bigquery/bigquery/v2/{resource}
Common Endpoints
List Projects
GET /google-bigquery/bigquery/v2/projects
List Datasets
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets
Get Dataset
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}
Create Dataset
POST /google-bigquery/bigquery/v2/projects/{projectId}/datasets
Content-Type: application/json
{
"datasetReference": {
"datasetId": "my_dataset",
"projectId": "{projectId}"
},
"location": "US"
}
Delete Dataset
DELETE /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}
List Tables
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables
Get Table
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}
Create Table
POST /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables
Content-Type: application/json
{
"tableReference": {
"projectId": "{projectId}",
"datasetId": "{datasetId}",
"tableId": "my_table"
},
"schema": {
"fields": [
{"name": "id", "type": "INTEGER"},
{"name": "name", "type": "STRING"}
]
}
}
Delete Table
DELETE /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}
List Table Data
GET /google-bigquery/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data
Run Query (Synchronous)
POST /google-bigquery/bigquery/v2/projects/{projectId}/queries
Content-Type: application/json
{
"query": "SELECT * FROM `dataset.table` LIMIT 10",
"useLegacySql": false
}
List Jobs
GET /google-bigquery/bigquery/v2/projects/{projectId}/jobs
Get Job
GET /google-bigquery/bigquery/v2/projects/{projectId}/jobs/{jobId}?location=US
Cancel Job
POST /google-bigquery/bigquery/v2/projects/{projectId}/jobs/{jobId}/cancel?location=US
Query Examples
Simple Query
{
"query": "SELECT 1 as test",
"useLegacySql": false
}
Query with Parameters
{
"query": "SELECT * FROM `dataset.table` WHERE id = @id",
"useLegacySql": false,
"queryParameters": [
{
"name": "id",
"parameterType": {"type": "INT64"},
"parameterValue": {"value": "123"}
}
]
}
Query to Destination Table
{
"query": "SELECT * FROM `source_dataset.source_table`",
"useLegacySql": false,
"destinationTable": {
"projectId": "my-project",
"datasetId": "dest_dataset",
"tableId": "dest_table"
},
"writeDisposition": "WRITE_TRUNCATE"
}
Common Schema Types
STRING- Text dataINTEGER- 64-bit signed integerFLOAT- 64-bit floating pointBOOLEAN- True/falseTIMESTAMP- Point in timeDATE- Calendar dateRECORD- Nested structure
Notes
- Authentication is automatic - the router injects the OAuth token
- Project IDs are strings like
my-project-123 - Dataset and table IDs: letters, numbers, underscores only
- Query results use
f(fields) andv(value) structure - Use
useLegacySql: falsefor standard SQL - Streaming inserts require BigQuery paid tier
- Jobs include location in their reference (US, EU, etc.)
- Use
maxResultsandpageTokenfor pagination