Product API
Introduction
Getting Started

Getting started

Opening a Grocery API account is done on https://dashboard.foodin.ai (opens in a new tab) where companies can open an account. Usually they contact our sales team that can evaluate what is the best package.

Set up account

On https://dashboard.foodin.ai (opens in a new tab), click sign up. Fill out the registration form with your personal information, including your name, email address, and desired password You have to purchase a package depending on how many groceries you need to include in an app.

Generating API

Once your account is set up, log in to the Foodin developer portal. In the developer portal, navigate to the "API Keys" section and click on the "Generate API Key" button. Enter a name for your API key and select the scope of access you need for your application. Click on the "Generate" button to create your API key. Your new API key will be displayed, copy and safe it in a secure place, you will need it to authenticate your API requests. You can use this API key to make API calls and access the data provided by the Foodin Product API.

Making your API call

const axios = require('axios');
 
async function getProducts() {
    try {
        const apiKey = 'YOUR_API_KEY';
        const endpoint = 'https://api.foodin.ai/products;
        const res = await axios.get(endpoint, {
            headers: {
                'Authorization': `Bearer ${apiKey}`
            }
        });
        console.log(res.data);
    } catch (err) {
        console.log(err);
    }
}
getProducts();