MCPcopy Index your code
hub / github.com/ScrapeGraphAI/scrapecraft

github.com/ScrapeGraphAI/scrapecraft @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
450 symbols 1,268 edges 72 files 249 documented · 55%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ScrapeCraft - AI-Powered Web Scraping Editor

ScrapeCraft is a web-based scraping editor similar to Cursor but specialized for web scraping. It uses AI assistance to help users build scraping pipelines with the ScrapeGraphAI API.

https://github.com/user-attachments/assets/defaf7ad-23da-40b7-82cd-3b2a4d1d22c9

API Banner

Features

  • 🤖 AI-powered assistant using OpenRouter (Kimi-k2 model)
  • 🔗 Multi-URL bulk scraping support
  • 📋 Dynamic schema definition with Pydantic
  • 💻 Python code generation with async support
  • 🚀 Real-time WebSocket streaming
  • 📊 Results visualization (table & JSON views)
  • 🔄 Auto-updating deployment with Watchtower

Tech Stack

  • Backend: FastAPI, LangGraph, ScrapeGraphAI
  • Frontend: React, TypeScript, Tailwind CSS
  • Database: PostgreSQL
  • Cache: Redis
  • Deployment: Docker, Docker Compose, Watchtower

Prerequisites

  • Docker and Docker Compose
  • OpenRouter API key (Get it from OpenRouter)
  • ScrapeGraphAI API key (Get it from ScrapeGraphAI)

Quick Start with Docker

  1. Clone the repository bash git clone https://github.com/ScrapeGraphAI/scrapecraft.git cd scrapecraft

  2. Set up environment variables bash cp .env.example .env

Edit the .env file and add your API keys: - OPENROUTER_API_KEY: Get from OpenRouter - SCRAPEGRAPH_API_KEY: Get from ScrapeGraphAI

  1. Start the application with Docker bash docker compose up -d

  2. Access the application

  3. Frontend: http://localhost:3000
  4. API: http://localhost:8000
  5. API Docs: http://localhost:8000/docs

  6. Stop the application bash docker compose down

Development Mode

If you want to run the application in development mode without Docker:

Backend Development

cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Frontend Development

cd frontend
npm install
npm start

Usage

  1. Create a Pipeline: Click "New Pipeline" to start
  2. Add URLs: Use the URL Manager to add websites to scrape
  3. Define Schema: Create fields for data extraction
  4. Generate Code: Ask the AI to generate scraping code
  5. Execute: Run the pipeline to scrape data
  6. Export Results: Download as JSON or CSV

Remote Updates

The application includes Watchtower for automatic updates:

  1. Push new Docker images to your registry
  2. Watchtower will automatically detect and update containers
  3. No manual intervention required

API Endpoints

  • POST /api/chat/message - Send message to AI assistant
  • GET /api/pipelines - List all pipelines
  • POST /api/pipelines - Create new pipeline
  • PUT /api/pipelines/{id} - Update pipeline
  • POST /api/pipelines/{id}/run - Execute pipeline
  • WS /ws/{pipeline_id} - WebSocket connection

Environment Variables

Variable Description How to Get
OPENROUTER_API_KEY Your OpenRouter API key Get API Key
SCRAPEGRAPH_API_KEY Your ScrapeGraphAI API key Get API Key
JWT_SECRET Secret key for JWT tokens Generate a random string
DATABASE_URL PostgreSQL connection string Auto-configured with Docker
REDIS_URL Redis connection string Auto-configured with Docker

License

MIT

Extension points exported contracts — how you extend this code

ChatMessage (Interface)
(no doc)
frontend/src/types/index.ts
Pipeline (Interface)
(no doc)
frontend/src/types/index.ts
PipelineCreate (Interface)
(no doc)
frontend/src/types/index.ts
PipelineUpdate (Interface)
(no doc)
frontend/src/types/index.ts
WSEvents (Interface)
(no doc)
frontend/src/types/index.ts

Core symbols most depended-on inside this repo

add_transition
called by 13
backend/app/models/workflow.py
get_workflow
called by 11
backend/app/services/workflow_manager.py
get_llm
called by 6
backend/app/services/openrouter.py
_broadcast_workflow_update
called by 5
backend/app/services/workflow_manager.py
_send_safe
called by 5
backend/app/services/enhanced_websocket.py
search_urls
called by 5
backend/app/services/scrapegraph.py
get_workflow_manager
called by 4
backend/app/services/workflow_manager.py
process_message
called by 4
backend/app/services/workflow_manager_v2.py

Shape

Method 175
Function 132
Class 72
Route 44
Interface 26
Enum 1

Languages

Python80%
TypeScript20%

Modules by API surface

backend/app/agents/unified_agent.py29 symbols
backend/app/services/enhanced_websocket.py25 symbols
backend/app/api/auth.py25 symbols
backend/app/agents/langgraph_agent.py21 symbols
backend/app/api/workflow.py20 symbols
backend/app/services/pattern_learner.py19 symbols
backend/app/api/pipelines.py18 symbols
backend/app/services/scraping_service_enhanced.py17 symbols
backend/app/agents/openrouter_agent.py16 symbols
backend/app/services/workflow_manager.py14 symbols
backend/app/api/scraping.py14 symbols
backend/app/services/workflow_manager_v2.py13 symbols

Datastores touched

scrapecraftDatabase · 1 repos

For agents

$ claude mcp add scrapecraft \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact