Sample request
import requests
import base64
import json
payload = {"image": "https://bit.ly/3JXlkkA"}
url = "https://hydra-ai.p.rapidapi.com/dev/faces/analyse/"
headers = {
"content-type": "application/json",
"X-RapidAPI-Host": "hydra-ai.p.rapidapi.com",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
data = response.json()
print(data)
or
payload = {"image": base64.b64encode(open("image.jpg", "rb").read()).decode("utf-8")}
url = "https://hydra-ai.p.rapidapi.com/dev/faces/analyse/"
headers = {
"content-type": "application/json",
"X-RapidAPI-Host": "hydra-ai.p.rapidapi.com",
"X-RapidAPI-Key": "YOUR_RAPIDAPI_KEY"
}
response = requests.request("POST", url, json=payload, headers=headers)
data = response.json()
print(data)