Providers

Providers

Providers

gifgrep talks to multiple GIF providers. Pick one explicitly with --source, or let it auto-resolve.

SourceBackendAPI key required
autoFirst availableAt least one of the below
giphyGIPHY v1 searchGIPHY_API_KEY
klipyKLIPY v2 searchKLIPY_API_KEY
tenorAlias for klipyKLIPY_API_KEY
gifgrep --source auto cats         # default
gifgrep --source giphy cats
gifgrep --source klipy cats
gifgrep --source tenor cats        # legacy alias for KLIPY

tenor is kept as an alias because Tenor used to be a first-class backend; it now resolves to KLIPY and uses KLIPY_API_KEY.

#How auto decides

  1. If GIPHY_API_KEY is set → try GIPHY first.
  2. If GIPHY fails and KLIPY_API_KEY is set → fall back to KLIPY.
  3. If GIPHY_API_KEY is not set → KLIPY.
  4. If neither is set → error on stderr, non-zero exit.

Full details: auto.

#Output is identical

All providers normalise into the same Result shape — same fields, same envelope. You can swap providers in a script without changing downstream parsing.

#Why two providers?

  • GIPHY has the deepest catalogue and best coverage of meme culture. Recommended when you can get a key.
  • KLIPY is friendlier for free-tier prototyping and works without sign-up gymnastics in some regions.

If you don't care: leave it on auto and set whichever key you already have.

#Future providers?

The provider interface is small (Search(query, opts) → []Result). PRs welcome — see internal/search/ in the repo.