Query Interfaces
Amp exposes two query endpoints, each optimized for different use cases:Arrow Flight
High-performance gRPC interface for batch and streaming queriesPort: 1602
Protocol: gRPC
Format: Apache Arrow columnar data
Streaming: Yes
Protocol: gRPC
Format: Apache Arrow columnar data
Streaming: Yes
JSON Lines
Simple HTTP interface for ad-hoc queries and integrationsPort: 1603
Protocol: HTTP
Format: Newline-delimited JSON
Streaming: No
Protocol: HTTP
Format: Newline-delimited JSON
Streaming: No
When to Use Each Interface
Use Arrow Flight When:
- High performance is critical - Columnar format and gRPC provide maximum throughput
- Streaming data is needed - Real-time updates as new blocks arrive
- You have Arrow-compatible tools - Python (pyarrow), Rust, or other Arrow ecosystem tools
- Large result sets - Efficient streaming prevents memory issues
Use JSON Lines When:
- Simplicity is preferred - Standard HTTP POST with curl or any HTTP client
- Batch queries only - One-time queries that don’t need streaming
- JSON output required - Easy integration with JSON-based systems
- Quick prototyping - Fastest way to explore data interactively
SQL Query Support
Both interfaces use Apache DataFusion as the SQL engine, providing:- Standard SQL syntax - SELECT, WHERE, JOIN, GROUP BY, ORDER BY, and more
- Blockchain-specific functions - EVM decoding, hex conversion, unit shifting
- Namespace/table syntax - Query datasets with
namespace/dataset.table - User-defined functions (UDFs) - Custom functions for blockchain data processing
Default Server Ports
When you startampd server, both endpoints are available by default:
.amp/config.toml:
Quick Start Examples
Arrow Flight (Python)
JSON Lines (curl)
Next Steps
SQL Basics
Learn SQL syntax, namespace/table patterns, and common queries
Arrow Flight
Connect with Python, Rust, or other gRPC clients
JSON Lines
Query via HTTP with curl or any HTTP client
Streaming
Set up real-time streaming queries