NutriData API Documentation

Welcome to the NutriData API documentation. This API provides information about various foods, recipes, and nutritional data.

API Endpoints

Below are the available API endpoints:

GET /foods

Retrieve a list of all available foods.

GET /api/foods

Authentication

Authentication is required to access certain endpoints. Follow the authentication process to obtain an API key.

Authorization: Bearer your_api_key

Response Format

The API responds with data in JSON format. Here is an example response:

{
    "food_id": 123,
    "food_name": "Example Food",
    "calories": 250,
    "protein": 10,
    "carbohydrates": 30,
    "fat": 12
}

API Usage

To use the API, make HTTP requests to the respective endpoints. Ensure proper authentication when required.

Example request using cURL:

curl -X GET https://api.example.com/api/foods -H "Authorization: Bearer your_api_key"