How to migrate from Tenor's V1 API

For existing integrations that use Tenor's V1 API, follow the steps on this page to migrate to V2.

Get a V2 API key

Follow the instructions in the setup step of the quickstart guide to get a V2 API key to replace your V1 version.

Update to V2 domains

Update your API domain to https://tenor.googleapis.com/v2/. Tenor's V2 API only supports HTTPS connections. For content, be sure your application supports content downloads from https://media.tenor.com and https://c.tenor.com.

For example, suppose you made an API call to one of the following V1 domains:

  • https://api.tenor.com/v1/search?<parameters>
  • https://g.tenor.com/v1/search?<parameters>

To update the calls to V2, change them to https://tenor.googleapis.com/v2/search?<parameters>.

Endpoint changes

The majority of API endpoint parameters are unchanged from what's documented in V1. There are a few notable exceptions:

  1. Tenor's Search endpoint now supports sticker search through the searchfilter parameter.
  2. Include the client_key and country parameters on API calls.
  3. The media_filter parameter now takes a comma-separated list of the desired formats rather than preset enums.
  4. The Categories endpoint now supports featured and trending for the type parameter.
  5. The API no longer supports the anon_id parameter.
  6. When there are no more pages of results to request, the next field of API responses is now a blank string rather than "0".

The following changes have been made to the endpoints available:

  1. The Trending endpoint is no longer supported. Instead, we recommend you use the Featured endpoint.
  2. The GIF endpoint has been rebranded as the Posts endpoint.
  3. The Random GIF endpoint has been incorporated into the Search endpoint through the random parameter.

Response object and error changes

  • The GIF Object has been rebranded to the Response Object.
  • In the Response Object, the media field has been rebranded as media_formats. The value for media_formats is now a map { CONTENT_FORMAT : MEDIA_OBJECT } rather than an array of maps.
  • The content thumbnail previews have been moved from the Media Object for each content format to its own format. They're offered under the media_formats field in the Response Object.
  • When there are no more results in a response object, the next field is an empty string, "", rather than "0".
  • Tenor API error codes have been migrated to Google's standard API error codes.