Subgraph API
Introduction
The HNS.ID Subgraph API provides efficient and straightforward access to HNS.ID domain data on Optimism, facilitating queries on ownership, transfers, and other changes while avoiding the complexities of direct blockchain queries. The Subgraph ingests data from the Optimism mainnet. It populates indexed data by listening to events emitted by the smart contracts governing the hns.id domains.
Graph API
The HNS.ID subgraph has now migrated to The Graph's decentralized network, which requires an API key for access. Follow these steps to get started:
-
Sign up for Subgraph Studio:
Go to The Graph's Subgraph Studio (opens in a new tab) and sign up or log in with your existing account. -
Create an API Key:
After logging in, navigate to the API keys section in the dashboard. You can create and manage API keys here. This API key will allow you to query subgraphs on The Graph's decentralized network. More details on managing API keys can be found here (opens in a new tab). -
Use the API Key:
Use the following Graph API URL for querying the HNS.ID subgraph:https://gateway.thegraph.com/api/{api-key}/subgraphs/id/6FAHdNZszs25J25NmjTc2de7nuQu2b4HRhGWsPWiKruh
Replace
{api-key}
with your actual API key obtained from Subgraph Studio.
For further details on querying and managing subgraphs, visit The Graph Docs (opens in a new tab).