There are two ways to run queries and export data from your Open Data datasets: manually on the BigQuery web UI or automatically using the BigQuery API.
Exporting data manually
To run queries and export data using the BigQuery web UI, proceed as follows:
- Open Google Cloud Console. Make sure you use an account that was previously added to your Open Data access-group. You can double-check the active account in the top right corner.
- Select your Open Data project.
- Open BigQuery from the menu.
- Click the name of the view you want to work with.
- Click the Query view button and compose your query.
- Click the Run button to execute your query.
- Download the results by clicking the Save results button.
If your query result set has fewer than 16,000 rows and is smaller than 10 MB in size, you can download it as a CSV or newline-delimited JSON file or save it to Google Sheets. Otherwise, you can only save it as a table into the editable_dataset
and export it from there. To learn more about how to export large result sets, see Exporting large result sets.
Exporting data via the API
To make programmatically data fetching possible from Open Data, we prepared a Service Account. You can generate a new API key for your Service Account by following the steps in the Creating an API key section.
By default, we provide the possibility to use Big Query API with Open Data to make direct HTTP requests to BigQuery. Google provides client library code for all their Cloud APIs that make it easier to access them from your favorite languages. You can access the detailed REST documentation here or the available client libraries here.
Exporting large result sets
If you want to export result sets larger than 16.000 rows or 10 MB, you’ll need to save the data into the editable_dataset
and then export it into a bucket before downloading. To export large result sets, proceed as follows:
- Follow steps 1-6. in the Exporting data manually section.
- Click Save results and choose the BigQuery table.
- Choose
editable_dataset
as target and specify the Table name. - Click Save and wait until the export is ready.
- Choose the table on the left pane under
editable_dataset
. - Click Export and choose Export to GCS.
- Configure your export, click the Export button, and wait until the export is ready.
- To browse your exports, follow the steps in the Cloud Storage Bucket section.
To learn more about BigQuery exports, refer to Google’s support pages.