This example demonstrates how to use our Food Analysis API to analyze a food image using Python. We will use the requests
library to make the API call and base64
to encode the image.
Python Prerequisites
requests
library (install with pip install requests
)Node.js Prerequisites
axios
library (install with npm install axios
)This example demonstrates how to use the Food Analysis API to analyze a food image. We’ll show how to do this in both Python and Node.js.
Both examples do the following:
/scanImage
endpoint.Remember to replace "path/to/your/image.jpg"
with the actual path to your image file, and ensure you have the necessary libraries installed (requests
for Python, axios
for Node.js).
This example demonstrates how to use our Food Analysis API to analyze a food image using Python. We will use the requests
library to make the API call and base64
to encode the image.
Python Prerequisites
requests
library (install with pip install requests
)Node.js Prerequisites
axios
library (install with npm install axios
)This example demonstrates how to use the Food Analysis API to analyze a food image. We’ll show how to do this in both Python and Node.js.
Both examples do the following:
/scanImage
endpoint.Remember to replace "path/to/your/image.jpg"
with the actual path to your image file, and ensure you have the necessary libraries installed (requests
for Python, axios
for Node.js).