foursquare-logo

In this post we will learn how to integrate Foursquare API with php website.

Firstly we will create API key and secret for our App, for that we will go here: Foursquare Developer
You will have to login with your details. Then goto “My Apps” on menu bar. Click “CREATE A NEW APP” button. Fill up the details with app name, url and redirect url as
shown in screenshot.

app_creation

Save settings using “Save Changes” button.

You will see the Client Id and Client Secret as shown in below screenshot:

app_key_SEC_FOURSQ

Now, we will use a PHP library which is readily available here: Foursquare Libraries
We will use the PHP one marked in red in below screenshot:

for_php_lib

Now download the zip file and extract it to localhost. Put your Client Id and Client Secret in the files where mentioned. And…

Thats it…

While making your app live you need to change the URL, Redirect URL and App visiblity to Public.

Live Demo:
Demo1
Demo2

Download Demo:

Download

For More you can refer https://developer.foursquare.com/docs/