Katalog Narzędzi MCP & Endpointów REST API
Global Food Products & Barcodes (Open Food Facts + USDA)
Comprehensive global food catalog integrating Open Food Facts and USDA FoodData Central. Query products by commercial barcode (EAN-13, UPC), manufacturer brand, localized product title, categories, and country of origin with multi-currency pricing.
https://www.dietspremium.com/api/v1/food-world
application/json; charset=utf-8
Authorization: Bearer <API_KEY>
Request Parameters
| Parameter | Data Type | Requirement | Description | Example |
|---|---|---|---|---|
query
|
string | Optional | Product name or keywords (e.g. "Coca-Cola Zero", "Nutella") | —
|
barcode
|
string | Optional | EAN-13 or UPC barcode string (e.g. "5449000000996") | —
|
brand
|
string | Optional | Manufacturer / brand name (e.g. "Barilla", "Nestle") | —
|
locale
|
string | Optional | Target language locale | en
|
currency
|
string | Optional | Currency for pricing (EUR, PLN, USD, ALL) | locale default
|
page
|
integer | Optional | Pagination page index | 1
|
HTTP Status Codes
| Kod HTTP | Status | Znaczenie i Obsługa |
|---|---|---|
| 200 OK | Sukces | Request processed successfully |
| 400 Bad Request | Błąd walidacji | Invalid request parameters |
| 401 Unauthorized | Brak autoryzacji | Missing or invalid X-API-KEY |
| 429 Too Many Requests | Rate Limit | Rate limit or quota exceeded |
| 500 Server Error | Błąd serwera | Internal server error |
Example HTTP Request
POST /api/v1/food-worldcurl -X POST 'https://www.dietspremium.com/api/v1/food-world'
curl -X POST "https://www.dietspremium.com/api/v1/food-world" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"query": "barilla spaghetti",
"brand": "Barilla",
"locale": "pl",
"currency": "ALL"
}'
Example JSON Response (200 OK)
HTTP/2 200 OK • application/json{
"items": [
{
"id": 104291,
"name": "Spaghetti n.5",
"brand": "Barilla",
"barcode": "8076809513753",
"nutriscore_grade": "a",
"ecoscore_grade": "b",
"kcal": 359,
"proteins": 12.5,
"fats": 2.0,
"carbs": 70.9,
"has_price": true,
"price": {
"amount": 1.49,
"currency": "EUR"
}
}
],
"total": 1,
"page": 1
}
Obsługa paginacji i filtrów dla /api/v1/food-world
Best Practice
Zalecenia produkcyjne dla deweloperów
Zalecenia produkcyjne dla deweloperów
page / max_results
Sprawdzaj flagę "hasMore" oraz "total" w odpowiedzi JSON przed pobraniem kolejnej strony.
ai=true
Ustaw ai=true dla zapytań w języku naturalnym lub ai=false dla ścisłego dopasowania słów kluczowych.
Klient HTTP dla zasobu Global Food Products & Barcodes (Open Food Facts + USDA)
“Pobierz dane z /api/v1/food-world dla języka EN z użyciem wektora k-NN.”
→ POST /api/v1/food-world (locale=en, ai=true)
← 200 OK (application/json)