LogoLogo
AppBlogTwitterDiscord
  • Overview
    • .bnb Name Service
    • .arb Name Service
    • SPACE ID Token (ID)
    • Roadmap
  • - DOMAIN & PAYMENT ID -
    • Domain Tutorials
      • Set Up a Wallet
      • Discover
      • Register
      • Trade
      • Manage
    • Domain Programs
      • SPACE ID Premier Club
      • SPACE ID DAO
      • SPACE ID Grant Program
      • SPACE ID Referral Program
      • SPACE ID Gift Card
      • SPACE ID Cosmic Council
      • SPACE ID Voyage Season 2 - Calling
    • Using Domain on MetaMask Snap
      • Knowledge Base
      • General FAQ
  • Payment ID
    • Architecture
    • ZK Email Oauth Login
    • Key Terms
    • Core Contracts
      • PID
      • PIDRegistry
      • RegistrationController
      • AddrResolver
      • PublicResolver
    • Contract Addresses
  • - Launch your TLDs with SPACE ID -
    • Overview
    • Step by Step Guide
    • Demos of One-Stop Domain Issuance Toolkit
  • - Developer Guide -
    • Web3 Name API & SDK
      • Web3 Name API
      • Web3 Name SDK
      • FAQ
    • Registration Integration
    • Integration Partners
  • - Legal -
    • Terms of Use
  • Links
    • Github
    • Brand Kit
    • Website
    • Blog
    • Twitter
    • Discord
    • Telegram
Powered by GitBook
On this page
  • 1. Resolve Domain Name -> Address
  • 2. Resolve Address -> Domain Name
  • 3. Resolve Payment ID -> Address
  • Appendix for Supported Domains & Chains
  1. - Developer Guide -
  2. Web3 Name API & SDK

Web3 Name API

PreviousWeb3 Name API & SDKNextWeb3 Name SDK

Last updated 1 month ago

SPACE ID provides a free HTTP API to help dApps integrate domain resolutions with ease. All data is queried on-chain securely in real time.

The primary capabilities of the SPACE ID Web3 Name API include:

  1. Domain Name -> Address resolution: Retrieve the crypto address uniquely bound to the domain name by entering the domain name.

  2. Address -> Domain Name resolution: Retrieve the domain name associated with the address via inputs: 1) the crypto address, and 2) the chain id.

    • Given one crypto address could own multiple domain names, users can set a primary name such that their address can be 1-to-1 mapped to this primary name

1. Resolve Domain Name -> Address

GET https://nameapi.space.id/getAddress?domain=

Request URL Example:

  • Domain to be resolved: spaceid.bnb

Status Code: 200 OK
{
"address":"0xb5932a6B7d50A966AEC6C74C97385412Fb497540"
"code":0
"msg":"success"
}

Return Field Description

Name
Description

address

Returns the resolved address. If no domain records are found, the address field will not be returned

code

0: address found, 1: no address found, -1: error

msg

result status and error message

2. Resolve Address -> Domain Name

GET https://nameapi.space.id/getName?chainid=&address=

Query Parameters

Name
Description

chainid

The Chain ID that tells which chain the app is on (e.g. Ethereum: 1, BNB Chain: 56, Solana: 900)

address

The crypto address that can be resolved to a primary domain name

Request URL Example (single chain query):

  • BNB Chain (Chain ID: 56) Address to be resolved: 0xb5932a6B7d50A966AEC6C74C97385412Fb497540

  • Return:

Status Code: 200 OK
{
  "code": 0,
  "data": {
    "name": "spaceid.bnb",
    "chainID": 56,
    "errMsg": ""
  },
  "msg": "success"
}

Request URL Example (multi-chain query):

  • Address 0xb5932a6B7d50A966AEC6C74C97385412Fb497540, to be resolved for names on Arbitrum, BNB Chain, and Mint.

  • Return:

Status Code: 200 OK
{
   "code": 0,
   "data": [
       {
           "name": "0x5206.arb",
           "chainID": 42161,
           "errMsg": ""
       },
       {
           "name": "allen.bnb",
           "chainID": 56,
           "errMsg": ""
       },
       {
           "name": "",
           "chainID": 0,
           "errMsg": "unsupported chain id: 101"
       },
       {
           "name": "",
           "chainID": 185,
           "errMsg": "corresponding domain not found"
       }
   ],
   "msg": "success"
}

Return Field Description

Name
Description

name

Returns the resolved domain name. If no record is found, the name field will not be returned

code

0: name found, 1: name not found, -1: error

msg

result status and error message

3. Resolve Payment ID -> Address

GET https://nameapi.space.id/getPaymentIdName/”paymentID”/”chaintype”

Query Parameters

Name
Description

paymentID

The payment ID name that needs to be resolved (e.g. jerry@binance)

chaintype

The chain address to be resolved, from btc, evm, sol, tron, aptos, sui

Request URL Example:

  • Payment ID to be resolved: jerry@binance, chaintype: evm

  • Return:

Status Code: 200 OK
{
  "address": "0x5bcb636853ab70b873adaf2d9759ca1489669cce",
  "code": 0,
  "msg": "success"
}

Appendix for Supported Domains & Chains

Chain
Chain ID
Domain

Ethereum Mainnet

1

.eth

BNB Chain

56

.bnb

Solana

900

.sol

Arbitrum One

42161

.arb

Manta Pacific Mainnet

169

.manta

Mode

34443

.mode

ZKFair Mainnet

42766

.zfk

Lightlink Phoenix Mainnet

1890

.ll

ZetaChain Mainnet

7000

.zeta

Merlin Mainnet

4200

.merlin

Gnosis

100

.gno

Taiko Alethia

167000

.taiko

AlienX Mainnet

10241024

.alien

Mint Mainnet

185

.mint

AILayer Mainnet

2649

.ail

Morph

2818

.mph

DuckChain Mainnet

5545

.duck

Gravity Alpha Mainnet

1625

.g

Story

1514

.ip

Injective

901

.inj

Sei

902

.sei

.lens on Polygon

903

.lens

.crypto on Polygon

904

.crypto

https://nameapi.space.id/getAddress?domain=spaceid.bnb
https://nameapi.space.id/getName?chainid=56&address=0xb5932a6B7d50A966AEC6C74C97385412Fb497540
https://nameapi.space.id/getDomainNamesByChainIdList?chainlist=42161,56,101,185&address=0x2e552E3aD9f7446e9caB378c008315E0C26c0398
https://nameapi.space.id/getPaymentIdName/jerry@binance/evm