Developer API
Programmatic access to the FoodAtlas knowledge graph
The public API exposes the same food–chemical–disease graph that powers this site, with stable resource-shaped responses suited for research scripts. The interactive OpenAPI reference lives at https://api.foodatlas.ai/docs.
Get an API key
Keys are issued by hand to keep the door open without inviting abuse. Email aifs@ucdavis.edu with your name, affiliation, and a one-line description of what you're building. You'll usually hear back within a few business days.
Use is intended for academic and non-commercial research. Please cite FoodAtlas in any published work.
Setup
Base URL
All endpoints live under
https://api.foodatlas.ai Authentication
Send your key in the Authorization header with the Bearer scheme:
curl -H "Authorization: Bearer YOUR_KEY" \
https://api.foodatlas.ai/v1/foods/FA:0001Examples
Python
import requests
resp = requests.get(
"https://api.foodatlas.ai/v1/triplets",
params={"head_id": "FA:0001", "relationship": "contains"},
headers={"Authorization": "Bearer YOUR_KEY"},
)
resp.raise_for_status()
print(resp.json())Endpoints
Full request/response schemas and an interactive console live at https://api.foodatlas.ai/docs. Pagination is offset-based: ?page=&page_size= (max 100).
| Method | Path | Summary |
|---|---|---|
| GET | /v1/foods | List foods (paginated, filterable) |
| GET | /v1/foods/{id} | Get one food |
| GET | /v1/foods/{id}/chemicals | Chemicals contained in a food |
| GET | /v1/foods/{id}/taxonomy | IS_A ancestry |
| GET | /v1/chemicals | List chemicals |
| GET | /v1/chemicals/{id} | Get one chemical |
| GET | /v1/chemicals/{id}/foods | Foods containing a chemical |
| GET | /v1/chemicals/{id}/diseases | Disease correlations (reduces|worsens) |
| GET | /v1/diseases | List diseases |
| GET | /v1/diseases/{id} | Get one disease |
| GET | /v1/diseases/{id}/chemicals | Chemical correlations (reduces|worsens) |
| GET | /v1/triplets | Knowledge-graph edges (head, relationship, tail) |
| GET | /v1/triplets/{id} | Get one triplet |
| GET | /v1/attestations/{id} | Raw evidence row backing a triplet |
| GET | /v1/search | Trigram autocomplete |
| GET | /v1/stats | Aggregate counts |
| GET | /v1/bundles | Released bulk-download bundles |
Versioning & terms
Routes under /v1/ follow a stable contract. Breaking changes ship under a new prefix ( /v2/ ) — we will not change response shapes within /v1/ .
Bulk downloads of released data are available under Downloads and via /v1/bundles . Use those for corpus-scale work rather than scraping the API.
About AIFS
The AI Institute for Next Generation Food Systems, or AIFS aims to meet growing demands in our food supply by increasing efficiencies using Al and bioinformatics spanning the entire system–from growing crops through consumption. We are dedicated to creating AI applications for a healthier, more sustainable planet from farm to fork.
Connect with us
Subscribe to our newsletter to stay up-to-date on AIFS events, industry news, and AI research.