Skip to content

ENSRainbow API

Health Check

Terminal window
curl http://localhost:3223/health

Response: {"status":"ok"}

Heal Label

Terminal window
curl http://localhost:3223/v1/heal/0x[labelhash]

Example:

Terminal window
curl http://localhost:3223/v1/heal/0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc

Response:

{
"status": "success",
"label": "vitalik"
}

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

  • 400 Bad Request: When the labelhash parameter is missing or invalid

    {
    "status": "error",
    "error": "Invalid labelhash - must be a valid hex string",
    "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
    }

Get Count of Healable Labels

Terminal window
curl http://localhost:3223/v1/labels/count

Success Response:

{
"status": "success",
"count": 133856894,
"timestamp": "2024-01-30T11:18:56Z"
}

Error Responses

{
"status": "error",
"error": "Label count not initialized. Check that the ingest command has been run.",
"errorCode": 500
}