Authentication - flowerchecker/plant-id-examples GitHub Wiki
You will need your API key - get one here. There are three ways to authenticate:
Using the request header
Set the Api-Key
key in the headers json.
Python example:
headers = {
"Content-Type": "application/json",
"Api-Key": "123abc",
}
response = requests.post("https://api.plant.id/v2/usage_info",
headers=headers)
Basic authentication
See details here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization. Use the following credentials:
- username: "client"
- password: YOUR_API_KEY
Python example:
headers = {
"Content-Type": "application/json",
}
response = requests.post("https://api.plant.id/v2/usage_info",
headers=headers, auth=("client", "123abc"))
Passing a parameter in POSTed data
Add an "api_key"
parameter to your request.
Python example:
params = {
"api_key": "123abc",
}
headers = {
"Content-Type": "application/json",
}
response = requests.post("https://api.plant.id/v2/usage_info",
json=params,
headers=headers)