Welcome to the NutriData API documentation. This API provides information about various foods, recipes, and nutritional data.
Below are the available API endpoints:
Retrieve a list of all available foods.
GET /api/foods
Authentication is required to access certain endpoints. Follow the authentication process to obtain an API key.
Authorization: Bearer your_api_key
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
}
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"