Run a read-only SQL query
POST https://api.rewind.rest/v1/query
Executes a single read-only SELECT (or WITH … SELECT) statement against the Rewind database and returns column names plus array-of-array row tuples. Gated server-side: writes, DDL, multi-statement input, and access to secret tables are rejected. A LIMIT is enforced automatically (200 default, 500 max). Fetch GET /v1/schema first for the annotated table list.
Authorization
AuthorizationrequiredAPI key. Read keys (rw_live_...) access GET endpoints. Admin keys (rw_admin_...) access all endpoints.
Body
sqlrequiredA single read-only SELECT (or WITH … SELECT) statement. A LIMIT is applied automatically (200 default, 500 max).
Response
Query results as column names plus row tuples
columnsrequiredrowsrequiredrow_countrequiredtruncatedrequiredTrue when rows were dropped to fit the response ceiling.
integrationrequiredThe single upstream service the queried tables belong to (lastfm, strava, discogs, …), or null when the query spans several or reads only shared tables. Renderers use it to tint a single-series chart in that service’s colour.