Overview
Use the REST API to connect the heypster GIF catalog to your app or custom picker. The GIPHY-compatible API is available at https://heypster-gif.com/giphy. The paths below are relative to that address.
Getting started
GIPHY-compatible routes use the base URL https://heypster-gif.com/giphy. Append a path such as /v1/gifs/search. For GIPHY-compatible requests, send your key in api_key. Native heypster clients can also use the HEYPSTER-API-KEY header.
curl --get 'https://heypster-gif.com/giphy/v1/gifs/search' \
--data-urlencode "api_key=$HEYPSTER_API_KEY" \
--data-urlencode 'q=celebration' \
--data-urlencode 'limit=12' \
--data-urlencode 'lang=fr'
async function searchGifs(query, apiKey) {
const request = new URL(
'https://heypster-gif.com/giphy/v1/gifs/search'
);
request.search = new URLSearchParams({
api_key: apiKey, q: query, limit: '12', lang: 'fr',
});
const response = await fetch(request);
if (!response.ok) throw new Error('HTTP ' + response.status);
const { data } = await response.json();
return data;
}
API routes
All routes in this reference use GET. Select a route to see its parameters and copy an example.
| Function | Path |
|---|---|
| Search | /v1/gifs/search |
| Trending | /v1/gifs/trending |
| GIF by intent | /v1/gifs/translate |
| Random GIF | /v1/gifs/random |
| GIF by ID | /v1/gifs/{id} |
| List GIFs by ID | /v1/gifs ?ids=… |
| Autocomplete | /v1/gifs/search/tags |
| Categories | /v1/gifs/categories |
| Related tags | /v1/tags/related/{term} |
| Trending searches | /v1/trending/searches |
| Random ID | /v1/randomid |
| Emoji collection v1 | /v1/emoji |
| Emoji collection v2 | /v2/emoji |
| Emoji variations | /v2/emoji/{emoji_id}/variations |
Search and GIFs
Search
/v1/gifs/searchFind GIFs by keyword or phrase.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
q | party | Keyword or phrase. |
limit | 25 | Maximum number of results. |
offset | 0 | Number of results to skip. |
lang | fr | Optional language code for the search. |
curl 'https://heypster-gif.com/giphy/v1/gifs/search?api_key=YOUR_HEYPSTER_API_KEY&q=bon+anniversaire&lang=fr&limit=12'
Trending
/v1/gifs/trendingRetrieve trending GIFs for a picker or discovery page.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
limit | 25 | Maximum number of results. |
offset | 0 | Number of results to skip. |
curl 'https://heypster-gif.com/giphy/v1/gifs/trending?api_key=YOUR_HEYPSTER_API_KEY&limit=20&offset=0'
GIF by intent
/v1/gifs/translateGet a single GIF for a short phrase. The q parameter is the fallback when s is absent.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
s | thumbs up | Phrase to translate into a GIF. |
q | thumbs up | Fallback parameter. |
curl 'https://heypster-gif.com/giphy/v1/gifs/translate?api_key=YOUR_HEYPSTER_API_KEY&s=thumbs+up'
Random GIF
/v1/gifs/randomRetrieve a random GIF, optionally filtered by tag.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
tag | celebration | Optional tag. |
curl 'https://heypster-gif.com/giphy/v1/gifs/random?api_key=YOUR_HEYPSTER_API_KEY&tag=celebration'
GIF by ID
/v1/gifs/{id}Retrieve a GIF by its heypster ID.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
id | abc123 | ID in the path. |
curl 'https://heypster-gif.com/giphy/v1/gifs/abc123?api_key=YOUR_HEYPSTER_API_KEY'
List GIFs by ID
/v1/gifsRetrieve several GIFs in one request using ids.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
ids | abc123,def456 | Comma-separated IDs. |
curl 'https://heypster-gif.com/giphy/v1/gifs?api_key=YOUR_HEYPSTER_API_KEY&ids=abc123%2Cdef456'
Discovery
Autocomplete
/v1/gifs/search/tagsSuggest terms as the user types a search.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
q | par | Search prefix. |
limit | 25 | Maximum number of results. |
offset | 0 | Number of results to skip. |
curl 'https://heypster-gif.com/giphy/v1/gifs/search/tags?api_key=YOUR_HEYPSTER_API_KEY&q=par&limit=5'
Categories
/v1/gifs/categoriesRetrieve categories for browsing the GIF catalog.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
curl 'https://heypster-gif.com/giphy/v1/gifs/categories?api_key=YOUR_HEYPSTER_API_KEY'
Trending searches
/v1/trending/searchesRetrieve trending search terms.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
limit | 25 | Maximum number of results. |
offset | 0 | Number of results to skip. |
curl 'https://heypster-gif.com/giphy/v1/trending/searches?api_key=YOUR_HEYPSTER_API_KEY&limit=10'
Random ID
/v1/randomidGet a random ID for integrations that use this route.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
curl 'https://heypster-gif.com/giphy/v1/randomid?api_key=YOUR_HEYPSTER_API_KEY'
Emoji
Emoji collection v1
/v1/emojiRetrieve the emoji collection in the compatible format. The object’s url field points to the image.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
q | smile | Search filter. |
limit | 25 | Maximum number of results. |
offset | 0 | Number of results to skip. |
curl 'https://heypster-gif.com/giphy/v1/emoji?api_key=YOUR_HEYPSTER_API_KEY&q=smile&limit=10'
Emoji collection v2
/v2/emojiRetrieve the emoji collection through the v2 route.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
q | smile | Search filter. |
limit | 25 | Maximum number of results. |
offset | 0 | Number of results to skip. |
curl 'https://heypster-gif.com/giphy/v2/emoji?api_key=YOUR_HEYPSTER_API_KEY&q=smile&limit=10'
Emoji variations
/v2/emoji/{emoji_id}/variationsRetrieve variations of an emoji. The response contains data: [] when none are available.
| Parameter | Example | Use |
|---|---|---|
api_key | YOUR_HEYPSTER_API_KEY | heypster API key. |
emoji_id | 1 | Emoji ID in the path. |
curl 'https://heypster-gif.com/giphy/v2/emoji/1/variations?api_key=YOUR_HEYPSTER_API_KEY'
Response schema
| Field | Contents |
|---|---|
data | An object or an array, depending on the route. A collection with no results returns an empty array. |
pagination | Present in paginated collections. Includes total_count, count, and offset. |
meta | Response information, including status, msg, and response_id. |
data[].images | Renditions of each GIF. In a single-item response, read data.images. |
{
"data": [
{
"id": "abc123",
"title": "Celebration",
"url": "https://example.com/gifs/abc123",
"slug": "celebration-abc123",
"rating": "g",
"images": {
"original": {
"url": "https://cdn.heypster.example/celebration-mini.gif",
"width": "",
"height": "",
"mp4": "https://cdn.heypster.example/celebration.mp4",
"webp": "https://cdn.heypster.example/celebration-mini.gif"
},
"fixed_width": {
"url": "https://cdn.heypster.example/celebration-fixed-width.gif",
"width": "",
"height": "",
"mp4": "https://cdn.heypster.example/celebration-fixed-width.mp4",
"webp": "https://cdn.heypster.example/celebration-fixed-width.gif"
},
"preview_gif": {
"url": "https://cdn.heypster.example/celebration-preview.gif"
},
"preview": {
"mp4": "https://cdn.heypster.example/celebration-preview.mp4"
}
}
}
],
"pagination": {
"total_count": 48,
"count": 1,
"offset": 0
},
"meta": {
"status": 200,
"msg": "OK",
"response_id": "example-response"
}
}
The URLs in this JSON illustrate the response structure. In an integration, use the URLs returned in images. The webp field can point to the same GIF file as url, as shown here.
Formats and renditions
The catalog offers GIF, GIF Mini, MP4 H.265, and MP4 H.264. The GIPHY-compatible API uses gif_mini for image renditions and H.264 for video renditions. Depending on the rendition, it exposes url, webp, and mp4. WebM is outside this API contract.
| Use | Field to read |
|---|---|
| Main GIF | images.original.url |
| Grid or picker | images.fixed_width.url or images.fixed_height.url |
| Optimized GIF | images.downsized.url |
| GIF preview | images.preview_gif.url |
| MP4 preview | images.preview.mp4 |
| MP4 video (H.264) | images.original.mp4 |
Pagination and errors
Start at offset=0 and set limit to the number of results you want. For the next page, use the number of items actually returned. Single-item responses and some utility responses contain only data and meta.
function getNextOffset(pagination) {
if (!pagination || pagination.count === 0) return null;
const next = pagination.offset + pagination.count;
return next < pagination.total_count ? next : null;
}
Check the HTTP status before reading data. Handle request errors, single results, and empty collections separately.
Supported languages.
The official Flutter SDK repository lists 42 languages supported for search. The codes below are published in the Web SDK documentation, where language selects a secondary picker language. Keyword and tag searches in the Web SDK run in English. The REST route /v1/gifs/search documents its own lang parameter, for example fr.
- German
de - English
en - Arabic
ar - Breton
br - Bulgarian
bg - Catalan
ca - Simplified Chinese
zh - Traditional Chinese
zh-TW - Korean
ko - Croatian
hr - Danish
da - Spanish
es - Estonian
et - Finnish
fi - Français
fr - Greek
el - Hebrew
he - Hindi
hi - Hungarian
hu - Indonesian
id - Irish
ga - Italian
it - Japanese
ja - Latvian
lv - Lithuanian
lt - Malay
ms - Maltese
mt - Dutch
nl - Norwegian
no - Polish
pl - Portuguese
pt - Romanian
ro - Russian
ru - Serbian
sr - Slovak
sk - Slovenian
sl - Swedish
sv - Czech
cs - Thai
th - Turkish
tr - Ukrainian
uk - Vietnamese
vi
SDKs and integration.
| Platform | Installation | Reference |
|---|---|---|
| Apple | Swift Package Manager | Apple repository |
| Android | AAR module and Gradle | Android repository |
| Flutter | Git dependency | Flutter repository |
| Web | npm install heypster-gif | JavaScript SDK |
Explore code examples, read the SDK guides, or follow the quickstart.
Best practices.
- Choose the media rendition your interface needs to reduce bandwidth use.
- Handle single results separately from paginated collections.
- Keep numeric pagination with
limitandoffseton routes that support it. - Before going live, check the formats and parameters your client actually uses.