0

I want to add ENS support to an app I am building, and I am looking for a lightweight API which supports ENS to Ethereum address conversion.

All the documentation shows how you can do this on the blockchain, and it appears like Web3.js will work, but I am wondering if there is anything more lightweight than this, like a public GET API which returns JSON.

0

You can register an API key at https://etherscan.io/apis and call their JSON API. I think if you experiment a bit by calling the name service contract, you should be able to extract this information.

Specifically you can call the contract module via the getabi method, passing the contract address.

https://api.etherscan.io/api?\
module=account&\
action=balance&\
address=<your contract address>&\
tag=latest&\
apikey=<your API key>

You can simply use the ENS name instead of the address. This also works with the account module.

5
  • I must be blind. Where is the ens api mentioned in the documentation? – Shawn Tabrizi Dec 12 '17 at 10:00
  • If you like the answer, upvote it. – Mundi Dec 12 '17 at 11:09
  • I'm sorry, I don't like the answer because I do not see evidence of an API at etherscan – Shawn Tabrizi Dec 12 '17 at 15:04
  • Hmmm, I included the link... Tell me how you want me to improve the answer rather than down-voting. – Mundi Dec 13 '17 at 14:08
  • 1
    I did not down vote you. Others did for the same reason I did not accept your answer. Etherscan.io does not appear to expose a public API which resolves ens names. Show me where it does, and the documents in for it, and I will be happy to give you a positive vote. – Shawn Tabrizi Dec 13 '17 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.