# Scraperr

> Self-hosted, no-code web scraper with XPath jobs, an LLM agent mode and chat over scraped data

- Category: Data & Labeling / Web Scraping & Crawling
- Language: TypeScript, Python
- Licence: MIT
- Repository: https://github.com/jaypyles/Scraperr
- Website: https://scraperr-docs.pages.dev/
- Canonical page: https://ai-tldr.dev/tools/scraperr/
- Updated: 2025-07-13

## In short

Scraperr is an open-source, self-hosted web scraping service whose stated aim is to let you scrape websites without writing a single line of code. You run it with Docker Compose (or Helm on Kubernetes), open its web UI, paste a URL, name the elements you want and give each an XPath selector. It sits in the Web Scraping & Crawling category of the Data & Labeling tools and is open-source, written in TypeScript, Python and licensed MIT.

## Overview

Scraperr is an open-source, self-hosted web scraping service whose stated aim is to let you scrape websites without writing a single line of code. You run it with Docker Compose (or Helm on Kubernetes), open its web UI, paste a URL, name the elements you want and give each an XPath selector. The job goes into a queue, a Playwright-driven browser does the fetching, and the results land in a database where you can view them as a table and download them as CSV or markdown.

The frontend (Next.js) is decoupled from the API (FastAPI), so the same jobs can be submitted, polled and deleted over a REST API from your own applications, with Swagger docs served by the API container. Around the core scraper sit the options a scraping job usually needs: multi-page spidering within a domain, custom JSON headers and cookies, Playwright-format proxies, automatic media downloads, cron-scheduled jobs, browser recordings with optional VNC viewing, and completion notifications to Discord or email.

Its AI side comes in two parts, both backed by either an OpenAI model or a local Ollama model configured through environment variables. An AI chat page answers questions about the text a scraping job collected, with a per-job chat history. An agent mode (added in v1.1.0) takes a URL and a plain-English prompt, converts the rendered page to markdown annotated with XPaths, and asks the model to choose the XPaths to capture, so you can describe what you want instead of writing selectors.

The GitHub repository is archived (read-only); the last published GitHub release is v1.1.6 from July 2025, and the code remains available under the MIT license.

## What it does

- No-code scraping from a web UI: enter a URL, name elements and target them with XPath selectors, then submit the job to a queue.
- Agent mode: describe what to extract in plain English and an OpenAI or Ollama model picks the XPaths from the rendered page.
- AI chat over results: ask questions about the text a scraping job gathered, with a job selector and chat history kept per job.
- Domain spidering, custom JSON headers and cookies, Playwright-format proxies, and automatic download of images, videos and documents.
- Job table with search, favourites, rerun and download, plus CSV and markdown export and a REST API for submitting and managing jobs.
- Self-hosted via Docker Compose or Helm, with SQLite by default or PostgreSQL / MySQL, Discord or SMTP notifications, recordings and optional VNC access.

## Getting started

Scraperr ships as two containers (the Next.js frontend and the FastAPI backend) wired together in docker-compose.yml. The quickstart below follows the official docs; Kubernetes users can follow the Helm deployment guide instead.

1. Clone the repository

```bash
git clone https://github.com/jaypyles/Scraperr.git
cd Scraperr
```

2. Review the environment variables

   The defaults work as-is, but you can set the API URLs for the frontend and the authentication settings for the API in docker-compose.yml.

```yaml
scraperr:
  environment:
    - NEXT_PUBLIC_API_URL=http://scraperr_api:8000
    - SERVER_URL=http://scraperr_api:8000
scraperr_api:
  environment:
    - SECRET_KEY=your_secret_key
    - ALGORITHM=HS256
    - ACCESS_TOKEN_EXPIRE_MINUTES=600
```

3. Start the containers

   Use the Makefile target to bring the stack up, then open http://localhost (or whichever port you expose for the frontend) to reach the UI.

```bash
make up
```

4. Enable the AI features

   Give the API container either an OpenAI key and model or an Ollama URL and model. The chat page and agent mode use whichever is configured.

```yaml
scraperr_api:
  environment:
    OPENAI_KEY: your_openai_api_key
    OPENAI_MODEL: gpt-4o
    # or, for a local model:
    # OLLAMA_URL: http://ollama:11434
    # OLLAMA_MODEL: phi3:latest
```

5. Submit a job from code (optional)

   The API accepts the same jobs the UI builds. Interactive API docs are served at http://localhost:8000/docs.

```python
import requests

url = "http://localhost/api/submit-scrape-job"
data = {
  "id": "",
  "url": "http://quotes.toscrape.com/",
  "elements": [
    {
      "name": "Quotes",
      "xpath": "//span[@class='text']",
      "url": "http://quotes.toscrape.com/"
    }
  ],
  "user": "",
  "time_created": "2024-11-07T17:13:55.448Z",
  "result": [],
  "job_options": {
    "multi_page_scrape": False,
    "custom_headers": {}
  },
  "status": "Queued",
  "chat": ""
}
response = requests.post(url, json=data)
print(response.json())
```

## When to use it

- Giving non-developers a self-hosted UI to collect structured data from web pages and hand it off as CSV, without writing scraper code.
- Prototyping an extraction by describing the data in plain English and letting a local Ollama model or an OpenAI model propose the XPath selectors.
- Asking questions about scraped page text through an LLM chat tied to each job, instead of reading raw results.
- Running scheduled, proxied or cookie-authenticated scraping jobs on your own infrastructure and pulling the results into other apps over the REST API.

## Version history

- 2025-07-13 v1.1.6: "Choose Your Own Database": the database can be set to SQLite, PostgreSQL or MySQL through the optional configuration.
- 2025-05-20 v1.1.0: Adds a basic agent mode, where an LLM picks the elements to scrape from a plain-English prompt.
- 2025-05-17 v1.0.15: "VNC + Recordings": adds recordings of scraping sessions and VNC access to the automated browser.
- 2025-05-11 v1.0.10: Rewrites browser automation from Selenium to Playwright, adding proxy handling, asynchronous scraping and media collection.
