Custom APIs
ENSDb (PostgreSQL)
For special use cases that go beyond what the ENS Omnigraph exposes — you can query the live onchain state of ENSv2 directly via SQL.
ENSDb is an open standard that stores the live onchain ENSv2 state in a carefully-crafted data model within a PostgreSQL database. Because it’s plain Postgres, you can use any language with a Postgres driver — TypeScript, Python, Rust, Go, and more.
We’re building ENSDb snapshots & an ensdb-cli so you can pull down a fresh ENSDb in minutes instead of paying for a full historical RPC backfill, diff snapshots across versions to validate indexing changes, and operate ENSNode like a database. Planned - not shipping yet, but worth peeking at if your roadmap depends on a fast or cheap ENSDb bootstrap.
ENSDb is available when you self-host ENSNode. Each ENSNode instance writes its data into a PostgreSQL database that you own and control — that database is your ENSDb instance. The hosted ENSNode instances do not expose direct database access.
What you can build with ENSDb
Section titled “What you can build with ENSDb”Analytics & Dashboards
CLIs & Developer Tools
Event-Based Engines
Data Pipelines
AI Agents
Example: fetch ENSv2 domains with the ENSDb SDK
Section titled “Example: fetch ENSv2 domains with the ENSDb SDK”import { EnsDbReader } from "@ensnode/ensdb-sdk";import { eq } from "drizzle-orm";
const ensDbReader = new EnsDbReader(ensDbConnectionString, ensIndexerSchemaName);const { ensDb, ensIndexerSchema } = ensDbReader;
const v2Domains = await ensDb .select() .from(ensIndexerSchema.domain) .where(eq(ensIndexerSchema.domain.type, "ENSv2Domain"));Example: fetch ENSv2 domains with raw SQL
Section titled “Example: fetch ENSv2 domains with raw SQL”SELECT * FROM ensindexer_0.domainsWHERE type = 'ENSv2Domain'LIMIT 10;