01
Sep

Foursquare API integration in CakePHP 3

Foursquare API integration in CakePHP 3

Foursquare offers to fetch venue details by several keywords in many categories like Restaurants, Bars, Pubs, Museums, Movie Theaters, Clubs, Schools, Stadiums, Colleges & Universities and a lot more.

STEP BY STEP GUIDE OF INTEGRATION

1) Get List by LATITUDE LONGITUDE : First of all we need to fetch all placeids :

$obj = new Client();

$param = array(‘ll’=> “{$value->latitude},{$value->longitude}”, ‘client_id’ => $client_id, ‘client_secret’ => $client_secret, ‘v’ => “{$v}”, “categoryId” => $categoryId, “limit”=>50, “radius”=>5000,”intent”=>”browse”); $restaurant_json = $obj->get( $url, $param );

In above example,
ll = Latitude, longitude
categoryId = You’ll this category-id from this category endpoint .
‘client_id‘ and ‘client_secret’ = You will get this after logging in foursquare website :

Foursquare-api

HotelsPro provides the API to integrate hotel searching and booking into your project. It is a JSON-based Application Programming Interface (API). It avail the facility to fetch up-to-date inventory of HotelsPro including hotels, properties, facilities, countries, destinations and regions etc, searching hotels, checking room availability, booking and cancellation etc.

These are some steps in hotelsPro API workflow:

2) VENUE (Bars) Details :

To get complete details of venue with 6 photos , location , opening hours , price , tips and many more , use this code :

Foursquare-api

Complete list of response endpoints are here :
https://developer.foursquare.com/docs/responses/venue

3) Saving Venue Images :

Saving venue images is a tricky task here , there are 3 keys for a path of single image, so get the complete image by this url :

Saving Venue Images

4) Get More Venue Photos :

To get more photos of a venue, simply use following endpoint :
Example :
https://api.foursquare.com/v2/venues/VENUE_ID/photos

This is the basic overview and workflow of FourSquare API , you can find complete documentation here : https://developer.foursquare.com/docs/ If you need any help in integration of any API , then feel free to contact us , our expert developers are always ready to help you in integration of any API or in custom web development .

share

Difference Between Cakephp 2 and Cakephp 3

Difference Between Cakephp 2 and Cakephp 3

previous-blog-arrowPrevious
Best Kotlin Programming Language for Android App Development

Best Kotlin Programming Language for Android App Development

next-blog-arrowNext