ENSRainbow API
Endpoint Summary
Section titled “Endpoint Summary”| Endpoint | Purpose | Key Response Types |
|---|---|---|
GET /health | Liveness probe — succeeds as soon as the HTTP server is accepting requests | { status: "ok" } |
GET /ready | Readiness probe — succeeds once the database has been downloaded, validated, and opened | ReadyResponse, ServiceUnavailableError |
GET /v1/heal/{labelhash} | Heal a single labelhash | HealSuccess, HealError |
GET /v1/labels/count | Current healable label count | CountSuccess, CountServerError, ServiceUnavailableError |
GET /v1/config | Public configuration of the running instance | ENSRainbowPublicConfig, ServiceUnavailableError |
Pin labelSetVersion in your client if you need deterministic results across time. See the Label Sets & Versioning guide for details.
Liveness vs. Readiness
Section titled “Liveness vs. Readiness”ENSRainbow’s container starts its HTTP server immediately so that orchestrators (Docker, Kubernetes, ECS, …) can reach it for liveness checks while the database is still being downloaded and validated on first boot (which can take 30+ minutes for large label sets).
GET /health— pure liveness probe. Returns200 { status: "ok" }as soon as the HTTP server is bound. It does not guarantee the database is loaded.GET /ready— readiness probe. Returns200 { status: "ok" }only after the database has been downloaded, lite-validated, and opened by the process. While the server is still bootstrapping, it returns503 Service Unavailablewith a structured error body so clients can poll with backoff.
While the database is not yet ready, the following routes return 503 with the body:
{ "status": "error", "error": "ENSRainbow is still bootstrapping its database", "errorCode": 503}GET /v1/heal/{labelhash}GET /v1/labels/countGET /v1/config
Clients (including ENSIndexer) should poll /ready rather than /health before issuing heal requests. The official ensrainbow-sdk exposes client.ready() exactly for this purpose.
Health Check
Section titled “Health Check”curl https://api.ensrainbow.io/healthResponse: {"status":"ok"}
Readiness Check
Section titled “Readiness Check”curl https://api.ensrainbow.io/readyReady response: {"status":"ok"}
Not-ready response (HTTP 503):
{ "status": "error", "error": "ENSRainbow is still bootstrapping its database", "errorCode": 503}Heal Label
Section titled “Heal Label”Basic Usage
Section titled “Basic Usage”curl https://api.ensrainbow.io/v1/heal/0x[labelhash]Example:
curl https://api.ensrainbow.io/v1/heal/0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103ccResponse:
{ "status": "success", "label": "vitalik"}Advanced Usage with Query Parameters
Section titled “Advanced Usage with Query Parameters”You can optionally specify label_set_id and label_set_version query parameters:
curl "https://api.ensrainbow.io/v1/heal/0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc?label_set_id=subgraph&label_set_version=0"Query Parameters
Section titled “Query Parameters”label_set_id(optional): Validates that the request matches the database label set ID.label_set_version(optional): Specifies the highest label set version of label set ID to query. Enables deterministic heal results across time even if the ENSRainbow server ingests label sets with greater versions than this value. If provided, label_set_id is required and only labels from label sets with versions less than or equal to this value will be returned.
Note on returned labels: The service returns labels exactly as they appear in the source data. This means:
- Labels may or may not be ENS-normalized
- Labels can contain any valid string, including dots, null bytes, or be empty
- Clients should handle all possible string values appropriately
Error Responses
Section titled “Error Responses”-
400 Bad Request: When the labelhash parameter is missing or invalid, or when query parameters are incorrectly specified{"status": "error","error": "Invalid labelhash - must be a valid hex string","errorCode": 400}{"status": "error","error": "Requested label set version is higher than available label set version","errorCode": 400}{"status": "error","error": "Server label set ID \"subgraph\" does not match client's requested label set ID \"ens-test-env\".","errorCode": 400} -
404 Not Found: When no label is found for the given labelhash{"status": "error","error": "Label not found","errorCode": 404} -
500 Internal Server Error: When an unexpected error occurs or database is not initialized{"status": "error","error": "Internal server error","errorCode": 500}
Check the Troubleshooting guide for solutions to common issues.
Get Count of Healable Labels
Section titled “Get Count of Healable Labels”curl https://api.ensrainbow.io/v1/labels/countSuccess Response:
{ "status": "success", "count": 133856894, "timestamp": "2024-01-30T11:18:56Z"}Error Responses
Section titled “Error Responses”{ "status": "error", "error": "Label count not initialized. Check that the ingest command has been run.", "errorCode": 500}Get Public Config
Section titled “Get Public Config”curl https://api.ensrainbow.io/v1/configSuccess Response:
{ "version": "0.1.0", "labelSet": { "labelSetId": "subgraph", "highestLabelSetVersion": 0 }, "recordsCount": 133856894}The response contains:
version: The current version of ENSRainbowlabelSet: The label set of the loaded databaselabelSetId: The label set ID of the loaded databasehighestLabelSetVersion: The highest label set version available in the database
recordsCount: The total count of labels that can be healed by the ENSRainbow instance