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 3w ago

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

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

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

1901d 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

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[openai-php/client

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

5.8k28.0M309](/packages/openai-php-client)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M49](/packages/getbrevo-brevo-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k13](/packages/tempest-framework)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60216.0M82](/packages/mollie-mollie-api-php)

PHPackages © 2026

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