9951 explained code solutions for 126 technologies


google-big-queryHow do I find the Google BigQuery project ID?


Finding the Google BigQuery project ID is easy.

  1. Log into the Google Cloud Platform Console.

  2. In the left-hand menu, select BigQuery.

  3. In the top-left corner, the project ID should be visible.

Alternatively, you can also use the bq command-line tool to find the project ID.

$ bq ls
Dataset                  Id
------------------------ -------------------------------
sample_dataset            my_project_id:sample_dataset

In the output of the bq ls command, the project ID is the first part of the dataset ID (my_project_id in the example above).

You can also retrieve the project ID programmatically using the BigQuery client libraries.

For example, in Python:

from google.cloud import bigquery

client = bigquery.Client()
print(client.project)
my_project_id

Edit this code on GitHub