Skip to content

inji-gg/fooddata-central-api

Repository files navigation

fooddata-central-api

Wrapper over FoodData Central Rest APIs for Typescript


API Reference


Setup

  1. Acquire an API Token from FDC here. Note the rate limits.
  2. Expose the API Token as an Environment Variable FDC_API_KEY.

Usage

Right now only the Food Search API - /v1/foods/search - is supported

const searchCriteria: FoodSearchCriteria = {
  query: "milk",
  dataType: [DataType.BRANDED],
  pageSize: 1,
  pageNumber: 1,
  startDate: "2019-01-01",
  endDate: "2023-01-01",
};
const searchResult: SearchResult = await findFood(searchCriteria);

This api is provided by U.S. Department of Agriculture, Agricultural Research Service. FoodData Central, 2019. fdc.nal.usda.gov.

About

Wrapper over FoodData Central Rest APIs for Typescript

Resources

License

Stars

Watchers

Forks

Packages

No packages published