SerpScrap retrieves structured search results for SEO, research, and automation. It is available as a Python package, a CLI, a Docker application, and an MCP-compatible server. Results are JSON-compatible and preserve the fusion rank, provider rank, source engine, URL, title, snippets, result type, and typed failures.
This is an alpha release for evaluation and development. Provider pages are dynamic, live searches require Chrome and network access, and results can be partial when a provider blocks, rate-limits, requests consent, or changes its layout. SerpScrap does not bypass those controls.
python -m pip install SerpScrap==2.0.0a3
For a source checkout:
git clone https://github.com/ecoron/SerpScrap.git cd SerpScrap pipenv install --dev pipenv run python -m pip install -e .
from serpscrap import Config, SerpScrap config = Config() config.apply({ "search_engines": ["google", "bing"], "country_code": "DE", "num_workers": 2, }) scraper = SerpScrap() results = scraper.search("privacy friendly search", config=config, pages=1) scraper.save_json("results.json", overwrite=True)
serpscrap search -k "renewable energy" --search-type news \
--engine google --engine bing --country DE --workers 2 \
--output results.json --overwriteThe CLI keeps result JSON on stdout and progress/logging on stderr. Run
serpscrap search --help for the complete option reference.
The Compose stack provides the API, PostgreSQL history, web UI, and MCP gateway:
mkdir -p data/postgres data/cache data/diagnostics data/exports logs
cp .env.example .env
# Replace the PostgreSQL, SearXNG, and MCP placeholder secrets in .env.
docker compose -f docker/compose.yml up --buildOpen http://localhost:8080 for the UI, use the API at
http://localhost:8000/api/v1, and connect MCP clients to
http://localhost:8001. The standard stack also starts SearXNG at
http://localhost:8888 and connects SerpScrap to it internally. SearXNG is
enabled by default and can be disabled from the configuration page. See the
:doc:`docs/docker` guide for required secrets, health checks, mounts,
operations, and security boundaries. Published ports are loopback-only by
default.
The MCP gateway exposes tools for starting searches, polling status, listing results, inspecting history, discovering engines, and managing validated configuration. See the :doc:`docs/mcp` guide for JSON-RPC examples and client connection details.
- User guide — Python and CLI examples.
- CLI reference — commands and important parameters.
- Docker guide — application deployment and operations.
- MCP guide — gateway tools and JSON-RPC.
- Developer guide — repository, tests, providers, and documentation.
pipenv run python -m ruff check serpscrap scrapcore tests
pipenv run python -m pytest -m "not browser"
pipenv run python -m sphinx -W --keep-going -b html docs docs/_build/htmlSource code is available at https://github.com/ecoron/SerpScrap. The project
is licensed under the terms in LICENSE.