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

  1. Download our official openapi.yaml documentation file from this link.
  2. 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:

    1. Open the Variables tab of the collection, add three new variables named APICompanyToken, APIUserToken, and APIUserManagerToken. For each of them, create an copy a valid token value. See Users Types & Access Tokens for details.
    2. Save the collection. Now all requests will be able to use your chosen variable instead of the generic {{bearerToken}}.
  • The first time you open a specific endpoint/request from inside the Postman collection:

    1. Open the Authorization tab.
    2. 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

  1. Select the Image-based Food Recognition > Multiple Food Dishes Segmentation request.
  2. Upload a sample food image.
  3. 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: