Documentation
HTTP API

Query with HTTP API

The HTTP API provides a lightweight interface for querying Altertable.

With the HTTP API, you can:

  • Run SQL queries over HTTPS
  • Stream results as JSONL

Quick start

Results stream as JSONL, so you can process rows as they arrive instead of buffering the full response. Run SQL with cURL or SDKs:

cURL

# echo -n "your_lakehouse_username:your_lakehouse_password" | base64
ALTERTABLE_BASIC_AUTH_TOKEN="your_base64_token"
curl https://api.altertable.ai/query \
-H "Authorization: Basic $ALTERTABLE_BASIC_AUTH_TOKEN" \
-d '{
"statement": "SELECT event, COUNT(*) AS count FROM product_analytics.main.events GROUP BY event"
}'

SDKs

Installation
pip install altertable-lakehouse
Usage
from altertable_lakehouse import Client
from altertable_lakehouse.models import QueryRequest
client = Client(
username="your_lakehouse_username",
password="your_lakehouse_password",
)
# Run a SQL query
req = QueryRequest(statement="""
SELECT
date_trunc('day', timestamp) AS day,
COUNT(DISTINCT user_id) AS dau
FROM events
WHERE event = 'Event Name'
AND timestamp >= NOW() - INTERVAL '30 days'
GROUP BY 1
ORDER BY 1 DESC
""")
# Accumulate all rows in memory
result = client.query_all(req)
for row in result.rows:
print(row)

API reference

Use the reference page for endpoint details, payload shapes, and full examples:

The same reference also covers related ingest, validation, and task endpoints:

Crafted with <3 by former Algolia × Front × Sorare builders© 2026 AltertableTermsPrivacySecurityCookies