Starknet.id API

API domain integration

How to resolve a domain or an address using the indexer

🔗 View the source code on GitHub (opens in a new tab)

Endpoints

Domain to Address

Retrieve the associated address and its expiry date for a given domain.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/domain_to_addr

Query Parameters

NameTypeDescription
domainstringThe domain to query

Response

The API will return the associated address along with its expiry date.

Example request

https://api.starknet.id/domain_to_addr?domain=fricoben.stark

Success Response Example

{
  "addr": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3",
  "domain_expiry": 1796569200
}

Error Response Example

no address found

Address to Domain

Retrieve the associated domain and its expiry date for a given address.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/addr_to_domain

Query Parameters

NameTypeDescription
addrstringThe address to query

Response

The API will return the associated domain along with its expiry date.

Example request

https://api.starknet.id/addr_to_domain?addr=0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3

Success Response Example

{
  "domain": "fricoben.stark",
  "domain_expiry": 1796569200
}

Error Response Example

No domain found

Address to External Domains

Retrieve the braavos and xplorer subdomain associated to an address.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/addr_to_external_domains

Query Parameters

NameTypeDescription
addrstringThe address to query

Response

The API will return the associated braavos and xplorer subdomains.

Example request

https://api.starknet.id/addr_to_domain?addr=0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3

Success Response Example

{
  "domains": ["fricoben.braavos.stark"]
}

Empty Response Example

{
  "domains":[]
}

Address to Starknet IDs

Retrieve all the Starknet IDs owned by a given address.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/addr_to_full_ids

Query Parameters

NameTypeDescription
addrstringThe address to query

Response

The API will return all the Starknet IDs owned by the address.

Example request

https://api.starknet.id/addr_to_full_ids?addr=0x072D4F3FA4661228ed0c9872007fc7e12a581E000FAd7b8f3e3e5bF9E6133207

Success Response Example

{
  "full_ids": [
    { "id": "694846134574" },
    { "id": "846904695223" },
    { "id": "718722140035", "domain": "deployer.fricoben.stark" },
    { "id": "4799954900", "domain": "domaintesttest.stark" },
    { "id": "23365742225" },
    { "id": "289323426116", "domain": "treasuryship.stark" }
  ]
}

Empty Response Example

https://api.starknet.id/addr_to_full_ids?addr=0x00Ec0ED6E46a4435C6324D47EADeaadFBc9f66D372F4Cf36b767F5F26754bB47

{
  "full_ids": []
}

Error Response Example

https://api.starknet.id/addr_to_full_ids?addr=lol.stark

Failed to deserialize query string: invalid character

Address to Available Starknet IDs

Retrieve available (not associated with a domain) Starknet IDs owned by a given address.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/addr_to_available_ids

Query Parameters

NameTypeDescription
addrstringThe address to query

Response

The API will return all the Starknet IDs that are not linked with a domain yet owned by the address.

Example request

https://api.starknet.id/addr_to_available_ids?addr=0x072D4F3FA4661228ed0c9872007fc7e12a581E000FAd7b8f3e3e5bF9E6133207

Success Response Example

{
  "ids": ["694846134574", "846904695223", "23365742225"]
}

Empty Response Example

{
  "ids": []
}

Error Response Example

https://api.starknet.id/addr_to_available_ids?addr=lol.stark

Failed to deserialize query string: invalid character

Address to token id

Retrieve the token ID associated with a given address.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/addr_to_token_id

Query Parameters

NameTypeDescription
addrstringThe address to query

Response

The API will retrieve the token id of the Starknet ID associated with the main domain of the address.

Example request

https://api.starknet.id/addr_to_token_id?addr=0x072D4F3FA4661228ed0c9872007fc7e12a581E000FAd7b8f3e3e5bF9E6133207

Success Response Example

{
  "token_id": "718722140035"
}

Error Response Example

https://api.starknet.id/addr_to_token_id?addr=0x00Ec0ED6E46a4435C6324D47EADeaadFBc9f66D372F4Cf36b767F5F26754bB47

no main domain found for this address

Token id to data

Retrieve the data of a Starknet ID.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/id_to_data

Query Parameters

NameTypeDescription
idstringThe id to query

Response

The API will retrieve the data (Social Media, Avatar, Proof of personhood...) of the Starknet ID.

Example request

https://api.starknet.id/id_to_data?id=12

Success Response Example

{
  "domain": "66868.stark",
  "addr": "0x016ebaaccb6a06c0c42be5d57b7dc0c86985af1aa73e9a17ecdda5df798813ae",
  "domain_expiry": 1702361677,
  "is_owner_main": false,
  "owner_addr": "0x016ebaaccb6a06c0c42be5d57b7dc0c86985af1aa73e9a17ecdda5df798813ae",
  "starknet_id": "12",
  "img_url": null
}

Error Response Example

https://api.starknet.id/id_to_data?id=10123891239013292

starknet id not found

Domain to data

Retrieve the data of a domain.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/domain_to_data

Query Parameters

NameTypeDescription
domainstringThe domain to query

Response

The API will retrieve the data (Social Media, Avatar, Proof of personhood...) of the domain.

Example request

https://api.starknet.id/domain_to_data?domain=fricoben.stark

Success Response Example

{
  "domain": "fricoben.stark",
  "addr": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3",
  "domain_expiry": 1835881200,
  "is_owner_main": true,
  "owner_addr": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3",
  "github": "78437165",
  "twitter": "1255853529866145794",
  "discord": "662387807901188096",
  "old_github": "78437165",
  "old_twitter": "1255853529866145794",
  "old_discord": "662387807901188096",
  "proof_of_personhood": true,
  "starknet_id": "8",
  "img_url": "https://api.briq.construction/v1/preview/starknet-mainnet/0x2cfc5dbd15e395fd598f35bae2300322d0227760be5e9621000000000000000.png"
}

Error Response Example

https://api.starknet.id/domain_to_data?domain=qqqqqqqqqs.stark

Error while fetching from database

Data to token ids

SOON Available


Uri

Retrieve the NFT uri of a Starknet ID.

Method & URL

  • HTTP Method: GET
  • API URL: https://api.starknet.id/uri

Query Parameters

NameTypeDescription
idstringThe id to query

Response

The API will retrieve the uri of the Starknet ID NFT.

Example request

https://api.starknet.id/uri?id=12

Success Response Example

{
  "name": "66868.stark",
  "description": "This token represents an identity on StarkNet.",
  "image": "https://starknet.id/api/identicons/12",
  "expiry": 1702361677,
  "attributes": [
    { "trait_type": "Subdomain", "value": ["yes"] },
    { "trait_type": "Domain expiry", "value": ["Dec 12, 2023"] },
    { "trait_type": "Domain expiry timestamp", "value": ["1702361677"] }
  ]
}

Inexistant Starknet ID Response Example

https://api.starknet.id/uri?id=1627381236172

{
  "name": "Starknet ID: 1627381236172",
  "description": "This token represents an identity on StarkNet.",
  "image": "https://starknet.id/api/identicons/1627381236172",
  "expiry": null,
  "attributes": null
}