Skip to content

Implementaton of SerpBase provider#341

Open
Dietermartens wants to merge 4 commits into
towfiqi:mainfrom
Dietermartens:main
Open

Implementaton of SerpBase provider#341
Dietermartens wants to merge 4 commits into
towfiqi:mainfrom
Dietermartens:main

Conversation

@Dietermartens

Copy link
Copy Markdown

Summary

Adds SerpBase.dev as a selectable SERP scraper in Settings, and extends the scraper client so providers that use POST + JSON (not only GET)

Closes #338.

Changes

SerpBase provider

New scraper module: scrapers/services/serpbase.ts
Registered in scrapers/index.ts
Uses POST https://api.serpbase.dev/google/search with X-API-Key and a JSON body (q, hl, gl, page)
Maps organic results (url / link, rank / position) into SerpBear’s format
Documented in the README SERP services table

Scraper transport (reusable for future providers)

SerpBase requires POST; existing scrapers stay on GET. ScraperSettings and getScraperClient are extended with:

scrapeMethod?: 'GET' | 'POST' (default 'GET')
requestBody?(...) — JSON body for POST requests
API error handling is improved for SerpBase-style responses (status !== 0, error field) in scrapeSinglePage and scrapeKeywordFromGoogle.

Notes

SerpBase /google/search does not expose city or mobile device params in their docs; keywords with city/mobile still scrape, but without those targeting options.
SerpBase is not added to the parallel refresh list (same as Serper); refreshes run sequentially with scrape_delay.

Restore single quotes and spaces in types.d.ts, utils/scraper.ts, and
scrapers/index.ts; align serpbase.ts with existing scraper modules; keep
README table line within 80 characters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for additional low-cost SERP API provider (SerpBase)

1 participant