REST API

Resolve .algo names and perform name operations on ANS .algo names.

Resolve .algo name

Resolve .algo name to get the address of the owner. Use query params listed below to get further information including linked socials and other metadata.

Method: GET

https://api.algonameservice.com/names/:name?socials=true&metadata=true

Query Params:

Param NameData TypeRequired/ OptionalDescription

socials

boolean

optional

if true, returns socials along with name information

metadata

boolean

optional

if true, returns metadata along with name information

curl --location --request GET "https://api.algonameservice.com/name/asalyticapp?socials=true&metadata=true"
{
  "found":true,
  "address":"MLFVS7JYC5S7TEWUWDY5HHJTCS3EHWV6KZKOM43Q2RSCX6VZH7DEBJXZYQ",
  "name": "asalyticapp.algo",
  "socials":
  [{
     "key":"twitter",
     "value":"https://twitter.com/asalytic"
  }],
  "metadata":
  [{
    "key":"subdomain",
    "value":""
   },{
    "key":"transfer_to",
    "value":""
   },{
    "key":"transfer_price",
    "value":""
   },{
    "key":"expiry",
    "value":"Sat Mar 04 2023"
   },{
    "key":"name",
    "value":"asalyticapp"
   }
]}

Names owned by address

This GET method gets all the names owned by an Algorand address in reverse chronological order of registration. Use query parameters listed below to get more details about the name including linked socials and other metadata including avatar and transfer information.

Method: GET

https://api.algonameservice.com/account/:address

Query Params:

Param NameDate TypeRequired/ OptionalDescription

socials

boolean

optional

if true, returns the socials of each name along with name information

metadata

boolean

optional

if true, returns metadata along with name information

limit

number

optional

set the limit on number of names to be returned.

curl --location --request GET "https://api.algonameservice.com/account/RANDGVRRYGVKI3WSDG6OGTZQ7MHDLIN5RYKJBABL46K5RQVHUFV3NY5DUE" 
{ "result":
  [
    { 
      "name":"randgallery.algo",
      "expiry":"Sat Feb 25 2023"
    },
    {
      "name":"rand.algo",
      "expiry":"Sat Feb 25 2023"
    }
  ]}

Multiple account reverse lookup

This GET method gets the most recently registered domain name by each of the Algorand address provided through accounts[] query parameter.

curl --location --request GET "https://api.algonameservice.com/account?accounts[]=RANDGVRRYGVKI3WSDG6OGTZQ7MHDLIN5RYKJBABL46K5RQVHUFV3NY5DUE&accounts[]=MLFVS7JYC5S7TEWUWDY5HHJTCS3EHWV6KZKOM43Q2RSCX6VZH7DEBJXZYQ" 
{
    "MLFVS7JYC5S7TEWUWDY5HHJTCS3EHWV6KZKOM43Q2RSCX6VZH7DEBJXZYQ": "asalyticapp.algo",
    "RANDGVRRYGVKI3WSDG6OGTZQ7MHDLIN5RYKJBABL46K5RQVHUFV3NY5DUE": "randgallery.algo"
}

Register a new name

This POST method returns the transactions to be signed to register a .algo name.

Method: POST

https://api.algonameservice.com/names/register/txns

Query Params:

Param NameData TypeRequired/optionalDescription

name

string

required

.algo name to register

address

string (Algorand address format)

required

account address of the sender

period

number

required

number of years to register the name

curl --location --request POST "https://api.algonameservice.com/names/register/txns" \
--data-raw '
{
    "name": "johndoe07.algo", 
    "address": "PRVIUNUJ2TIPL5PK5NFMPTUF2DQL5ZVU7IENDNNB2U4JEGW5FYCEQF2HOQ", 
    "period": 1 
} '

Renew name

Retrieve transactions to renew a name. The ANS registry currently supports renewal only by the owner hence the transactions will fail if the input address is not the current owner of the name.

Method: POST

https://api.algonameservice.com/names/renew

Query Params:

Param NameData TypeRequired/ optionalDescription

name

string (<name>.algo)

required

input .algo name to be renewed

address

string (Algorand Account address)

required

account address of name owner

period

number

required

number of years to extend the name

curl --location --request POST "https://api.algonameservice.com/names/renew" \
--data-raw '
{
    "name": "johndoe07.algo", 
    "address": "PRVIUNUJ2TIPL5PK5NFMPTUF2DQL5ZVU7IENDNNB2U4JEGW5FYCEQF2HOQ",
    "period": 5
} '

Update Name (Set name properties)

Retrieve transactions to set the social media handles of a domain name

Method: POST

https://api.algonameservice.com/names/update
Param NameData TypeRequired/ optionalDescription

name

string (<name>.algo)

required

the .algo name to be updated

address

string (Algorand Account Address)

required

algorand account address, must match the current owner

updatedHandle

JSON string

required

list of social-media handle names and corresponding new values to update

curl --location --request POST "https://api.algonameservice.com/names/update" \
--data-raw '
{
    "name": "johndoe07.algo", 
    "address": "PRVIUNUJ2TIPL5PK5NFMPTUF2DQL5ZVU7IENDNNB2U4JEGW5FYCEQF2HOQ", 
    "updatedHandles": {
        "twitter": "@johndoe",
        "discord": "johndoe#6711"
    }
}'

Initiate transfer

Retrieve the transactions to initiate name transfer. The owner is required to set the price for transfer and the recipient's algorand account address.

Method: POST

https://api.algonameservice.com/names/put-for-transfer
Param NameData TypeRequired/ optionalDescription

name

string (<name>.algo)

required

the .algo name to be transferred

owner

string (Algorand account address)

required

algorand account address, must match the current name owner's address

transfer_to

string (Algorand account address)

required

the recipient's algorand account address

price

number (of ALGOs)

required

the price at which the owner transfers the name

curl --location --request POST "https://api.algonameservice.com/names/put-for-transfer" \
--data-raw '{
    "name": "johndoe07.algo",
    "owner": "PRVIUNUJ2TIPL5PK5NFMPTUF2DQL5ZVU7IENDNNB2U4JEGW5FYCEQF2HOQ",
    "transfer_to": "G5EIF27LMQZPLJP45OYVNSCHIU4JQ2C2PERIDMHWDJOTIXBCZHBS4H5HCU",
    "price": 5
}'

Accept transfer

Retrieve the transactions to complete the transfer by providing the current owner's address, the transfer recipient's address, and the price set by the owner

Method: POST

https://api.algonameservice.com/names/accept-transfer
Param NameData TypeRequired/ optionalDescription

name

string (<name>.algo)

required

the .algo name to be tranferred

current_owner

string (Algorand account address)

required

algorand account address, must match the current owner

new_owner

string (Algorand account address)

required

algorand account address, must match the value of "transfer_to" address of the name

price

number (of ALGOs)

required

payment amount for transfer, must match the value of "transfer_price" set by the name owner

curl --location --request POST "https://ansresolver.com/names/accept-transfer" \
--data-raw '
{
    "name": "johndoe07.algo",
    "current_owner": "PRVIUNUJ2TIPL5PK5NFMPTUF2DQL5ZVU7IENDNNB2U4JEGW5FYCEQF2HOQ",
    "new_owner": "G5EIF27LMQZPLJP45OYVNSCHIU4JQ2C2PERIDMHWDJOTIXBCZHBS4H5HCU",
    "price": 5
}'

Last updated