gifs.so mascot, a lime animation frame winkinggifs.so
  • The GIF journal
  • Sponsor the stash
U
All guides
September 5, 2026·2 min read·By GIFs.so

GIF API pagination: offsets, changing queries, and the last page

Implement nextOffset correctly, prevent stale searches from mixing, and handle empty final pages without loops.

APIs

GIF search pagination belongs to a particular query and filter set. Reusing an offset after the user changes the query can skip relevant results or produce an empty page that looks like a search failure.

GIFs.so returns items, total, and nextOffset. The continuation is a numeric offset or null, not a provider-independent cursor you can reuse elsewhere.

Follow the returned continuation

Begin a new search with offset zero. Render the returned items, then use nextOffset for the next request while keeping query, category, and page size consistent. Stop when the continuation is null.

Do not use truthiness to detect completion in general pagination code: zero can be a valid offset. An explicit null check communicates the contract. Do not infer that more results exist solely because the current page is full.

GIFs.so accepts a limit from 1 to 100 and an offset up to 10,000. Those validation bounds are not a promise that the catalog contains that many matching items.

Reset state together

When the query or category changes, reset the offset, accumulated items, total, and pending load-more state as one operation. Cancel or ignore any older requests that are still in flight.

Assign every request the search identity that created it. Before appending a response, confirm that identity still matches the visible search. This prevents a late page of sad results from appearing below a new happy search.

Avoid accidental page loops

Disable load-more while a page request is pending. If a request fails, retain the previously loaded items and the failed page’s offset so the user can retry the same page.

Guard against receiving the same continuation repeatedly. Even a well-documented API can be wrapped incorrectly by a proxy. Logging an unexpected pagination state is more useful than fetching forever.

Keep sponsor placements separate from GIF pagination counts. GIFs.so’s sponsors array is not part of items, and sponsors should not change how you calculate the next offset.

Verify boundaries

Test a zero-result search, a result set smaller than one page, a set exactly one page long, and a final partial page. Also test a query change during load-more. The API guide provides the current schema, and the React picker article shows where pagination fits into the wider UI state model.

Find the right reaction.

A curated library, a free API, and an MCP server. Sign in with a verified account to get started.

Create an accountIntegration guide

Keep reading

APIsEngineering

Build a React GIF picker with predictable search state

Structure query state, pagination, cancellation, selection, and keyboard behavior before styling a GIF grid.

September 5, 2026·2 min read
APIsSearch

How to compare GIF API providers with a repeatable scorecard

Evaluate real query relevance, media support, limits, access terms, and operational behavior before committing to a provider.

September 5, 2026·2 min read
gifs.so mascot, a lime animation frame winkinggifs.so

5,537 reaction GIFs, sorted into 56 moods. For when you have nothing to say, and need to say it spectacularly.

The stash

  • Join the club
  • Sign in

Around here

  • The GIF journal
  • Sponsor the stash

Say hey

  • hello@gifs.so
© 2026 gifs.soMade for big feelings and very small attention spans.