Asynchronous identification - flowerchecker/plant-id-examples GitHub Wiki

Send photos for identification

https://api.plant.id/v2/enqueue_identification

Send photos for identification and retrieve the result later with another request.

Request

Request method:

  • POST

Required parameters:

  • images - a list of one or more images of the plant you want to identify (images should be encoded as strings in Base64)

Optional parameters:

  • latitude - geographic coordinate (float)
  • longitude - geographic coordinate (float)
  • modifiers - list of strings, that influences the identification process and results (speed, accuracy, response content, health assessment etc.), see the list of available modifiers
  • callback_url - URL where we POST results after identification is completed
  • custom_id - identifier you can set for your purpose (int)
  • datetime - timestamp in seconds (int)

Response

ID of the identification. Use it to get the identification result with one of the following requests.

Get identification result

https://api.plant.id/v2/get_identification_result/ID

https://api.plant.id/v2/get_identification_result/custom_id/CUSTOM_ID

Check whether identification with given ID (or your CUSTOM_ID) has been already proceeded and return its result.

Request

Request method:

  • POST

Optional parameters:

  • plant_language - language code (ISO 639-1) used for plant_details (default "en")
  • plant_languages - list of up to 3 language codes (ISO 639-1) used for language-dependent plant_details (do not combine with the parameter plant_language) When used the respective fields in the response will turn into dictionaries with the language code as a key.
  • plant_details - list of strings, that determines which information about the plant (e.g. common names) will be included in the response, see the list of available strings
  • 🆕 disease_details - list of strings, that determines which information about the plant diseases (e.g. description) will be included in the response, see the list of available disease details

Response

The result in the JSON format contains a list of suggestions of possible plant species or genuses (taxons). Each suggestion contains:

  • id - id of the suggestion (you can use to (un)confirm the suggestion)
  • plant_name - the name of the plant in our database
  • plant_details - info you requested (if available), see plant_details documentation
  • 🆕 disease_details - info you requested (if available), see disease_details documentation
  • probability - certainty level that suggested plant is the one from the photo
  • confirmed - confirmation status (bool)
  • similar-images - list of representative images of the identified species carefully selected by the model, so it resembles the input image (Similar images are included in the result only if you add the value similar_image in the modifiers list in the request.), the list contains dictionaries with image data (id, similarity, url, url_small)

In addition to species suggestions, a parameter is_plant_probability is also available. It expresses the probability if there is a plant in the photo. Can be used, for example, to filter irrelevant photos.

If you do not get any suggestions in the response, you may still try to get the result later with the request get_identification_result.

See the JSON response example.

Get multiple identifications result

https://api.plant.id/v2/get_identification_result/multiple

Get results of more identifications at once.

Request method:

  • POST

Specify at least one of the following parameters:

  • ids - list of ids provided by the identification response
  • custom_ids - list of ids provided by you in the identification request