Framework for building Connected Apps
Switch branches/tags
Nothing to show
Pull request Compare This branch is even with foursquare:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Foursquare Apps Builder

A framework for building foursquare apps on AppEngine.

Registering with foursquare

Register your app at Your application web site is

And your callback url is

Once you've registered, you'll get a client_id. You'll want to edit your app's settings to set up your app for push notifications and as a connected app.

Your push url is

System Config

First update /app.yaml and / with the details for your appengine instance.

  • app.yaml: You should only need to update the application name

  • Read through the documentation and update fields as appropriate.

  • First, copy this file over to That filename has been .gitignore'd so that you don't accidentally leak your secrets! Then, fill out the template with your actual client and push secrets.

Implementing an app

Create a new folder for your app's files. You can check out /menulette as an example. Your main class should extend the AbstractApp class found in in There are 4 primary actions the app can support.

checkinTaskQueue(self, authenticated_client, checkin_json)

  • A user who has authorized your app has checked in. This runs inside AppEngine's task queue, and contains the check-in payload for you to process.

contentGet(self, client, content_info)

  • A user is requesting to view content generated by the app. The content info is passed along to the app so it can render the appropriate page. The default implementation returns a 400 to the user.

appPost(self, client)

  • This is for your app to handle any arbitrary POST request not already handled by the framework (i.e., all POSTs other than the ones from the foursquare Push API). The default implementation returns a 404.

appGet(self, client)

  • This is for your app to handle any arbitrary GET request not already handled by the framework (i.e., all GETs other than those handled by contentGet). The default implementation returns a 404.

The client object passed for these calls is a Foursquare object from Mike Lewis's library: For checkinTaskQueue, the client includes the user's access token. For all other calls you'll need to retrieve the access token you want to use via utils.fetchAccessToken(user_id) and set it via client.set_access_token(access_token).

There are a bunch of utility methods in both and which should make common actions much easier.

Once you've extended AbstractApp and filled out the configuration files, you're good to go. Deploy your instance, and you should be all set!

Local development

It's easy to develop your app locally. Go to and specify "local_dev": True and give the localhost url under 'local_server'. Then use the AppEngineLauncher to run your app locally and hit it with a fake check-in -- there's a sample payload in the testing directory. It's url-encoded, so you'll need to decode and re-encode to make edits. I use to do this.

You'll need to change the user ID field to your ID in order for the app to find your auth token in the datastore.

Once you've done that, you can push the data into your app via:

curl http://localhost:8090/checkin --data-urlencode checkin@test_checkin.txt

You probably don't want to make actual write requests from the app when in local dev mode -- makeContentInfo skips and logs for your convenience.