PHPackages                             braunson/fatsecret-laravel - 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. braunson/fatsecret-laravel

ActiveLibrary[API Development](/categories/api)

braunson/fatsecret-laravel
==========================

A PHP FatSecret API library for Laravel

5.1.0(6y ago)198.1k9MITPHPPHP ^7.1.3CI failing

Since Jun 14Pushed 1y ago3 watchersCompare

[ Source](https://github.com/Braunson/fatsecret)[ Packagist](https://packagist.org/packages/braunson/fatsecret-laravel)[ Docs](https://github.com/braunson/fatsecret-laravel)[ RSS](/packages/braunson-fatsecret-laravel/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (4)Versions (6)Used By (0)

FatSecret API for Laravel
=========================

[](#fatsecret-api-for-laravel)

[![StyleCI](https://camo.githubusercontent.com/6e83e3fd5d2f0ee132458dd1794f2d5588041889308aad9ba5b94934888c4ff7/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f32303738353538392f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/20785589)[![Build Status](https://camo.githubusercontent.com/d40d65f62de090229aabc7d092691503e959c6757719a0b5178fd41a5a155d4d/68747470733a2f2f7472617669732d63692e6f72672f427261756e736f6e2f6661747365637265742d6c61726176656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Braunson/fatsecret-laravel)[![codecov](https://camo.githubusercontent.com/2004ddb6a218045ee2f207591f1a815a7af241f35b37f70e91b5da283d6672b2/68747470733a2f2f636f6465636f762e696f2f67682f427261756e736f6e2f6661747365637265742d6c61726176656c2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/Braunson/fatsecret-laravel)

The FatSecret API for Laravel gives you access to the FatSecret API.

[FatSecret](http://platform.fatsecret.com/api) provides you with access to comprehensive nutrition data for many thousands of foods, not to mention a range exercises and great weight management tools for your applications.

Requirements
------------

[](#requirements)

- Laravel versions: 5.6, 5.7 and 5.8

Looking for 4.x Compatibility?
------------------------------

[](#looking-for-4x-compatibility)

While it may be unsupported now, you can find 4.x compatible versions in the `laravel4` branch or tagged with `4.0`

How to Install
--------------

[](#how-to-install)

1. Install the `braunson/fatsecret-laravel` package

    ```
    $ composer require "braunson/fatsecret-laravel"
    ```
2. Update `config/app.php` to activate FatSecret package

    ```
    # Add `FatSecretServiceProvider` to the `providers` array
    'providers' => [
    	...
    	Braunson\FatSecret\ServiceProvider::class,
    ]

    # Add the FatSecret Facade to the `aliases` array
    'aliases' => [
    	...
    	'FatSecret' => Braunson\FatSecret\Facades\Facade::class,
    ]
    ```

Configuration
-------------

[](#configuration)

1. Publish the config file:

    ```
    php artisan vendor:publish --provider="Braunson\FatSecret\ServiceProvider"
    ```
2. Open your `.env` file and add in

    ```
    FATSECRET_KEY=YOUR-API-KEY
    FATSECRET_SECRET=YOUR-API-SECRET

    ```

Usage
-----

[](#usage)

When you are using this package in a file, make sure to add this to the top of your file:

```
use Fatsecret;
```

The FatSecret is available as `FatSecret`, for example:

```
FatSecret::ProfileCreate($userID, &$token, &$secret);
```

For more information on using the FatSecret API check out the [documentation](http://platform.fatsecret.com/api/)

Methods
-------

[](#methods)

```
FatSecret::searchIngredients($search_phrase, $page, $maxresults)
```

- Search ingredients by phrase, page and max results

```
FatSecret::getIngredient($ingredient_id)
```

- Retrieve an ingredient by ID

```
FatSecret::GetKey()
```

- Gets the set consumer key

```
FatSecret::SetKey()
```

- Allows overriding or setting of the consumer key

```
FatSecret::GetSecret()
```

- Gets the set secret key

```
FatSecret::SetSecret()
```

- Allows overriding or setting of the secret key

```
FatSecret::ProfileCreate($userID, $token, $secret)
```

- Allows creation of a profile in FS with a user specific ID.

```
FatSecret::ProfileGetAuth($userID, $token, $secret)
```

- Get the authentication details of a profile

```
FatSecret::ProfileRequestScriptSessionKey($auth, $expires, $consumeWithin, $permittedReferrerRegex, $cookie, $sessionKey)
```

- Create a new session for JavaScript API users

Reporting Bugs or Feature Requests
----------------------------------

[](#reporting-bugs-or-feature-requests)

Please report any bugs or feature requests on the github issues page for this project here:

Contributing
------------

[](#contributing)

- [Fork](https://help.github.com/articles/fork-a-repo) the [FatSecret on github](https://github.com/braunson/fatsecret)
- Commit and push until you are happy with your contribution
- Run the tests to make sure they all pass: `composer install && ./vendor/bin/phpunit`
- [Make a pull request](https://help.github.com/articles/using-pull-requests)
- Thanks!

License
-------

[](#license)

The FatSecret Laravel API is free software released under the MIT License. See [LICENSE](https://github.com/braunson/fatsecret/blob/master/LICENSE) for details. This is not an official release and is released separately from FatSecret.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.6% 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 ~428 days

Total

4

Last Release

2386d ago

Major Versions

4.0 → 5.0.12017-08-13

PHP version history (2 changes)5.0PHP &gt;=5.4.0

5.1.0PHP ^7.1.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/63da0e8217209947f209b77dbf342ec7bbc4507e986fa09a9c2a6c2708547738?d=identicon)[BraunsonYager](/maintainers/BraunsonYager)

---

Top Contributors

[![Braunson](https://avatars.githubusercontent.com/u/577273?v=4)](https://github.com/Braunson "Braunson (28 commits)")[![mazedlx](https://avatars.githubusercontent.com/u/9453522?v=4)](https://github.com/mazedlx "mazedlx (1 commits)")

---

Tags

laravelsecretfatsecretfatbraunson

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/braunson-fatsecret-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/braunson-fatsecret-laravel/health.svg)](https://phpackages.com/packages/braunson-fatsecret-laravel)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.9k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[riclep/laravel-storyblok

A Laravel wrapper around the Storyblok API to provide a familiar experience for Laravel devs

6279.6k5](/packages/riclep-laravel-storyblok)

PHPackages © 2026

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