google-bigquery

How to access “Saved Queries” programmatically?


In BigQuery Web UI, there is a “Saved Queries” Section.
Is there way to access (read/write) those programmatically?
Any API?


Solution

  • Nope. It's a UI-only feature with a private interface.

    Update 2021: We recommend using scripts to save and share queries.

    https://cloud.google.com/blog/products/data-analytics/command-and-control-now-easier-in-bigquery-with-scripting-and-stored-procedures

    Update 2025: The feature referenced in this question is "Classic saved queries", which are deprecated. See the following documentation for info about Dataform-based saved queries now available in BigQuery Studio.

    https://cloud.google.com/bigquery/docs/saved-queries-introduction

    You can also use routines (scripts and stored procedures) as a way to share SQL code assets between users.