It provides REST access to FoodData Central (FDC). It is intended primarily to assist application developers wishing to incorporate nutrient data into their applications or websites.
Engineers use the USDA FoodData Central API with `requests` and an API key, querying the `/food/{fdcId}` and `/foods/search` endpoints. Nutrient data is parsed from nested JSON into pandas DataFrames for nutritional analysis and food classification models.
FoodData Central enables AI-powered nutrition assistants that answer 'How much protein is in a cup of cooked lentils?' with USDA-verified data. RAG pipelines built on this dataset ground dietary chatbots in authoritative nutritional science rather than hallucinated values.
# pip install requests pandas
import requests, pandas as pd
resp = requests.get(
"https://api.nal.usda.gov/fdc/v1/foods/search",
params={"query": "avocado", "pageSize": 5, "api_key": "YOUR_API_KEY"}
)
foods = resp.json()["foods"]
df = pd.DataFrame([{"description": f["description"],
"calories": next((n["value"] for n in f.get("foodNutrients", [])
if n["nutrientName"] == "Energy"), None)}
for f in foods])
print(df)Official dataset source
More datasets used by Python data engineers.
The Swedish government monopoly liquor store API providing product catalogues, store locations, inventory, and pricing data. Useful for practising structured API ingestion, building retail analytics pipelines, and learning how to work with government-published commercial datasets in Python.
Access NASA's extensive collection of space data including the Astronomy Picture of the Day, Mars rover photos, near-Earth object tracking, satellite imagery, and Earth observation datasets. Commonly used in scientific data pipelines, geospatial analysis workflows, and educational data engineering projects with Python.
Access free weather forecasts, alerts, observations, and radar data from the US National Weather Service. Used in data engineering pipelines for weather-enriched analytics, emergency alert monitoring, agricultural planning dashboards, and integrating official government weather data into Python applications.