Manage API Keys

When you first create a project, you will need to generate an API key if you are using the Places API. Should you need additional API keys, and/or revoke an API key, you can do so from the Project Settings page.

Generate a new API Key

To generate a new API key:

  1. From within your project, on the Project Settings page, in the Places API Keys section, click Generate (Additional) API Key.
  2. In the Generate (Additional) API Key modal, give your new API key a nickname to help you identify it later.
  3. Click the Copy to Clipboard icon to save a copy of your key elsewhere .

  1. Click Dismiss once your access token has safely been copied.

❗️

DO NOT FORGET TO SAVE YOUR API KEY

Key generation will be the only time you can view your API Key. As you will need it for authenticating against Foursquare APIs, you must keep it saved somewhere else. If you lose your API Key, you can always revoke it's access and create a new one.

Using Your API Keys

Authenticating against the API is done by passing your API Key through an Authorization: header parameter.

View Examples

Revoke an API Key

To revoke a currently in-use API Key:

  1. From within your project, on the Project Settings page, in the Places API Keys section, click on Revoke Access next to the token you wish to remove.
  2. In the Revoke Access modal, select whether or not you'd like us to Automatically generate a new API Key when the current one is revoked.
  3. Click Revoke API Key.

Implement API Key Restrictions

By adding URL restrictions to an API key, only requests originating from the specified list of URLs/domains will be authorized. By default, created keys are unrestricted and will work for requests from any URL.

When adding URL restrictions, please ensure the following:

  • The URL entered must include the protocol (either http:// or https://). NOTE: http://example.com does not authorize https://example.com
  • The URL must be an exact match; e.g. http://example.com is different from http://example.com/ and http://example.com/page

To implement domain restrictions for an API key:

  1. From within your project, on the Project Settings page, in the Places API Keys section, click Modify for the API key you wish to restrict.
  2. In the Modify Restrictions modal, add the URL to restrict the API key to and click Add.
  3. Once added, you can view and/or delete existing restrictions within the Modify Restrictions modal.

Sign In