Fetch ENS by Address

Guide on how to fetch the ENS name by an address

What is ENS and how does it work?

The Ethereum Name Service (ENS) is a distributed, open, and extensible naming system based on the Ethereum blockchain. It can be used to resolve human-readable names to Ethereum addresses, and vice versa. ENS is designed to be censorship-resistant and to provide a higher level of security than traditional DNS. It is also intended to be more user-friendly than traditional DNS, requiring no special software or configuration. ENS is still in development, but is already functional on the main Ethereum network.

Endpoint

GET https://rest-v1.ludo.ninja/addresses/{address}/ens}

Parameters

address ━ String, the address to get the ENS name of.

Returns a JSON object with the properties below

name ━ String, the ENS name the address provided.

How to use Ludo API to fetch ENS name by an address

The address is needed in order to fetch the ENS name and the endpoint accepts a string as the value, below is an example of how to fetch the ENS name by an address.

curl --request GET \
     --url https://rest-v1.ludo.ninja/addresses/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/ens \
     --header 'accept: application/json'
const options = {method: 'GET', headers: {accept: 'application/json'}};

fetch('https://rest-v1.ludo.ninja/addresses/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/ens', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));
import requests

url = "https://rest-v1.ludo.ninja/addresses/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/ens"

headers = {"accept": "application/json"}

response = requests.get(url, headers=headers)

print(response.text)

In this example we have used the address below to get the ENS name from

0xd8da6bf26964af9d7eed9e03e53415d37aa96045

After a successful result this is how your response will look like

{
  "name": "vitalik.eth"
}