REST API Reference
We provide a free and easy-to-use REST API that allows developers to seamlessly integrate BASED.DOMAINS into any application.
Resolve Name to Address
GET
https://based.domains/api/domain/{name}
Example Request
resolve-domain.js
// an example of how to resolve a domain name to a wallet address
const name = 'admin.based.eth';
fetch(`https://based.domains/api/domain/${name}`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Fetch error:', error));
Example Response
response.json
{
"name": "admin.based.eth",
"label": "admin",
"parent": "based.eth",
"registered": "1714475397",
"owner": "0x92274a4cee2f5f1f684bca85aff2a31908a4d780",
"addresses": [],
"records": [],
"primaryName": true
}
Resolve Address to Name (Reverse Lookup)
GET
https://based.domains/api/address/{address}/primary
Example Request
resolve-name.js
// an example of how to resolve a wallet address to a domain name
const address = '0x92274A4cee2f5F1F684bca85AfF2a31908A4d780';
fetch(`https://based.domains/api/address/${address}/primary`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Fetch error:', error));
Example Response
response.json
{
"name": "admin.based.eth",
"address": "0x92274a4cee2f5f1f684bca85aff2a31908a4d780"
}
List Domains for Owner
GET
https://based.domains/api/address/{address}/domains
Example Request
list-domains.js
// an example of how to list all domains owned by a wallet address
const address = '0x92274A4cee2f5F1F684bca85AfF2a31908A4d780';
fetch(`https://based.domains/api/address/${address}/domains`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Fetch error:', error));
Example Response
response.json
[
{
"name": "admin.based.eth",
"label": "admin",
"parent": "based.eth",
"registered": "1714475397",
"owner": "0x92274a4cee2f5f1f684bca85aff2a31908a4d780",
"addresses": [],
"records": [],
"primaryName": true
}
]