Providers
SerpAPI
SerpAPI's Google endpoints for classic SERP results and Google Lens for reverse image search.
Provider
SerpAPI
- create("serpapi")
- SERPAPI_API_KEY
- Auth
- query parameter
- Results
- 10 · paged
- Free tier
- 250 searches a month
Capabilities
- Searchsearch()
- ImagesearchByImage()
- Readnot supported
Options
- Filters
startPublishedDate, endPublishedDate - Fields
publishedDate, image, favicon, metadata
Address it
import { create, searchByImage } from "@agntn/web";
const serpapi = await create("serpapi"); // SERPAPI_API_KEY
const results = await serpapi.search("query", { maxResults: 10 });
const in2021 = await serpapi.search("node.js release", {
startPublishedDate: "2021-01-01",
endPublishedDate: "2021-12-31",
});
const matches = await searchByImage("https://example.com/image.jpg", { provider: "serpapi" });
The key is a query parameter on serpapi.com.
What it reads
| Call | Endpoint |
|---|---|
search | GET /search?engine=google&q=…&num=…&start=…, plus tbs=cdr:1,cd_min:M/D/YYYY,cd_max:M/D/YYYY when a date bound is set |
searchByImage | GET /search?engine=google_lens&url=… |
What comes back
Search: publishedDate, image (thumbnail), favicon and metadata.{position, source, displayedLink}. startPublishedDate and endPublishedDate go out as Google's custom date range, the only filter here, and includeDomains and friends come back in ignoredFilters. Paging through start. Image matches carry pageUrl, imageUrl, dimensions, source, position and exactMatch.
Gotchas
- The date range takes whole days in US order, so each bound becomes its UTC day as
M/D/YYYY. A lone bound goes out alone, because Google takescd_minorcd_maxby itself and there is no reason to make up the other end.publishedDateis Google's own text,Oct 19, 2021or6 days ago, and plenty of results have none. - The only built-in reverse image provider. Everything under Reverse image search applies.
- 250 searches a month on the free plan as of September 2026. A burst answers 429 fast.
maxResultsis applied on our side to whatever Google or Lens returns. Google pays little attention tonum(amaxResults: 1call still brought back nine organic results) and hands a different page for astartoff the ten grid, so a smallmaxResultswalks each Google page in slices: the continuation fetches the same page again, which SerpAPI serves from its cache for an hour without charging, andstartmoves only once the page is used up.- No matches is an empty list, not an error. An image Lens cannot fetch looks the same, so
[]may also mean the provider never saw the picture.
Where it lives
src/providers/serpapi.ts.