PHPackages                             jcroll/foursquare-api-bundle - 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. jcroll/foursquare-api-bundle

ActiveSymfony-bundle[API Development](/categories/api)

jcroll/foursquare-api-bundle
============================

Symfony bundle for the jcroll/foursquare-api-client

v1.1.4(9y ago)617.3k2MITPHP

Since Jul 19Pushed 9y ago2 watchersCompare

[ Source](https://github.com/jcroll/foursquare-api-bundle)[ Packagist](https://packagist.org/packages/jcroll/foursquare-api-bundle)[ Docs](https://github.com/jcroll/foursquare-api-bundle)[ RSS](/packages/jcroll-foursquare-api-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (8)Used By (0)

JcrollFoursquareApiBundle
=========================

[](#jcrollfoursquareapibundle)

[![Build Status](https://camo.githubusercontent.com/6a387799a04c4e8061be4eee7b89bd7e1ba9e32e129e62474dba1a62b3152840/68747470733a2f2f7472617669732d63692e6f72672f6a63726f6c6c2f666f75727371756172652d6170692d62756e646c652e706e67)](https://travis-ci.org/jcroll/foursquare-api-bundle)[![Total Downloads](https://camo.githubusercontent.com/6c9cafe46601cc292b5e725e18711489b3d7cf7b08d0200023c335132947fcdd/68747470733a2f2f706f7365722e707567782e6f72672f6a63726f6c6c2f666f75727371756172652d6170692d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/jcroll/foursquare-api-bundle)[![Monthly Downloads](https://camo.githubusercontent.com/43555855f3eff5b447c627c2b44c31897647e3183f6674fcc60700fbcc5f49dc/68747470733a2f2f706f7365722e707567782e6f72672f6a63726f6c6c2f666f75727371756172652d6170692d62756e646c652f642f6d6f6e74686c79)](https://packagist.org/packages/jcroll/foursquare-api-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/ff81438d156c3146032162e2f16676df6972532658991e6313acf0e1ee592636/68747470733a2f2f706f7365722e707567782e6f72672f6a63726f6c6c2f666f75727371756172652d6170692d62756e646c652f762f737461626c65)](https://packagist.org/packages/jcroll/foursquare-api-bundle)[![License](https://camo.githubusercontent.com/476e0b62d8490c65315ef21efe35a7b93a5e8ec48c63797b7d398918ecad9052/68747470733a2f2f706f7365722e707567782e6f72672f6a63726f6c6c2f666f75727371756172652d6170692d62756e646c652f6c6963656e7365)](https://packagist.org/packages/jcroll/foursquare-api-bundle)

This bundle integrates the [JcrollFoursquareApiClient](https://github.com/jcroll/foursquare-api-client) into the Symfony framework.

Why?
----

[](#why)

This bundle will allow you to easily configure the [JcrollFoursquareApiClient](https://github.com/jcroll/foursquare-api-client)and additionally easily allow you to integrate with the [HWIOAuthBundle](https://github.com/hwi/HWIOAuthBundle)(if you are using it) for signed requests to the foursquare api (see the [JcrollFoursquareApiBundleSandbox](https://github.com/jcroll/foursquare-api-bundle-sandbox) for examples).

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

[](#installation)

Add JcrollFoursquareApiBundle in your composer.json:

```
{
    "require": {
        "jcroll/foursquare-api-bundle": "~1"
    }
}
```

Download bundle:

```
$ php composer.phar update jcroll/foursquare-api-bundle
```

Add the JcrollFoursquareApiBundle to your AppKernel.php

```
// app/AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            ...
            new Jcroll\FoursquareApiBundle\JcrollFoursquareApiBundle(),
            ...
        );
        ...
    }
```

Basic configuration
-------------------

[](#basic-configuration)

1. If you're not using [HWIOAuthBundle](https://github.com/hwi/HWIOAuthBundle) add your application id and secret parameters (other parameters are optional):

    ```
    # app/config/config.yml

    jcroll_foursquare_api:
        client_id:
        client_secret:
        version:       20140806                        # optional
        mode:          foursquare                      # optional
    ```
2. If you are using [HWIOAuthBundle](https://github.com/hwi/HWIOAuthBundle) configure a `foursquare` resource owner and the client's credentials will automatically be configured (unless you wish to specify custom values for `version` or `mode`).

    ```
    # app/config/config.yml

    hwi_oauth:
        resource_owners:
            any_name:
                type:          foursquare
                client_id:          # will automatically inject in the client
                client_secret:  # will automatically inject in the client
    ```

Usage
-----

[](#usage)

```
$client = $this->container->get('jcroll_foursquare_client');

$client->setToken($oauthToken); // optional for user specific requests

$client->setMode('swarm');      // switch from mode 'foursquare' to 'swarm'

$command = $client->getCommand('venues/search', [
    'near'  => 'Chicago, IL',
    'query' => 'sushi'
]);

$results = (array) $client->execute($command); // returns an array of results
```

You can find a list of the client's available commands in the bundle's [client.json](https://github.com/jcroll/foursquare-api-client/blob/master/src/Resources/config/client.json)but basically they should be the same as the [api endpoints listed in the docs](https://developer.foursquare.com/docs/).

HWIOAuthBundle Integration
--------------------------

[](#hwioauthbundle-integration)

If you are using [HWIOAuthBundle](https://github.com/hwi/HWIOAuthBundle) this bundle will automatically look for a `resource_owner` of type `foursquare` in that bundle's configuration and inject the `client_id` and `client_secret`into the `jcroll_foursquare_client` service (no need to configure this bundle unless you want to define custom values for `version` or `mode`).

Additionally a listener will be configured and if the authenticated user possesses an oauth token belonging to foursquare the token will be automatically injected into the `jcroll_foursquare_client` service for signed requests (no need to call `setToken`).

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 99.1% 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 ~191 days

Recently: every ~14 days

Total

7

Last Release

3531d ago

### Community

Maintainers

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

---

Top Contributors

[![jcroll](https://avatars.githubusercontent.com/u/1441013?v=4)](https://github.com/jcroll "jcroll (116 commits)")[![trq](https://avatars.githubusercontent.com/u/32683?v=4)](https://github.com/trq "trq (1 commits)")

---

Tags

apiclientfoursquare

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jcroll-foursquare-api-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/jcroll-foursquare-api-bundle/health.svg)](https://phpackages.com/packages/jcroll-foursquare-api-bundle)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1243.1k1](/packages/skeeks-yii2-google-api)

PHPackages © 2026

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