PHPackages                             huitiemesens/withings - 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. huitiemesens/withings

ActiveLibrary[API Development](/categories/api)

huitiemesens/withings
=====================

Withings api library.

02762PHP

Since Mar 30Pushed 10y ago5 watchersCompare

[ Source](https://github.com/huitiemesens/withings)[ Packagist](https://packagist.org/packages/huitiemesens/withings)[ RSS](/packages/huitiemesens-withings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

WithingsPHP
-----------

[](#withingsphp)

Basic wrapper for the OAuth-based [Withings](http://withings.com) [REST API](http://oauth.withings.com). See [oauth.withings.com](http://oauth.withings.com/en/api/oauthguide) for details on their OAuth implementation.

Both this library and the Withings API are in **beta**.

This library does not require the PHP OAuth extension. It should work on any server with PHP &gt;= 5.3.

This bundle allows you to get notification from withings or grab manually informations.

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

[](#installation)

This package is installable with composer: "huitiemesens/withings": "dev-master"

Usage
-----

[](#usage)

You need a consumer key and secret. You can obtain them by registering an application at .

Simple, but full OAuth workflow example with database integration:

- App Authorization

```
        $factory = new \Withings\ApiGatewayFactory;
        $factory->setCallbackURL( $withings_callback_url );
        $factory->setCredentials( $withings_consumer_key , $withings_consumer_secret ); // these variables come from database

        $adapter    = new \OAuth\Common\Storage\Session();
        $factory->setStorageAdapter($adapter);

        $auth_gateway = $factory->getAuthenticationGateway();

        if (isset($_GET['oauth_token']) && isset($_GET['oauth_verifier'])) {
            $auth_gateway->authenticateUser($_GET['oauth_token'], $_GET['oauth_verifier']);

            $storage = $factory->getStorageAdapter();
            $token   = $storage->retrieveAccessToken('Withings');

            $this->getUser()->setWithingsToken( $token->getRequestToken() ) ; // Your user entity must have a WithingsToken column
            $this->getUser()->setWithingsTokenSecret( $token->getRequestTokenSecret() ); // Your user entity must have a WithingsTokenSecret column
            $this->getUser()->setWithingsId( $_GET['user_id'] ); // Your user entity must have a WithingsUserId column

            $em->persist( $this->getUser() );

            $em->flush();

        }else
        {
            $auth_gateway->initiateLogin();
        }
```

- Retrieving user profile informations

```
    public function withingsGetProfile()
    {
        $factory = new \Withings\ApiGatewayFactory;
        $factory->setCallbackURL( $withings_callback_url );
        $factory->setCredentials( $withings_consumer_key , $withings_consumer_secret ); // these variables come from database

        $token  = new \OAuth\OAuth1\Token\StdOAuth1Token();
        $token->setRequestToken( $user->getWithingsToken() ); // user credentials
        $token->setRequestTokenSecret( $user->getWithingsTokenSecret() ); // user credentials
        $token->setAccessToken( $user->getWithingsToken() ) // user credentials;
        $token->setAccessTokenSecret( $user->getWithingsTokenSecret() ); // user credentials

        $adapter = new \OAuth\Common\Storage\Memory();
        $adapter->storeAccessToken('Withings', $token);

        $factory->setStorageAdapter($adapter);

        $UserGateway        =   $factory->getUserGateway();
        $profile            =   $UserGateway->getProfile( $user->getWithingId() ); // user withings id

        print_r ( $profile ) ;
    }
```

Thanks to popthestack/fitbitphp for the code structure.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/eba6ae6fa4e203e423b4e4161ede7075ab3c2c5b431c547888f0205fee820bf1?d=identicon)[huitiemesens](/maintainers/huitiemesens)

---

Top Contributors

[![nassuf](https://avatars.githubusercontent.com/u/7489336?v=4)](https://github.com/nassuf "nassuf (1 commits)")

### Embed Badge

![Health badge](/badges/huitiemesens-withings/health.svg)

```
[![Health](https://phpackages.com/badges/huitiemesens-withings/health.svg)](https://phpackages.com/packages/huitiemesens-withings)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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