Skip to content

Migration

To use the new API version, you need to change the URL and model name.

URL

The old url was:

https://autoderm-api.firstderm.com/Query

The new url is:

https://autoderm.firstderm.com/v1/query

Parameters

In our previous API you could send other parameters like sex or age. These are not needed any more. We provide the same (or better) accuracy and you only need to send the image. Apart from that, the parameter Image becomes file.

The rest of the parameters are still the same. However, in order to avoid confussion, everything is now lowercase. So the parameters Model and Language become: model and language.

To sum up. The parameters in the old API:

  • Image (form data [bytes])
  • AgeYears (form data [number])
  • Sex (form data [string])
  • Language (form data [string])

The parameters in the new API:

  • file (form data [bytes])
  • model (url parameter [string])
  • language (url parameter [string])

As with the old API, the language and model parameters are optional. By default it uses "en" (english) and the latest model.

Form data vs URL parameters.

In the old API, all the data was passed as form data. In the new API, everything except the image has become an URL parameter. The advantage is that you can put parameters directly in the URL where you are sending the query. Lets illustrate it with an example using the Python library requests.

Using the old API you would send the information like this:

import requests
import os

# simulate opening an image and reading the bytes data
with open("sample_image.jpg", "rb") as f:
    image_contents = f.read()

response = requests.post(
         "https://autoderm-api.firstderm.com/Query",
         headers={"Api-Key": os.getenv("DERM_API_KEY")},
         files={"Image": image_contents},
         data={"Language": "EN", "Model": "43PLUS_noo_v3"},
     )

In the new API you can do it this way:

import requests
import os

# simulate opening an image and reading the bytes data
with open("sample_image.jpg", "rb") as f:
    image_contents = f.read()

response = requests.post(
         "https://autoderm.firstderm.com/v1/query?model=autoderm_v2_0&language=en",
         headers={"Api-Key": os.getenv("DERM_API_KEY")},
         files={"file": image_contents},
     )

Notice the change from files={"Image": image_contents} to files={"file": image_contents}.

"Image" -> "file"

Or:

import requests
import os

# simulate opening an image and reading the bytes data
with open("sample_image.jpg", "rb") as f:
    image_contents = f.read()

response = requests.post(
         "https://autoderm.firstderm.com/v1/query",
         headers={"Api-Key": os.getenv("DERM_API_KEY")},
         files={"file": image_contents},
         params={"language": "en", "model": "autoderm_v2_0"},
     )

Notice the change from data={"Language": "EN", "Model": "43PLUS_noo_v3"} to params={"language": "en", "model": "autoderm_v2_0"}.

data=... -> params=...

Note

If you don't pass the parameters model or language, it will default to using the latest model and english.

Authentication

Like in the old API, the authentication is done sending your API key in an HTTP header called Api-Key.

import requests
import os

# simulate opening an image and reading the bytes data
with open("sample_image.jpg", "rb") as f:
    image_contents = f.read()

response = requests.post(
         "https://autoderm.firstderm.com/v1/query",
         headers={"Api-Key": os.getenv("DERM_API_KEY")},
         files={"file": image_contents},
         params={"language": "en", "model": "autoderm_v2_0"},
     )