Self-hosted SERP API for AI, SEO & automation. Browser-rendered Google, Bing, Yandex, Baidu, DuckDuckGo and Ecosia search with page extraction
Self-hosted SERP API for AI, SEO & automation. Browser-rendered Google, Bing, Yandex, Baidu, DuckDuckGo and Ecosia search with page extraction
OpenSERP is a free, open-source SERP API and CLI for Google, Yandex, Baidu, Bing, DuckDuckGo, and Ecosia.
No API keys, no per-search billing: one command gives you live, structured search results on localhost - including engines the paid APIs don't cover. Use it as a search tool for LLMs and agents, or as a backend for SEO rank tracking. If you'd rather not run infrastructure, there is a hosted version with the same API.
Prebuilt images are published to docker hub: karust/openserp.
# Run the API server via prebuilt image
docker run --rm -p 127.0.0.1:7000:7000 karust/openserp:latest serve -a 0.0.0.0 -p 7000
# Or
docker compose upgo install github.com/karust/openserp@latest
openserp search duckduckgo "open source serp api" --format markdowngit clone https://github.com/karust/openserp.git
cd openserp
go build -o openserp .
./openserp serve# mode=any returns the first engine that responds
curl "http://127.0.0.1:7000/mega/search?engines=bing,google&text=golang+vs+rust&extract=1&mode=any"Example JSON response
…Official client packages. Each works against your self-hosted server (set baseUrl) or the hosted API (set apiKey):
| Type | Package | Source | Install |
|---|---|---|---|
| JavaScript / TypeScript SDK | @openserp/sdk |
openserpapi/sdk-js | npm install @openserp/sdk |
| Python SDK | openserp |
openserpapi/sdk-python | pip install openserp |
| MCP server (AI agents) | @openserp/mcp |
openserpapi/mcp | npx @openserp/mcp |
| n8n community node | @openserp/n8n-nodes-openserp |
openserpapi/n8n | Install via n8n community nodes |
See examples for small JavaScript and Python use cases covering search, AI grounding, SEO, content extraction, and image search.
import { OpenSERP } from "@openserp/sdk";
// Use your self-hosted server
const client = new OpenSERP({ baseUrl: "http://localhost:7000" });
const { results } = await client.search({ engine: "google", text: "openserp", limit: 5 });Available engine names: google, yandex, baidu, bing, duckduckgo, ecosia.
Dedicated engine endpoints:
curl "http://127.0.0.1:7000/google/search?text=golang&limit=10"Image search:
curl "http://127.0.0.1:7000/bing/image?text=golang+logo&limit=10"Megasearch:
curl "http://127.0.0.1:7000/mega/search?text=golang&limit=10"/mega/search returns the same envelope as engine endpoints plus clusters: results are deduplicated by normalized URL, and clusters keep the per-engine occurrences and ranks.
| Mode | Best for | Behavior |
|---|---|---|
balanced |
Most multi-engine SERP workflows | Queries engines in parallel and merges results |
fast |
Lowest latency | Uses the fastest available engine |
any |
Fallback-style availability checking | Tries engines sequentially until one responds |
More megasearch examples
# Fast mode
curl "http://127.0.0.1:7000/mega/search?text=golang&mode=fast&engines=google,bing,yandex"
# Any mode
curl "http://127.0.0.1:7000/mega/search?text=golang&mode=any&engines=google,yandex,bing"
# Balanced mode with aggregation controls
curl "http://127.0.0.1:7000/mega/search?text=golang&mode=balanced&dedupe=true&merge=true"
# Advanced filtering
curl "http://127.0.0.1:7000/mega/search?text=golang&engines=google,bing&limit=20&date=20250101..20251231&lang=EN®ion=US"
# Image megasearch
curl "http://127.0.0.1:7000/mega/image?text=golang+logo&limit=20"List engines:
curl "http://127.0.0.1:7000/mega/engines"URL extraction:
…No server required - query an engine straight from the terminal. The CLI shares the same engines, formats, and filters as the API.
openserp search ecosia "weather in london" --format markdownCLI output and more examples
…More CLI examples:
…Run openserp search --help for the full flag list. Engine names: google, yandex, baidu, bing, duckduckgo, ecosia.
Common parameters:
| Parameter | Description | Example |
|---|---|---|
text |
Search query | golang programming |
lang |
Language code | EN, DE, RU, ES |
region |
Market/location hint. Countries/locales work across engines; Google also accepts city names via uule; Yandex accepts numeric lr. |
DE, en-GB, Berlin, 213 |
date |
Date range | 20250101..20251231 |
file |
File extension | pdf, doc, xls |
site |
Site-specific search | github.com |
limit |
Number of organic results, max 100. When omitted or `` or X-Use-Proxy: direct. |
Once the server is running, the interactive docs are available locally:
http://127.0.0.1:7000/docs - full schemas, error shapes, and the /health, /ready, /stats/* endpointshttp://127.0.0.1:7000/openapi.yamlTo browse the spec without running the server, see docs/openapi.yaml. For a higher-level overview of how OpenSERP works internally, see the architecture docs.
Client code migrates in either direction, so you are never locked in.
This project is licensed under the MIT License. See LICENSE.
Contributions are welcome. See docs/CONTRIBUTING.md.
OpenSERP is free and open-source. Only links listed in this repository and on openserp.org are associated with the project.
No open issues yet, or sync has not completed.