How to migrate from Tenor's V1 API
Stay organized with collections
Save and categorize content based on your preferences.
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:
- Tenor's Search endpoint
now supports sticker search through the
searchfilter
parameter.
- Include the
client_key
and country
parameters on API calls.
- The
media_filter
parameter now takes a comma-separated list of the desired
formats rather than preset enums.
- The Categories endpoint now
supports
featured
and trending
for the type
parameter.
- The API no longer supports the
anon_id
parameter.
- 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:
- The Trending endpoint is no longer supported. Instead, we recommend you use the
Featured endpoint.
- The GIF endpoint has been rebranded as the
Posts endpoint.
- 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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-12-05 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-12-05 UTC."],[[["\u003cp\u003eExisting Tenor integrations using the V1 API must migrate to V2 by updating API keys, domains, and endpoints.\u003c/p\u003e\n"],["\u003cp\u003eV2 introduces changes to endpoints, parameters, and response objects, including sticker search and rebranded elements.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should update their API calls to use \u003ccode\u003ehttps://tenor.googleapis.com/v2/\u003c/code\u003e and ensure HTTPS support for content downloads.\u003c/p\u003e\n"],["\u003cp\u003eNotable endpoint changes include the removal of the Trending endpoint, renaming of GIF to Posts, and incorporating Random GIF into Search.\u003c/p\u003e\n"],["\u003cp\u003eResponse objects and errors have been updated, including renaming the GIF Object to Response Object and modifying the \u003ccode\u003emedia\u003c/code\u003e field to \u003ccode\u003emedia_formats\u003c/code\u003e.\u003c/p\u003e\n"]]],["To migrate from Tenor's V1 to V2 API, obtain a new V2 API key and update API domains to `https://tenor.googleapis.com/v2/`, ensuring support for content downloads from `https://media.tenor.com` and `https://c.tenor.com`. Key endpoint updates include sticker search via `searchfilter`, `client_key` and `country` parameters, comma-separated `media_filter` formats, and changes to Categories. `Trending` is replaced by `Featured`, `GIF` becomes `Posts`, `Random GIF` is under `Search`. Response object changes involve `media` to `media_formats` and updated error codes.\n"],null,["# How to migrate from Tenor's V1 API\n\nFor existing integrations that use Tenor's V1 API, follow the steps on this page to\nmigrate to V2.\n\nGet a V2 API key\n----------------\n\nFollow the instructions in the [setup\nstep](/tenor/guides/quickstart#setup) of the quickstart guide to get a V2 API key to replace your V1 version.\n\nUpdate to V2 domains\n--------------------\n\nUpdate your API domain to `https://tenor.googleapis.com/v2/`. Tenor's V2 API only\nsupports HTTPS connections. For content, be sure your application supports content downloads from\n`https://media.tenor.com` and `https://c.tenor.com`.\n\nFor example, suppose you made an API call to one of the following V1 domains:\n\n- `https://api.tenor.com/v1/search?`\u003cvar translate=\"no\"\u003e<parameters>\u003c/var\u003e\n- `https://g.tenor.com/v1/search?`\u003cvar translate=\"no\"\u003e<parameters>\u003c/var\u003e\n\nTo update the calls to V2, change them to\n`https://tenor.googleapis.com/v2/search?`\u003cvar translate=\"no\"\u003e<parameters>\u003c/var\u003e.\n\nEndpoint changes\n----------------\n\nThe majority of API endpoint parameters are unchanged from what's documented in V1. There are a\nfew notable exceptions:\n\n1. Tenor's [Search endpoint](/tenor/guides/endpoints#search) now supports sticker search through the [`searchfilter`](/tenor/guides/endpoints#searchfilter-search) parameter.\n2. Include the `client_key` and `country` parameters on API calls.\n3. The `media_filter` parameter now takes a comma-separated list of the desired formats rather than preset enums.\n4. The [Categories endpoint](/tenor/guides/endpoints#categories) now supports `featured` and `trending` for the `type` parameter.\n5. The API no longer supports the `anon_id` parameter.\n6. When there are no more pages of results to request, the `next` field of API responses is now a blank string rather than `\"0\"`.\n\nThe following changes have been made to the endpoints available:\n\n1. The Trending endpoint is no longer supported. Instead, we recommend you use the [Featured endpoint](/tenor/guides/endpoints#featured).\n2. The GIF endpoint has been rebranded as the [Posts endpoint](/tenor/guides/endpoints#posts).\n3. The Random GIF endpoint has been incorporated into the [Search endpoint](/tenor/guides/endpoints#search) through the [`random`](/tenor/guides/endpoints#random-search) parameter.\n\nResponse object and error changes\n---------------------------------\n\n- The GIF Object has been rebranded to the [Response\n Object](/tenor/guides/response-objects-and-errors#response-object).\n- In the [Response\n Object](/tenor/guides/response-objects-and-errors#response-object), the `media` field has been rebranded as `media_formats`. The value for `media_formats` is now a map [`{ CONTENT_FORMAT : MEDIA_OBJECT }`](/tenor/guides/response-objects-and-errors#media-object) rather than an array of maps.\n- The content thumbnail previews have been moved from the [Media Object](/tenor/guides/response-objects-and-errors#media-object) for each [content\n format](/tenor/guides/response-objects-and-errors#content-formats) to its own format. They're offered under the `media_formats` field in the [Response\n Object](/tenor/guides/response-objects-and-errors#response-object).\n- When there are no more results in a response object, the `next` field is an empty string, `\"\"`, rather than `\"0\"`.\n- Tenor API error codes have been migrated to Google's standard API [error codes](https://cloud.google.com/apis/design/errors)."]]