Explore documentation
Generate client-facing APIs
Get client-facing APIs with JSON, CSV or TSV for your saved queries.
Go to Warehouse -> Queries as APIs -> Create query.
Here, you can select your JSON events or time series source, and query your data. We'll give you a quick visualization along with the full results.
As soon as the query is saved, we'll generate a secure publicly-accessible URL you can use as API 🚀
You can regenerate the URL at any time.
JSON, CSV or TSV
Adjust the API to use a different Format.
For your convenience, we always generate API for all supported formats:
curl "https://$CLUSTER.betterstackdata.com/query/$SECRET.json"
curl "https://$CLUSTER.betterstackdata.com/query/$SECRET.csv"
curl "https://$CLUSTER.betterstackdata.com/query/$SECRET.tsv"
Pass variables into your saved queries
Specify any {{variable}}, e.g. {{currency}}, in your SQL query and we'll parameterize your API automatically.
And set the value of currency as a query parameter when calling the API:
curl "https://$CLUSTER.betterstackdata.com/query/$SECRET.json?currency=EUR"
curl "https://$CLUSTER.betterstackdata.com/query/$SECRET.json" \
--get \
--data-urlencode "currency=EUR"
curl "https://$CLUSTER.betterstackdata.com/query/$SECRET.json" \
--get \
--data-urlencode "currency=EUR"
--data-urlencode "country=DE"
You can even use multiple variables in a single query!
Optimized for high request throughput
Better Stack Warehouse client-facing APIs are optimized for many HTTP requests. They will survive your website making it to the homepage of Reddit.