Host and API key
Replace https://tenor.googleapis.com with https://heypster-gif.com/giphy. Change the key parameter to api_key and use your heypster key.
# Tenor
curl 'https://tenor.googleapis.com/v2/search?key=YOUR_TENOR_API_KEY&q=cats'
# heypster
curl 'https://heypster-gif.com/giphy/v1/gifs/search?api_key=YOUR_HEYPSTER_API_KEY&q=cats&limit=25&offset=0'
Route mapping
| Tenor path | heypster path | Use |
|---|---|---|
/v2/search | /v1/gifs/search | Keyword search. |
/v2/featured | /v1/gifs/trending | Discovery feed. |
/v2/categories | /v1/gifs/categories | Categories. |
/v2/autocomplete | /v1/gifs/search/tags | Autocomplete. |
/v2/search_suggestions | /v1/tags/related/{term} | Suggestions related to a term. |
/v2/trending_terms | /v1/trending/searches | Trending terms. |
/v2/search?random=true | /v1/gifs/random | Single GIF. |
/v2/posts?ids=… | /v1/gifs?ids=… | Multiple GIFs by ID. |
/v2/anonid | /v1/randomid | Get a random ID. |
Parameter changes
| Tenor | heypster | Migration notes |
|---|---|---|
key | api_key | Replace the parameter name and key value. |
q | q | Keep the search term. |
pos | offset | Use a numeric offset. |
limit | limit | Set the desired page size. |
contentfilter | rating | The Tenor guide mentions this mapping. Check the behavior of the route you use before adopting this filter. |
anon_id / anonid | /v1/randomid | Check whether your integration still needs a random ID. |
media_formats | images | Choose from the renditions in the response. |
Pagination
Tenor sends the next cursor in pos on the next request. With heypster, start at offset=0, then add pagination.offset and pagination.count. Stop at the end of the collection or when a page has no results.
function getNextOffset(pagination) {
if (!pagination || pagination.count === 0) return null;
const next = pagination.offset + pagination.count;
return next < pagination.total_count ? next : null;
}
Read responses
| Tenor | heypster |
|---|---|
results[] | data[] |
next | pagination.offset + pagination.count |
results[].media_formats | data[].images |
results[].content_rating | data[].rating |
results[].title / content_description | data[].title |
{
"data": [],
"pagination": {
"total_count": 0,
"count": 0,
"offset": 0
},
"meta": {
"status": 200,
"msg": "OK",
"response_id": "example-response"
}
}
Formats and renditions
| Tenor rendition | heypster field | Use |
|---|---|---|
gif | images.original.url | Main GIF. |
tinygif | images.fixed_width.url or images.fixed_height.url | Grid or picker. |
mediumgif | images.downsized.url | Optimized GIF. |
preview | images.preview_gif.url | GIF preview. |
For H.264 video, read images.original.mp4 or images.preview.mp4, depending on your use case.
Sharing
The heypster reference documents no equivalent for /v2/registershare. Remove this request from the heypster adapter. If your app relies on it, handle sharing separately. /v1/randomid returns an ID and does not replace a share event.
JavaScript example
export async function searchGifs(query, apiKey, offset = 0, limit = 25) {
const url = new URL('https://heypster-gif.com/giphy/v1/gifs/search');
url.search = new URLSearchParams({
api_key: apiKey,
q: query,
limit: String(limit),
offset: String(offset),
});
const response = await fetch(url);
if (!response.ok) throw new Error('HTTP ' + response.status);
const { data, pagination, meta } = await response.json();
let nextOffset = null;
if (pagination && pagination.count > 0) {
const next = pagination.offset + pagination.count;
if (next < pagination.total_count) nextOffset = next;
}
return { items: data, nextOffset, meta };
}
Verify the migration
- Check the new host, the heypster key, and the routes your app calls.
- Browse multiple pages, including a short page and the end of the results.
- Update response handling and test every format your interface uses.
- Check content filtering and sharing separately if your code relies on them.