API
Ingest unstructured data and query it with the public RawTree API.
Quickstart with the API
Use the public RawTree API when you want direct HTTP access from an application, script, or agent.
Base URL:
https://api.rawtree.com1) Set an API key
Create an API key from the UI or CLI, then pass it as a bearer token.
export API_KEY=rt_...Authorization: Bearer rt_...2) Ingest data
curl -X POST "https://api.rawtree.com/v1/tables/events" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '[
{"action":"click","user":"alice","value":42},
{"action":"view","user":"bob","value":10}
]'Native row counters in the response (excerpt):
{ "read_rows": "2", "written_rows": "2" }The response includes the database's summary fields, with counters encoded as
strings. Use written_rows for the reported insert count. See the
insert response reference for the other fields.
3) Query data
curl -X POST "https://api.rawtree.com/v1/query" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT action, count() AS total FROM events GROUP BY action ORDER BY total DESC LIMIT 10"}'4) Check recent API requests
START_TIME="2026-04-24T10:00:00Z"
END_TIME="2026-04-24T11:00:00Z"
curl "https://api.rawtree.com/v1/logs?start_time=$START_TIME&end_time=$END_TIME&limit=50" \
-H "Authorization: Bearer $API_KEY"