PHPackages                             pecee/happn-php-sdk - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. pecee/happn-php-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

pecee/happn-php-sdk
===================

Easy to use PHP SDK for accessing Happn data.

1.3.0(8y ago)3832[1 issues](https://github.com/skipperbent/happn-php-sdk/issues)MITPHP

Since Nov 5Pushed 8y ago3 watchersCompare

[ Source](https://github.com/skipperbent/happn-php-sdk)[ Packagist](https://packagist.org/packages/pecee/happn-php-sdk)[ RSS](/packages/pecee-happn-php-sdk/feed)WikiDiscussions master Synced today

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

happn-php-sdk
=============

[](#happn-php-sdk)

Easy to use PHP SDK for accessing Happn data.

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

[](#installation)

Add the latest version of happn-php-sdk to your `composer.json`

```
{
    "require": {
        "pecee/happn-php-sdk": "1.*"
    },
    "require-dev": {
        "pecee/happn-php-sdk": "1.*"
    }
}
```

Like this?
----------

[](#like-this)

Like this SDK? Then you'll definetly love our "tinder-php-sdk", check it out here:

Examples
--------

[](#examples)

This section contains basic examples on how to use the SDK.

### Getting Facebook access token

[](#getting-facebook-access-token)

To use the SDK - the api requires you to get a valid Facebook access token. This can be accomplished by following [this link](https://www.facebook.com/dialog/oauth?client_id=247294518656661&redirect_uri=https://www.happn.fr&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token) and copying the `access_token` parameter provided by Facebook after a successful login.

### Authentication

[](#authentication)

Connect to the service, using your Facebook token.

```
$happn = new \Pecee\Http\Service\Happn($fbToken);
```

### Get user information

[](#get-user-information)

Fetches user information

Returns dictionary packed with: user id, facebook id, twitter id (not implemented), first name, last name, birth date, login (nulled), workplace, distance

```
$response = $happn->getUserInfo($userId);
```

### Get recommendations

[](#get-recommendations)

Get recommendations from Happn server to the user authenticated.

```
$response = $happn->getRecommendations($limit = 16, $offset = 0);
```

### Get distance

[](#get-distance)

Fetches the distance from another user

```
$response = $happn->getDistance($userId);
```

### Get Happn settings

[](#get-happn-settings)

**Note: Will be updated soon with correct parameters**

Set Happn settings.

```
$response = $happn->setSettings(array $userId);
```

### Set position

[](#set-position)

Set the position of the user using Happn's API

```
$response = $happn->setPosition($lat, $lon);
```

### Set position

[](#set-position-1)

Updates user activity

```
$response = $happn->updateActivity();
```

### Get user id

[](#get-user-id)

Returns user id of the currently authenticated user

```
$response = $happn->getUserId();
```

### Get Facebook access token

[](#get-facebook-access-token)

Returns Facebook access token of the currently authenticated user

```
$response = $happn->getFbToken();
```

### Custom query

[](#custom-query)

Make custom query upon Happn api.

```
$response = $happn->api($url, $method, array $data);
```

The MIT License (MIT)
---------------------

[](#the-mit-license-mit)

Copyright (c) 2015 Simon Sessingø / happn-php-sdk

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 86.4% 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 ~284 days

Total

4

Last Release

3039d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2dab716ac4ac16ea3e01400efe43853b43821b33b8c601c2c772689d58cebf3c?d=identicon)[sessingo](/maintainers/sessingo)

---

Top Contributors

[![skipperbent](https://avatars.githubusercontent.com/u/634762?v=4)](https://github.com/skipperbent "skipperbent (19 commits)")[![tolgatasci](https://avatars.githubusercontent.com/u/9893685?v=4)](https://github.com/tolgatasci "tolgatasci (2 commits)")[![mfld-fr](https://avatars.githubusercontent.com/u/11684481?v=4)](https://github.com/mfld-fr "mfld-fr (1 commits)")

---

Tags

httpapiwebsdkrestservicepeceehappn

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pecee-happn-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/pecee-happn-php-sdk/health.svg)](https://phpackages.com/packages/pecee-happn-php-sdk)
```

###  Alternatives

[nategood/httpful

A Readable, Chainable, REST friendly, PHP HTTP Client

1.8k17.7M275](/packages/nategood-httpful)[pecee/tinder-sdk

Easy to use PHP SDK for accessing Tinder data.

191.3k](/packages/pecee-tinder-sdk)[openapi/openapi-sdk

Minimal and agnostic PHP SDK for Openapi® (https://openapi.com)

171.4k1](/packages/openapi-openapi-sdk)

PHPackages © 2026

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