Fetch Address by ENS

Guide on how to fetch the address by an ENS name

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/ens/{name}

Parameters

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

Returns a JSON object with the properties below

address ━ String, the address of the ENS name provided.

How to use Ludo API to fetch the address from an ENS name

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

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

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

url = "https://rest-v1.ludo.ninja/ens/vitalik.eth"

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

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

print(response.text)

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

vitalik.eth

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

{
  "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045"
}