API Documentation
BlockHeight provides a comprehensive REST API for accessing real-time data about blockchain provider performance and reliability. Below are the key endpoints with examples and parameter descriptions.Authentication
All API endpoints require an API key for authentication. To obtain an API key, please email [email protected]. To use your API key, include it in your request headers:Base URL
Endpoints
1. Get Providers
Retrieve a list of all monitored providers with their current status.chain_id(integer): Filter providers by chain ID (1 for Ethereum, 8453 for Base)recent(integer): Filter blockheight statuses within the last N secondsblockheight_status(string): Filter by status (“at”, “ahead”, “behind”)
2. Get Networks
Retrieve all blockchain networks monitored by BlockHeight.3. Get Network Leaderboard
Retrieve a performance leaderboard for a specific network, comparing all providers.network(string): Network name (ethereum or base)
time_period(string): Time period for data aggregation (day, week, month)
4. Get Latency Metrics
Retrieve detailed latency metrics for providers.provider(string): Filter by provider namenetwork(string): Filter by network (ethereum or base)region(string): Filter by regionmethod(string): Filter by RPC methodchain_id(integer): Filter by chain ID (1 for Ethereum, 8453 for Base)metrics(string): Comma-separated list of metrics to include (p50,p90,samplesize)date(string): Filter by date (YYYY-MM-DD format)
5. Get Events
Retrieve events detected by the BlockHeight monitoring system.type(string): Filter by event type (high_latency, height_stagnation, provider_error)provider_id(string): Filter by provider IDchain_id(string): Filter by chain ID (1 for Ethereum, 8453 for Base)blocks_behind_min(integer): Filter by minimum blocks behindstatus(string): Filter by event status (active, resolved)limit(integer): Number of results per page (default 100)offset(integer): Offset for pagination
6. Raw Data Endpoints
BlockHeight provides access to raw data for advanced analysis:- Raw Simple Tests:
GET /raw/simple-tests - Raw Advanced Tests:
GET /raw/advanced-tests - Raw Latency Stats:
GET /raw/latency-stats - Raw Provider Consensus:
GET /raw/provider-consensus
limit and offset) and provide detailed information about the underlying data that drives BlockHeight’s analytics.
Testing Methodology
BlockHeight employs a sophisticated testing methodology to ensure accurate and reliable data:EdgeProbe Architecture
Our testing agent, EdgeProbe, is deployed in multiple regions worldwide to provide a truly global perspective on provider performance. Each EdgeProbe instance:- Runs standardized tests against all providers at regular intervals
- Records latency, errors, and block heights
- Submits results to our central database for analysis
Types of Tests
Simple Tests
- Frequency: Multiple tests per minute depending on the network’s block time
- Metrics: Latency, block height, success/failure
- Methods: eth_blockNumber, eth_chainId, eth_gasPrice
Advanced Tests
- Frequency: Tests every 1 to 5 minutes
- Metrics: Complex operations timing, state inconsistency detection
- Methods: eth_getBlockByNumber, eth_call, eth_getLogs
Height Stagnation Detection
Our height stagnation detector identifies providers that are falling behind in block height compared to consensus:- Determines network consensus by analyzing block heights reported by all providers
- Identifies providers with status “Behind” and calculates blocks behind
- Creates events when a provider falls significantly behind (configurable threshold)
- Resolves events when a provider returns to consensus (“At” or “Ahead” status)
Event Lifecycle
Events in the BlockHeight system have a specific lifecycle:- Timestamp: When the issue was first detected in monitoring data
- Event Created: When our detection system created a record in the database
- Resolved At: When the provider actually fixed the issue
Integration Examples
JavaScript
Python
Getting Started
To access the BlockHeight API:- Email [email protected] to request an API key
- Include in your request:
- Your name and organization
- Intended use case
- Expected request volume
- Once approved, you’ll receive your API key and welcome information
- Integrate the API using the documentation above
Best Practices
-
Implement Strategic Routing:
- Route read operations to providers at consensus
- Route time-sensitive transactions to providers ahead of consensus
- Avoid providers that are consistently behind consensus
-
Monitor for Events:
- Poll the
/eventsendpoint regularly to detect issues with your providers - Create alerts for active events affecting your critical providers
- Poll the
-
Use Multiple Providers:
- Build resilience by integrating with multiple providers
- Use BlockHeight data to implement intelligent failover strategies
Support
For support or questions about the BlockHeight API:- Email: [email protected]