HTTP Example
The TX Stream API is designed for gRPC streaming and does not have direct HTTP endpoints. For HTTP-based integrations, use the existing NextBlock HTTP API endpoints.
Overview
Since the TX Stream API is gRPC-only, for HTTP-based trading bot integrations you should:
Use the gRPC TX Stream API (recommended for real-time trading bot monitoring)
Use existing HTTP API endpoints for transaction submission and tip floor monitoring
Recommendation
For trading bot applications that need fast transaction detection for sniping new DEX launches, the gRPC TX Stream API is strongly recommended due to its real-time streaming capabilities.
Use gRPC TX Stream API (Recommended)
For trading bot transaction monitoring, use the gRPC TX Stream API with any of the language examples:
Go TX Stream Example - Complete Go implementation
Python TX Stream Example - Python with asyncio
JavaScript/TypeScript TX Stream Example - Node.js implementation
Rust TX Stream Example - Rust with Tonic
HTTP API Integration
You can use the existing NextBlock HTTP API endpoints for transaction submission:
# Submit transactions to NextBlock
curl -X POST http://frankfurt.nextblock.io/api/v2/submit \
-H "Content-Type: application/json" \
-H "Authorization: your-api-key-here" \
-d '{
"transaction": {
"content": "base-64-encoded-transaction"
}
}'
# Get tip floor data for optimization
curl -X GET http://frankfurt.nextblock.io/api/v1/tip-floor \
-H "Authorization: your-api-key-here"
Available HTTP Endpoints
For transaction submission and tip floor data:
Frankfurt:
http://frankfurt.nextblock.io
Amsterdam:
http://amsterdam.nextblock.io
London:
http://london.nextblock.io
Singapore:
http://singapore.nextblock.io
Tokyo:
http://tokyo.nextblock.io
New York:
http://ny.nextblock.io
Salt Lake City:
http://slc.nextblock.io
Best Practices
Use gRPC for real-time monitoring: The TX Stream API provides the fastest transaction detection for trading bots
Use HTTP for submission: Submit your trading transactions via the HTTP API endpoints
Monitor tip floors: Use the HTTP tip floor endpoint to optimize your transaction tips
Choose optimal endpoint: Use the endpoint closest to your location for best latency
Handle rate limits: Implement appropriate backoff for HTTP requests
Last updated