Overview
The JSONL endpoint is the simplest way to query data from Amp. It’s ideal for:- Ad-hoc queries and exploration
- Integration with tools that support HTTP
- Simple scripting and automation
- When you need JSON output format
Endpoint
- Protocol: HTTP/HTTPS
- Default Port:
1603 - Default Address:
0.0.0.0:1603 - Configuration: Set via
jsonl_addrin config.toml orAMP_CONFIG_JSONL_ADDRenvironment variable
Request Format
Execute Query
- Method:
POST - Path:
/ - Content-Type:
text/plain - Body: SQL query string
- Response Content-Type:
application/x-ndjson - Response Body: Newline-delimited JSON records
Health Check
- Method:
GET - Path:
/health - Response:
200 OK
Basic Usage
Simple Query
Query with Namespace
When querying datasets with custom namespaces, use double quotes:Using jq for Pretty Output
Process JSONL output with jq:Query with User-Defined Functions
Response Format
Success Response
Successful queries return NDJSON format (one JSON object per line):\n).
Empty Results
Queries that return no results will have an empty response body:Error Responses
Error responses return JSON witherror_code and error_message fields.
Invalid SQL String (400 Bad Request)
- Request body is empty
- SQL contains multiple statements
Parse Error (400 Bad Request)
Streaming Not Supported (400 Bad Request)
Client Examples
curl
Python (requests)
Python (with error handling)
JavaScript (Node.js)
Rust
When to Use JSONL vs Arrow Flight
Choose the JSONL endpoint when:- You need JSON output format
- You’re doing ad-hoc queries or exploration
- You want the simplest possible integration
- You’re using tools that only support HTTP
- You need high performance and throughput
- You want streaming queries with real-time updates
- You need reorg detection and watermarking
- You can consume Apache Arrow format
- You want efficient columnar data transfer
Limitations
- Batch queries only: Streaming queries (
SETTINGS stream = true) are not supported. Use Arrow Flight for streaming. - Single statements only: Multiple SQL statements per request are rejected.
- JSON output only: Results are always in NDJSON format.
- No compression: Responses are not compressed by default (use HTTP compression headers if needed).
- Synchronous execution: Query must complete before response is sent.
Compression
To enable response compression, include theAccept-Encoding header:
Health Check
Verify the server is running:See Also
- Arrow Flight Protocol - High-performance gRPC alternative
- SQL Basics - SQL syntax and features
- Query Overview - Introduction to querying in Amp