PHPackages                             marcortola/food-data-central - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. marcortola/food-data-central

ActiveLibrary[API Development](/categories/api)

marcortola/food-data-central
============================

Community API client for the Food Data Central USDA nutrient database

0.0.6(5y ago)41.1k2[1 PRs](https://github.com/marcortola/food-data-central/pulls)MITPHPPHP &gt;=7.4CI failing

Since May 16Pushed 3y ago2 watchersCompare

[ Source](https://github.com/marcortola/food-data-central)[ Packagist](https://packagist.org/packages/marcortola/food-data-central)[ Docs](https://github.com/marcortola/food-data-central)[ RSS](/packages/marcortola-food-data-central/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (8)Versions (7)Used By (0)

Community API client for the Food Data Central USDA nutrient database
=====================================================================

[](#community-api-client-for-the-food-data-central-usda-nutrient-database)

[![Latest Version](https://camo.githubusercontent.com/445aa5f05aeef785abd37812f5e2ebac1eec1166de982ffd7540b571be9d1487/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d6172636f72746f6c612f666f6f642d646174612d63656e7472616c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/marcortola/food-data-central/releases)[![Build Status](https://camo.githubusercontent.com/36e2ebbee6c389a453478a2da501ee9acb895c53b0c06b627e02d00371394bde/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d6172636f72746f6c612f666f6f642d646174612d63656e7472616c2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/marcortola/food-data-central)

Installation
------------

[](#installation)

1. [Install Composer](https://getcomposer.org/download/)
2. Execute:

```
$ composer require marcortola/food-data-central

```

This wrapper doesn't bundle the HTTP client so you are free to use your preferred one. You can inject it in the FoodDataCentralClient constructor or let the wrapper discover it. If you don't know what I am talking about, the fast solution is to require these packages:

```
$ composer require php-http/curl-client nyholm/psr7 php-http/message

```

Usage
-----

[](#usage)

```
$foodDataCentralClient = FoodDataCentralClient::create('your_api_key');

// Find food by FDC ID.
$foodItem = $foodDataCentralClient->food()->food(781125);

// Find food nutrients. See the FoodItem interface for more nutrient finders.
$calcium = $foodDataCentralClient->food()->food(781125)->getCalcium();
```

Read the Food Data Central API documentation [here](https://fdc.nal.usda.gov/api-spec/fdc_api.html).

License
-------

[](#license)

Licensed under the MIT License. See [License File](LICENSE) for more information about it.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~67 days

Recently: every ~84 days

Total

6

Last Release

1850d ago

PHP version history (2 changes)0.0.1PHP ^7.4

0.0.6PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/7cb342c647d69ea9b4d356eedfff75e22bf0b218a08b5f6dc7da163d4414d2b2?d=identicon)[marcortola](/maintainers/marcortola)

---

Top Contributors

[![marcortola](https://avatars.githubusercontent.com/u/15958009?v=4)](https://github.com/marcortola "marcortola (15 commits)")

---

Tags

fdcfood-datafood-data-centralnutrient-databaseusdausda-nutrient-database

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleECS

Type Coverage Yes

### Embed Badge

![Health badge](/badges/marcortola-food-data-central/health.svg)

```
[![Health](https://phpackages.com/badges/marcortola-food-data-central/health.svg)](https://phpackages.com/packages/marcortola-food-data-central)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

963.1M35](/packages/getbrevo-brevo-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
