Ready-to-Use Code in 35+ Languages
Obtain code samples in 35+ programming languages to start your LogMeal API integration right-away.
The LogMeal API is designed to get you productive fast. With ready-to-use code snippets in over 35 programming languages, you can make your first request in minutes.
Step 1: Import the Postman Collection
- Download our official openapi.yaml documentation file from this link.
- Follow these instructions for importing the collection into Postman.
Step 2: Rename the Authorization Variable
When importing, Postman automatically assigns a placeholder variable {{bearerToken}}
for authentication in all endpoints. To make this clearer and more useful:
-
The first time you open your new Postman collection:
- Open the Variables tab of the collection, add three new variables named
APICompanyToken
,APIUserToken,
andAPIUserManagerToken
. For each of them, create an copy a valid token value. See Users Types & Access Tokens for details. - Save the collection. Now all requests will be able to use your chosen variable instead of the generic
{{bearerToken}}
.
- Open the Variables tab of the collection, add three new variables named
-
The first time you open a specific endpoint/request from inside the Postman collection:
- Open the Authorization tab.
- Change the token value from
{{bearerToken}}
to your preferred variable name depending on the endpoint permissions (see Users Types & Access Tokens). For example{{APICompanyToken}}
,{{APIUserToken}}
or{{APIUserManagerToken}}
.
Step 3: Run Your First Request
- Select the Image-based Food Recognition > Multiple Food Dishes Segmentation request.
- Upload a sample food image.
- Send the request and check the JSON response.
Step 4: Generate Code in Your Language
Postman can instantly generate code for your preferred language or framework:
- Click
</> Code
in the request window. - Choose from Python, JavaScript, Java, Go, Swift, PHP, C#, Ruby, and many more.
- Copy and paste into your application.
What’s Next?
- Learn about how to apply the appropriate Image Pre-processing
- Dive into the full API Reference
- Explore detailed use cases with recommended workflow and code examples:
Image-based Food Recognition with User Confirmation
Capture a meal photo, get top dish predictions, and let the user confirm/refine results before saving.
Ingredients List Retrieval
Retrieve standardized recipe ingredients and quantities for confirmed dishes from a food intake.
Nutritional Information Retrieval
Extract per‑dish macro & micro nutrients from a confirmed intake using standardized ingredients.
Food Quantity Detection
Capture a depth‑based image sequence around food items to estimate their quantities using the Quantity Detection API.
Food Quantity Confirmation
Confirm how much was eaten (grams or Small/Medium/Big portion) and auto‑recalculate ingredients & nutrition.
Units of Measurement & User Preferred Measurements
Adapt measures to user preferences (metric/imperial, cooking measures, portions) while keeping grams as the source of truth.
Updated about 10 hours ago