Drop-in migration

Reduce migration to a host and key change

If your product already uses the GIPHY REST API, Heypster is designed to preserve the same request mechanics: same `/v1` paths, same core parameters, and the same response shape. On `heypster-gif.com`, the compatible layer is prefixed with `/giphy`.

The right strategy is a two-step rollout: first swap the host and key, then validate secondary fields and the exact formats your interface consumes.

1

Host to replace

1

API key to replace

0

heavy rewrite

Before / after

// before
const API_HOST = 'https://api.giphy.com';
const API_KEY = 'YOUR_GIPHY_API_KEY';

// after
const API_HOST = 'https://heypster-gif.com/giphy';
const API_KEY = 'YOUR_HEYPSTER_API_KEY';

1. API host and authentication

First change to make: replace the GIPHY host with `https://heypster-gif.com/giphy`. Routes are protected by the `giphy.apikey` middleware; if your compatibility layer mirrors GIPHY, keep the `api_key` parameter.

If you already use native Heypster clients, the `HEYPSTER-API-KEY` header is still accepted. For a no-refactor GIPHY migration, keep `api_key`.

// GIPHY
fetch('https://api.giphy.com/v1/gifs/search?api_key=YOUR_GIPHY_API_KEY&q=clap');

// Heypster
fetch('https://heypster-gif.com/giphy/v1/gifs/search?api_key=YOUR_HEYPSTER_API_KEY&q=clap');

2. Endpoint mapping

GIPHY Heypster
https://api.giphy.com/v1/gifs/search https://heypster-gif.com/giphy/v1/gifs/search
https://api.giphy.com/v1/gifs/trending https://heypster-gif.com/giphy/v1/gifs/trending
https://api.giphy.com/v1/gifs/translate https://heypster-gif.com/giphy/v1/gifs/translate
https://api.giphy.com/v1/gifs/random https://heypster-gif.com/giphy/v1/gifs/random
https://api.giphy.com/v1/gifs/search/tags https://heypster-gif.com/giphy/v1/gifs/search/tags
https://api.giphy.com/v1/gifs/categories https://heypster-gif.com/giphy/v1/gifs/categories
https://api.giphy.com/v1/tags/related/{term} https://heypster-gif.com/giphy/v1/tags/related/{term}
https://api.giphy.com/v1/trending/searches https://heypster-gif.com/giphy/v1/trending/searches
https://api.giphy.com/v1/randomid https://heypster-gif.com/giphy/v1/randomid
https://api.giphy.com/v1/emoji https://heypster-gif.com/giphy/v1/emoji
https://api.giphy.com/v2/emoji https://heypster-gif.com/giphy/v2/emoji
https://api.giphy.com/v2/emoji/{emoji_id}/variations https://heypster-gif.com/giphy/v2/emoji/{emoji_id}/variations
https://api.giphy.com/v1/gifs/{id} https://heypster-gif.com/giphy/v1/gifs/{id}
https://api.giphy.com/v1/gifs?ids=... https://heypster-gif.com/giphy/v1/gifs?ids=...

3. Parameters to verify

api_key

Keep the same parameter name for a drop-in migration. Native Heypster clients may also use `HEYPSTER-API-KEY`.

q, limit, offset, lang

These are the main parameters currently supported on search and listing endpoints.

ids

Multi-ID resolution can stay identical if your code already uses a comma-separated list.

term

The `/giphy/v1/tags/related/{term}` endpoint adds an explicit path parameter for related tags.

emoji_id

Emoji variations are served through `/giphy/v2/emoji/{emoji_id}/variations`; emoji collections also accept `q`, `limit`, and `offset`.

rating / weirdness / bundle / fields

Audit these parameters if your client sends them: they are not part of the currently supported compatibility core.


4. Response parsing

  • Do not rewrite parsers unless necessary: first validate `data`, `pagination`, `meta`, and `images` on a staging environment.
  • Do not assume `pagination` is always present: some single-object and utility endpoints only return `data` and `meta`.
  • Image variants are rebuilt from `gif_mini`, and video variants from `h264`.
  • Verify your critical formats one by one: `original`, `fixed_width`, `fixed_height`, `downsized`, `preview_gif`, plus `mp4` and `webp` if your client consumes them.
  • Do not depend on `webm`: the current contract exposes `webp` and `mp4`.
  • For emoji payloads, objects use a GIPHY-like sticker shape; `url` points directly to the image asset and `/v2/emoji/{emoji_id}/variations` may return `data: []`.
  • If your app reads secondary fields such as `analytics`, `user`, `source_tld`, or `alt_text`, review them explicitly before production.
const payload = await response.json();

const items = Array.isArray(payload.data) ? payload.data : [payload.data].filter(Boolean);
const nextOffset = payload.pagination?.offset ?? null;
const requestStatus = payload.meta?.status;

5. Full JavaScript example

const API_HOST = 'https://heypster-gif.com/giphy';
const API_KEY = 'YOUR_HEYPSTER_API_KEY';

export async function searchReactionGifs(query, offset = 0) {
    const url = new URL(`${API_HOST}/v1/gifs/search`);
    url.searchParams.set('api_key', API_KEY);
    url.searchParams.set('q', query);
    url.searchParams.set('limit', '24');
    url.searchParams.set('offset', String(offset));
    url.searchParams.set('lang', 'en');

    const response = await fetch(url.toString());
    const payload = await response.json();

    return {
        items: payload.data,
        pagination: payload.pagination,
        meta: payload.meta,
    };
}
// Examples for other mapped endpoints
fetch(`${API_HOST}/v1/gifs/categories?api_key=${API_KEY}`);
fetch(`${API_HOST}/v1/tags/related/party?api_key=${API_KEY}`);
fetch(`${API_HOST}/v1/randomid?api_key=${API_KEY}`);
fetch(`${API_HOST}/v2/emoji/1/variations?api_key=${API_KEY}`);

6. Migration checklist

  • Replace `https://api.giphy.com` with `https://heypster-gif.com/giphy`.
  • Replace the GIPHY key with the Heypster key.
  • Test at least `search`, `trending`, `random`, and `get by id`.
  • Verify any additional endpoints you use: `categories`, `related tags`, `randomid`, and `emoji`.
  • Compare `offset` pagination between GIPHY and Heypster on your real use cases.
  • Verify the exact formats your application consumes, especially `mp4` and `webp`.
  • Confirm that your clients do not depend on `webm`.
  • Audit any optional parameters your client sends, especially `rating`, `weirdness`, `bundle`, and `fields`.
  • Confirm optional field behavior before production rollout.