Base URL
Endpoints
Execute a SQL query
POST/query
Executes a SQL query against the Leaf Lake tables and returns the results as a JSON array of rows.
All queries are scoped to the authenticated API owner. You can only access data belonging to your own Leaf users. Only read queries are allowed (SELECT, WITH, ORDER BY, UNION). Write operations are not supported.
This endpoint accepts both POST (SQL in the request body) and GET (SQL in the sql query parameter). POST is recommended for longer queries.
POST request
Send the SQL query as the request body withContent-Type: text/plain.
GET request
Pass the SQL as thesql query parameter. Useful for short queries or browser testing.
Request body (POST)
The raw SQL query as plain text. See Querying Leaf Lake for available tables, columns, and example queries.Request
Response
The response is a JSON array where each element is an object representing one row. Column names match the aliases used in the SQL query.Query by field ID
The simplest way to scope a query to a specific field is by Leaf field UUID using thefieldIds column on the points table. No WKT boundary polygon needed.
Spatial query example
You can also filter by geography using spatial functions and a WKT boundary polygon.Error handling
When a
400 error occurs, the response body contains a Problem JSON (RFC 7807) object with details about the issue.
A
204 No Content response has no body. Check the status code before attempting to parse JSON.Export query results as GeoParquet
POST/export-query-geoparquet
Runs a SQL query and returns the results as a downloadable GeoParquet file instead of JSON. Useful when you need to load results directly into GIS software or spatial analysis tools.
The request format is the same as the query endpoint — send the SQL as the request body with Content-Type: text/plain.
Request
Response
The response is a binary GeoParquet file withContent-Type: application/octet-stream. Save the response body to a .parquet file to use with tools like GeoPandas, QGIS, or DuckDB.
What to do next
- Leaf Lake Overview — Product description and key concepts.
- Querying Leaf Lake — Schema reference and example queries for all operation types.
- Authentication — How to get a Bearer token.

