API Documentation
Sample Integration
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.
Prerequisites
Code Example
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:
- Encode an image file to base64.
- Prepare the payload with the encoded image data.
- Send a POST request to the
/scanImage
endpoint. - Process the response, handling both successful analyses and potential errors.
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).