Query data with SQL
Execute a read-only SQL query.
Runs the query as PostgreSQL against the organization’s read replica, so it cannot mutate data. Only SELECT statements are accepted. Supports positional parameters: write %s placeholders in the query and pass the values in order in the params list. Named :param placeholders belong to saved dataset queries and are not accepted here. Use the schema tool to discover tables first, and reference each column by its sql_column_name — foreign keys carry an _id suffix in SQL (e.g. a ‘sample’ reference is the ‘sample_id’ column).
A query is cancelled after 90 seconds. At most 10,000 rows are returned, and truncated is true when the query produced more. Aggregate, filter, or page with LIMIT and OFFSET to keep a result within that.
Requires an API key with the read scope.
Authentication
Bearer authentication of the form Bearer <token>, where token is your auth token.