Short, copy-pasteable examples for using OpenSERP from JavaScript and Python. Each one runs against a local server by default and works the same against the hosted API by swapping in an API key.
Most examples expect OpenSERP running on http://localhost:7000.
# Docker
docker run -p 127.0.0.1:7000:7000 -it karust/openserp serve -a 0.0.0.0 -p 7000
# Or from source
go build -o openserp . && ./openserp servePrefer not to run a server? Skip ahead to Using the hosted API.
A search is a single HTTP GET, so you can check the server with curl:
# One engine
curl "http://localhost:7000/google/search?text=open+source+search+api&limit=10"
# Several engines at once
curl "http://localhost:7000/mega/search?text=open+source+search+api&engines=bing,duckduckgo&limit=10"| Tool | Package | Install |
|---|---|---|
| JavaScript / TypeScript | @openserp/sdk |
npm install @openserp/sdk |
| Python | openserp |
pip install openserp |
| MCP server (AI agents) | @openserp/mcp |
npx @openserp/mcp |
| n8n community node | @openserp/n8n-nodes-openserp |
Install via n8n community nodes |
- How do I run a search from code? — JavaScript · Python
- How do I compare results across several engines? — JavaScript
- How do I search a list of keywords and export them? — Python
- How do I ground an LLM answer in fresh search results? — JavaScript
- How do I give a search tool to an agent? — Python
- I want this inside Claude, Cursor, or another MCP client. —
@openserp/mcp
- Who are my real competitors for a set of keywords? — JavaScript
- Where does my domain rank for each keyword? — Python
- How do I search and read the page content in one call? — JavaScript
- How do I turn a URL into clean Markdown? — Python
- How do I search images and preview them? — JavaScript
- I want to wire OpenSERP into a no-code workflow. —
@openserp/n8n-nodes-openserp
Every example points at a local server. To use the managed API instead, get a key from openserp.org/dashboard/keys and construct the client with it — no base URL needed:
const client = new OpenSERP({ apiKey: "<YOUR_API_TOKEN>" });client = OpenSERP(api_key="<YOUR_API_TOKEN>")The endpoints and response shape are identical, so example code moves between
self-hosted and hosted by changing only that one line. Set either baseUrl
(self-hosted) or apiKey (hosted) — not both.