Important — Breaking API changes in v3.0.0

In the run-up to a new version of EtherScamDB we would like to make an important announcement about breaking changes made to the new API, which will be released in version 3.0.0

TL;DR — What changes do I need to make to be compatible?

  • Please change all /scam/:id urls to /domain/:url. For example, https://etherscamdb.info/scam/1 will need to be replaced with https://etherscamdb.info/domain/xn--myetherwallt-leb.com. You can also use our new short urls, https://esdb.link/xn--myetherwallt-leb.com
  • If you use one of our API endpoints and you’re using the id property to determine sorting, use the natural order of entries of the data files and API endpoints (first entries are oldest!)
  • If you use one of our API endpoints for scam lookups and you’re using the name property to determine the corresponding name, either replace it by the url property or use a library to extract the hostname from the url (for example; in JavaScript you could do const {name} = new URL(scam.url) where scam is a valid entry)
  • Because some client-side HTTP request tools automatically parse content based on the Content-Type header, you might incorrectly be trying to parse the JSON data twice. For example; take a look at this jQuery code:
The $.get and $.ajax functions automatically determine JSON for the v3 API, while they don’t for the v2 API. This means that v2 will return a (JSON-encoded) string, while v3 will automatically return an object. Luckily, you can use the $.getJSON function for compatibility across v2 and v3

If you want to be sure your code is functioning no matter which content-type is being returned, you can also implement a conditional JSON parse (For example; a oneliner in JS: if (typeof data === ‘string’) data = JSON.parse(data);

What will be changed?

For users who use our raw data (files served directly from Github):

  • scams.yaml will no longer contain id and name properties
  • legit_urls.yaml will no longer contain the id property

For users who use our API (https://etherscamdb.info/api):

  • All endpoints will now return Content-Type application/json instead of text/html
  • Every endpoint which is used to return entries from scams.yaml (/api/scams/, /api/addresses/, /api/ips/, /api/actives/, /api/inactives/) will no longer include id and name properties
  • Every endpoint which is used to return entries from legit_urls.yaml (only /api/verified/) will no longer include the id property

For users who link to our site:

  • The /scam/:id endpoint will be deprecated and permanently replaced by the /domain/:url endpoint

What less important changes will be made?

Testing

If you would like to try out the beta version or want to check if your application is fully compatible with the new version, head to https://beta.etherscamdb.info.

Contact us

If you need help upgrading your application to be compatible with the new changes, or want to get into contact with us for a different reason, feel free to open an issue on Github or shoot us an email.