A PHP
client library for interacting with the Foursquare
userless venue API.
HTTPlug is used to support multiple HTTP
clients including Guzzle
, Buzz
, and Curl
.
Use composer to install this library and your preferred HTTP
client.
$ composer require php-http/guzzle6-adapter
$ composer require ben-gibson/foursquare-venue-client
<?php
require_once __DIR__.'/../vendor/autoload.php';
use Gibbo\Foursquare\Client\Client;
use Gibbo\Foursquare\Client\Configuration;
use Gibbo\Foursquare\Client\Entity\Coordinates;
use Gibbo\Foursquare\Client\Factory\Venue\VenueFactory;
use Gibbo\Foursquare\Client\Identifier;
use Gibbo\Foursquare\Client\Options\Search;
$client = Client::simple(new Configuration('client-id', 'client-secret'), VenueFactory::simple());
// Get by id
$venue = $client->getVenue(new Identifier('430d0a00f964a5203e271fe3'));
$venue->getName();
$venue->getDetails()->getRating();
// Search by coordinates
$options = Search::coordinates(new Coordinates(28.538336, -81.379234))
->limit(10)
->radius(500)
->query('Donuts');
$venues = $client->search($options);
// Search by place
$options = Search::place('Chicago, IL')
->limit(10)
->radius(500)
->query('Donuts');
$venues = $client->search($options);
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email ben.gibson.2011@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.