Host and API key
Replace https://api.giphy.com with https://heypster-gif.com/giphy, then use your heypster key in api_key. Keep the paths listed in the following table.
# GIPHY
curl 'https://api.giphy.com/v1/gifs/search?api_key=YOUR_GIPHY_API_KEY&q=party'
# heypster
curl 'https://heypster-gif.com/giphy/v1/gifs/search?api_key=YOUR_HEYPSTER_API_KEY&q=party'
Route mapping
| GIPHY path | heypster path | Reference |
|---|---|---|
/v1/gifs/search | /giphy/v1/gifs/search | Search |
/v1/gifs/trending | /giphy/v1/gifs/trending | Trending |
/v1/gifs/translate | /giphy/v1/gifs/translate | GIF by intent |
/v1/gifs/random | /giphy/v1/gifs/random | Random GIF |
/v1/gifs/{id} | /giphy/v1/gifs/{id} | GIF by ID |
/v1/gifs?ids=… | /giphy/v1/gifs?ids=… | List GIFs by ID |
/v1/gifs/search/tags | /giphy/v1/gifs/search/tags | Autocomplete |
/v1/gifs/categories | /giphy/v1/gifs/categories | Categories |
/v1/tags/related/{term} | /giphy/v1/tags/related/{term} | Related tags |
/v1/trending/searches | /giphy/v1/trending/searches | Trending searches |
/v1/randomid | /giphy/v1/randomid | Random ID |
/v1/emoji | /giphy/v1/emoji | Emoji collection v1 |
/v2/emoji | /giphy/v2/emoji | Emoji collection v2 |
/v2/emoji/{emoji_id}/variations | /giphy/v2/emoji/{emoji_id}/variations | Emoji variations |
Parameters to check
| Parameter | Migration |
|---|---|
api_key | Use your heypster key. |
q, limit, offset, lang | Keep the parameters supported by the route you use. |
ids | Keep the comma-separated list for batch lookup. |
term, emoji_id | Substitute your values for the path parameters. |
rating, weirdness, bundle, fields | Check these options before carrying them over. They fall outside the documented compatibility contract. |
Read responses
Keep reading data, meta, and images. Check that pagination is present before calculating the next page. Emoji collections can be empty. On an emoji object, url points to its image.
const { data, pagination, meta } = await response.json();
const items = Array.isArray(data) ? data : [data].filter(Boolean);
const currentOffset = pagination?.offset ?? null;
const status = meta?.status;
Check original, fixed_width, fixed_height, downsized, and preview_gif, depending on your use case. Review any secondary fields your code reads, such as analytics, user, source_tld, and alt_text.
JavaScript example
export async function searchGifs(query, apiKey, offset = 0) {
const url = new URL('https://heypster-gif.com/giphy/v1/gifs/search');
url.search = new URLSearchParams({
api_key: apiKey,
q: query,
limit: '24',
offset: String(offset),
lang: 'fr',
});
const response = await fetch(url);
if (!response.ok) throw new Error('HTTP ' + response.status);
const { data, pagination, meta } = await response.json();
return { items: data, pagination, meta };
}
curl 'https://heypster-gif.com/giphy/v1/gifs/categories?api_key=YOUR_HEYPSTER_API_KEY'
curl 'https://heypster-gif.com/giphy/v1/tags/related/party?api_key=YOUR_HEYPSTER_API_KEY'
curl 'https://heypster-gif.com/giphy/v1/randomid?api_key=YOUR_HEYPSTER_API_KEY'
curl 'https://heypster-gif.com/giphy/v2/emoji/1/variations?api_key=YOUR_HEYPSTER_API_KEY'
Verify the migration
- Confirm the host and key used by your test app.
- Test search, trending, random results, and lookup by ID.
- Check any additional routes you use, such as categories, related tags, and emoji.
- Compare consecutive pages and the handling of empty results.
- Test GIF, WebP, and MP4 rendering in your client. Remove dependencies on WebM.
- Check the optional parameters and secondary fields your interface relies on.