GIPHY search
GIPHY GIFs, stickers, clips or animated text for a search term (by default the first 25 results GIPHY shows): id, title, alt text, rating, tags, page, embed and short links, GIF, MP4 and WebP links with size and frames, every rendition (fixed height and width, downsized, stills, previews), source, flags, dates and the creator's channel (name, avatar, description, verified, social links). With limit, page/offset, rating, lang or sort (and always for clips and text) the response also has total_count, offset, limit, page and has_more for paging through up to 5,000 results.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
qrequired | string | Search term. Example: happy dance |
type | gifs | stickers | clips | text | gifs (default), stickers, clips (GIFs with sound) or text (animated text). Example: gifs |
limit | integer | Results per page, 1 to 50 (default 25). |
page | integer | Page number (1 = first), counted in pages of limit. Pass page + 1 while has_more is true. |
offset | integer | Start at this result (0-based) instead of page. |
rating | g | pg | pg-13 | r | Highest content rating to include: g, pg, pg-13 or r. |
lang | string | 2-letter language of the search term (e.g. en, es, pt, fr), for better matches in that language. |
sort | relevant | recent | relevant (default) or recent (newest first). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/giphy/v1/search?q=happy+dance" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/giphy/v1/search",
params={"q": "happy dance"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/giphy/v1/search");
url.searchParams.set("q", "happy dance");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).