---
title: "SerpBase"
description: "SerpBase's Google SERP endpoints, with a category that picks the web, images, news or videos endpoint."
canonical_url: "https://web.agntn.dev/providers/serpbase"
---
# SerpBase

> SerpBase's Google SERP endpoints, with a category that picks the web, images, news or videos endpoint.

<provider-facts provider="serpbase">



</provider-facts>

## Address it

```ts
import { create } from "@agntn/web";

const serpbase = await create("serpbase"); // SERPBASE_API_KEY
const results = await serpbase.search("query", { category: "news", maxResults: 10 });
```

The key goes in the `X-API-Key` header against `api.serpbase.dev`.

## What it reads

| Call | Endpoint |
| --- | --- |
| `search` | `POST` to the endpoint the category picks: web by default, `images`/`image`, `news`, `videos`/`video` |

## What comes back

`publishedDate`, `image`, `favicon` and `metadata.{position, rank, searchType, requestId, elapsedMs, creditsCharged}`. Only `category` is honoured. Paging works, but the next token stays `unknown` until a page comes back empty, SerpBase does not say when it is done.

## Gotchas

- `maxResults` is applied on our side to the returned page, the endpoint decides the page size.
- Credits are charged per request and reported in `metadata.creditsCharged`. An empty balance answers HTTP 200 with `status: 1020`. That is `PaymentError` here, so automatic search tries the next configured provider instead of stopping.

## Where it lives

`src/providers/serpbase.ts`.


## Sitemap

See the full [sitemap](https://web.agntn.dev/sitemap.md) for all pages.
