Home
Softono
s

scrapegraphai

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
4

Software by scrapegraphai

Scrapegraph-ai
Open Source

Scrapegraph-ai

## πŸš€ **Looking for an even faster and simpler way to scrape at scale (only 5 lines of code)?** Check out our enhanced version at [**ScrapeGraphAI.com**](https://scrapegraphai.com/?utm_source=github&utm_medium=readme&utm_campaign=oss_cta&ut#m_content=top_banner)! πŸš€ --- # πŸ•·οΈ ScrapeGraphAI: You Only Scrape Once <p align="center"> <a href="https://scrapegraphai.com"> <img src="media/banner.png" alt="ScrapeGraphAI" style="width: 100%;"> </a> </p> [English](README.md) | [δΈ­ζ–‡](docs/chinese.md) | [ζ—₯本θͺž](docs/japanese.md) | [ν•œκ΅­μ–΄](docs/korean.md) | [Русский](docs/russian.md) | [TΓΌrkΓ§e](docs/turkish.md) | [Deutsch](docs/german.md) | [EspaΓ±ol](docs/spanish.md) | [franΓ§ais](docs/french.md) | [PortuguΓͺs](docs/portuguese.md) | [Italiano](docs/italian.md) [![PyPI Downloads](https://static.pepy.tech/personalized-badge/scrapegraphai?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/scrapegraphai) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT) [![](https://dcbadge.vercel.app/api/server/gkxQDAjfeX)](https://discord.gg/gkxQDAjfeX) <p align="center"> <a href="https://trendshift.io/repositories/15078" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15078" alt="ScrapeGraphAI%2FScrapegraph-ai | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a> <p align="center"> [ScrapeGraphAI](https://scrapegraphai.com) is a *web scraping* python library that uses LLM and direct graph logic to create scraping pipelines for websites and local documents (XML, HTML, JSON, Markdown, etc.). Just say which information you want to extract and the library will do it for you! ## πŸš€ Integrations ScrapeGraphAI offers seamless integration with popular frameworks and tools to enhance your scraping capabilities. Whether you're building with Python or Node.js, using LLM frameworks, or working with no-code platforms, we've got you covered with our comprehensive integration options.. <p align="center"> <a href="https://scrapegraphai.com"> <img src="https://raw.githubusercontent.com/ScrapeGraphAI/.github/main/profile/assets/api_banner.png" alt="Web data extraction at scale? Try ScrapeGraphAI cloud" style="width: 100%;"> </a> </p> You can find more informations at the following [link](https://scrapegraphai.com) **Integrations**: - **API**: [Documentation](https://docs.scrapegraphai.com/introduction) - **SDKs**: [Python](https://docs.scrapegraphai.com/sdks/python), [Node](https://docs.scrapegraphai.com/sdks/javascript) - **LLM Frameworks**: [Langchain](https://docs.scrapegraphai.com/integrations/langchain), [Llama Index](https://docs.scrapegraphai.com/integrations/llamaindex), [Crew.ai](https://docs.scrapegraphai.com/integrations/crewai), [Agno](https://docs.scrapegraphai.com/integrations/agno), [CamelAI](https://github.com/camel-ai/camel) - **Low-code Frameworks**: [Pipedream](https://pipedream.com/apps/scrapegraphai), [Bubble](https://bubble.io/plugin/scrapegraphai-1745408893195x213542371433906180), [Zapier](https://zapier.com/apps/scrapegraphai/integrations), [n8n](http://localhost:5001/dashboard), [Dify](https://dify.ai), [Toolhouse](https://app.toolhouse.ai/mcp-servers/scrapegraph_smartscraper) - **MCP server**: [Link](https://smithery.ai/server/@ScrapeGraphAI/scrapegraph-mcp) ## πŸš€ Quick install The reference page for Scrapegraph-ai is available on the official page of PyPI: [pypi](https://pypi.org/project/scrapegraphai/). ```bash pip install scrapegraphai # IMPORTANT (for fetching websites content) playwright install ``` **Note**: it is recommended to install the library in a virtual environment to avoid conflicts with other libraries 🐱 ## πŸ’» Usage There are multiple standard scraping pipelines that can be used to extract information from a website (or local file). The most common one is the `SmartScraperGraph`, which extracts information from a single page given a user prompt and a source URL. ```python from scrapegraphai.graphs import SmartScraperGraph # Define the configuration for the scraping pipeline graph_config = { "llm": { "model": "ollama/llama3.2", "model_tokens": 8192, "format": "json", }, "verbose": True, "headless": False, } # Create the SmartScraperGraph instance smart_scraper_graph = SmartScraperGraph( prompt="Extract useful information from the webpage, including a description of what the company does, founders and social media links", source="https://scrapegraphai.com/", config=graph_config ) # Run the pipeline result = smart_scraper_graph.run() import json print(json.dumps(result, indent=4)) ``` > [!NOTE] > For OpenAI and other models you just need to change the llm config! > ```python >graph_config = { > "llm": { > "api_key": "YOUR_OPENAI_API_KEY", > "model": "openai/gpt-4o-mini", > }, > "verbose": True, > "headless": False, >} >``` The output will be a dictionary like the following: ```python { "description": "ScrapeGraphAI transforms websites into clean, organized data for AI agents and data analytics. It offers an AI-powered API for effortless and cost-effective data extraction.", "founders": [ { "name": "", "role": "Founder & Technical Lead", "linkedin": "https://www.linkedin.com/in/perinim/" }, { "name": "Marco Vinciguerra", "role": "Founder & Software Engineer", "linkedin": "https://www.linkedin.com/in/marco-vinciguerra-7ba365242/" }, { "name": "Lorenzo Padoan", "role": "Founder & Product Engineer", "linkedin": "https://www.linkedin.com/in/lorenzo-padoan-4521a2154/" } ], "social_media_links": { "linkedin": "https://www.linkedin.com/company/101881123", "twitter": "https://x.com/scrapegraphai", "github": "https://github.com/ScrapeGraphAI/Scrapegraph-ai" } } ``` There are other pipelines that can be used to extract information from multiple pages, generate Python scripts, or even generate audio files. | Pipeline Name | Description | |-------------------------|------------------------------------------------------------------------------------------------------------------| | SmartScraperGraph | Single-page scraper that only needs a user prompt and an input source. | | SearchGraph | Multi-page scraper that extracts information from the top n search results of a search engine. | | SpeechGraph | Single-page scraper that extracts information from a website and generates an audio file. | | ScriptCreatorGraph | Single-page scraper that extracts information from a website and generates a Python script. | | SmartScraperMultiGraph | Multi-page scraper that extracts information from multiple pages given a single prompt and a list of sources. | | ScriptCreatorMultiGraph | Multi-page scraper that generates a Python script for extracting information from multiple pages and sources. | For each of these graphs there is the multi version. It allows to make calls of the LLM in parallel. It is possible to use different LLM through APIs, such as **OpenAI**, **Groq**, **Azure**, **Gemini**, **MiniMax** and more, or local models using **Ollama**. Remember to have [Ollama](https://ollama.com/) installed and download the models using the **ollama pull** command, if you want to use local models. ## πŸ“– Documentation [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1sEZBonBMGP44CtO6GQTwAlL0BGJXjtfd?usp=sharing) The documentation for ScrapeGraphAI can be found [here](https://docs.scrapegraphai.com/introduction). ## 🀝 Contributing Feel free to contribute and join our Discord server to discuss with us improvements and give us suggestions! Please see the [contributing guidelines](https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/main/CONTRIBUTING.md). [![My Skills](https://skillicons.dev/icons?i=discord)](https://discord.gg/uJN7TYcpNa) [![My Skills](https://skillicons.dev/icons?i=linkedin)](https://www.linkedin.com/company/scrapegraphai/) [![My Skills](https://skillicons.dev/icons?i=twitter)](https://twitter.com/scrapegraphai) ## πŸ”— ScrapeGraph API & SDKs If you are looking for a quick solution to integrate ScrapeGraph in your system, check out our powerful API [here!](https://scrapegraphai.com) [![API Banner](https://raw.githubusercontent.com/ScrapeGraphAI/Scrapegraph-ai/main/docs/assets/api_banner.png)](https://scrapegraphai.com) We offer SDKs in both Python and Node.js, making it easy to integrate into your projects. Check them out below: | SDK | Language | GitHub Link | |-----------|----------|-----------------------------------------------------------------------------| | Python SDK | Python | [scrapegraph-py](https://docs.scrapegraphai.com/sdks/python) | | Node.js SDK | Node.js | [scrapegraph-js](https://docs.scrapegraphai.com/sdks/javascript) | The Official API Documentation can be found [here](https://docs.scrapegraphai.com/introduction). ## πŸ“ˆ Telemetry We collect anonymous usage metrics to enhance our package's quality and user experience. The data helps us prioritize improvements and ensure compatibility. If you wish to opt-out, set the environment variable SCRAPEGRAPHAI_TELEMETRY_ENABLED=false. For more information, please refer to the documentation [here](https://docs.scrapegraphai.com/introduction). ## ❀️ Contributors [![Contributors](https://contrib.rocks/image?repo=ScrapeGraphAI/Scrapegraph-ai)](https://github.com/ScrapeGraphAI/Scrapegraph-ai/graphs/contributors) ## πŸŽ“ Citations If you have used our library for research purposes please quote us with the following reference: ```text @misc{scrapegraph-ai, author = {Lorenzo Padoan, Marco Vinciguerra}, title = {Scrapegraph-ai}, year = {2024}, url = {https://github.com/ScrapeGraphAI/Scrapegraph-ai}, note = {A Python library for scraping leveraging large language models} } ``` ## Authors | | Contact Info | |--------------------|----------------------| | Marco Vinciguerra | [![Linkedin Badge](https://img.shields.io/badge/-Linkedin-blue?style=flat&logo=Linkedin&logoColor=white)](https://www.linkedin.com/in/marco-vinciguerra-7ba365242/) | | Lorenzo Padoan | [![Linkedin Badge](https://img.shields.io/badge/-Linkedin-blue?style=flat&logo=Linkedin&logoColor=white)](https://www.linkedin.com/in/lorenzo-padoan-4521a2154/) | ## πŸ“œ License ScrapeGraphAI is licensed under the MIT License. See the [LICENSE](https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/main/LICENSE) file for more information. ## Acknowledgements - We would like to thank all the contributors to the project and the open-source community for their support. - ScrapeGraphAI is meant to be used for data exploration and research purposes only. We are not responsible for any misuse of the library. Made with ❀️ by [ScrapeGraph AI](https://scrapegraphai.com) [Scarf tracking](https://static.scarf.sh/a.png?x-pxid=102d4b8c-cd6a-4b9e-9a16-d6d141b9212d)

AI Agents Browser Automation
27K Github Stars
scrapecraft
Open Source

scrapecraft

# 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](https://raw.githubusercontent.com/ScrapeGraphAI/Scrapegraph-ai/main/docs/assets/api_banner.png)](https://scrapegraphai.com/?utm_source=github&utm_medium=readme&utm_campaign=api_banner&utm_content=api_banner_image) ## 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](https://openrouter.ai/keys)) - ScrapeGraphAI API key (Get it from [ScrapeGraphAI](https://scrapegraphai.com/auth/login)) ## 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](https://openrouter.ai/keys) - `SCRAPEGRAPH_API_KEY`: Get from [ScrapeGraphAI](https://scrapegraphai.com/auth/login) 3. **Start the application with Docker** ```bash docker compose up -d ``` 4. **Access the application** - Frontend: http://localhost:3000 - API: http://localhost:8000 - API Docs: http://localhost:8000/docs 5. **Stop the application** ```bash docker compose down ``` ## Development Mode If you want to run the application in development mode without Docker: ### Backend Development ```bash cd backend pip install -r requirements.txt uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 ``` ### Frontend Development ```bash 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](https://openrouter.ai/keys) | | SCRAPEGRAPH_API_KEY | Your ScrapeGraphAI API key | [Get API Key](https://scrapegraphai.com/auth/login) | | 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

AI Agents
656 Github Stars
scrapegraph-py
Open Source

scrapegraph-py

# ScrapeGraphAI Python SDK [![PyPI version](https://badge.fury.io/py/scrapegraph-py.svg)](https://badge.fury.io/py/scrapegraph-py) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) <p align="center"> <a href="https://scrapegraphai.com"> <img src="media/banner.png" alt="ScrapeGraphAI Python SDK" style="width: 100%;"> </a> </p> Official Python SDK for the [ScrapeGraphAI API](https://scrapegraphai.com). ## Install ```bash pip install scrapegraph-py # or uv add scrapegraph-py ``` ## Quick Start ```python from scrapegraph_py import ScrapeGraphAI # reads SGAI_API_KEY from env, or pass explicitly: ScrapeGraphAI(api_key="...") sgai = ScrapeGraphAI() result = sgai.scrape("https://example.com") if result.status == "success": print(result.data["results"]["markdown"]["data"]) else: print(result.error) ``` Every method returns `ApiResult[T]` β€” no exceptions to catch: ```python @dataclass class ApiResult(Generic[T]): status: Literal["success", "error"] data: T | None error: str | None elapsed_ms: int ``` ## API ### scrape Scrape a webpage in multiple formats (markdown, html, screenshot, json, etc). ```python from scrapegraph_py import ( ScrapeGraphAI, FetchConfig, MarkdownFormatConfig, ScreenshotFormatConfig, JsonFormatConfig ) sgai = ScrapeGraphAI() res = sgai.scrape( "https://example.com", formats=[ MarkdownFormatConfig(mode="reader"), ScreenshotFormatConfig(full_page=True, width=1440, height=900), JsonFormatConfig(prompt="Extract product info"), ], content_type="text/html", # optional, auto-detected fetch_config=FetchConfig( # optional mode="js", # "auto" | "fast" | "js" stealth=True, timeout=30000, wait=2000, scrolls=3, headers={"Accept-Language": "en"}, cookies={"session": "abc"}, country="us", ), ) ``` **Formats:** - `markdown` β€” Clean markdown (modes: `normal`, `reader`, `prune`) - `html` β€” Raw HTML (modes: `normal`, `reader`, `prune`) - `links` β€” All links on the page - `images` β€” All image URLs - `summary` β€” AI-generated summary - `json` β€” Structured extraction with prompt/schema - `branding` β€” Brand colors, typography, logos - `screenshot` β€” Page screenshot (full_page, width, height, quality) ### extract Extract structured data from a URL, HTML, or markdown using AI. ```python from scrapegraph_py import ScrapeGraphAI sgai = ScrapeGraphAI() res = sgai.extract( prompt="Extract product names and prices", url="https://example.com", schema={"type": "object", "properties": {...}}, # optional mode="reader", # optional # Or pass html/markdown directly instead of url ) ``` ### search Search the web and optionally extract structured data. ```python from scrapegraph_py import ScrapeGraphAI sgai = ScrapeGraphAI() res = sgai.search( "best programming languages 2024", num_results=5, # 1-20, default 3 format="markdown", # "markdown" | "html" prompt="Extract key points", # optional, for AI extraction schema={...}, # optional time_range="past_week", # optional location_geo_code="us", # optional ) ``` ### crawl Crawl a website and its linked pages. ```python from scrapegraph_py import ScrapeGraphAI, ScrapeMarkdownFormatEntry sgai = ScrapeGraphAI() # Start a crawl start = sgai.crawl.start( "https://example.com", formats=[ScrapeMarkdownFormatEntry()], max_pages=50, max_depth=2, max_links_per_page=10, include_patterns=["/blog/*"], exclude_patterns=["/admin/*"], ) # Check status status = sgai.crawl.get(start.data["id"]) pages = sgai.crawl.pages(start.data["id"], cursor=0, limit=50) # Control sgai.crawl.stop(crawl_id) sgai.crawl.resume(crawl_id) sgai.crawl.delete(crawl_id) ``` ### monitor Monitor a webpage for changes on a schedule. ```python from scrapegraph_py import ScrapeGraphAI, MarkdownFormatConfig sgai = ScrapeGraphAI() # Create a monitor mon = sgai.monitor.create( "https://example.com", "0 * * * *", # cron expression name="Price Monitor", formats=[MarkdownFormatConfig()], webhook_url="https://...", # optional ) # Manage monitors sgai.monitor.list() sgai.monitor.get(cron_id) sgai.monitor.update(cron_id, interval="0 */6 * * *") sgai.monitor.pause(cron_id) sgai.monitor.resume(cron_id) sgai.monitor.delete(cron_id) ``` ### history Fetch request history. ```python from scrapegraph_py import ScrapeGraphAI sgai = ScrapeGraphAI() history = sgai.history.list( service="scrape", # optional filter page=1, limit=20, ) entry = sgai.history.get("request-id") ``` ### credits / health ```python from scrapegraph_py import ScrapeGraphAI sgai = ScrapeGraphAI() credits = sgai.credits() # { remaining: 1000, used: 500, plan: "pro", jobs: { crawl: {...}, monitor: {...} } } health = sgai.health() # { status: "ok", uptime: 12345 } ``` ## Async Client All methods have async equivalents via `AsyncScrapeGraphAI`: ```python import asyncio from scrapegraph_py import AsyncScrapeGraphAI async def main(): async with AsyncScrapeGraphAI() as sgai: result = await sgai.scrape("https://example.com") if result.status == "success": print(result.data["results"]["markdown"]["data"]) else: print(result.error) asyncio.run(main()) ``` ### Async Extract ```python async with AsyncScrapeGraphAI() as sgai: res = await sgai.extract( prompt="Extract product names and prices", url="https://example.com", ) ``` ### Async Search ```python async with AsyncScrapeGraphAI() as sgai: res = await sgai.search("best programming languages 2024", num_results=5) ``` ### Async Crawl ```python async with AsyncScrapeGraphAI() as sgai: start = await sgai.crawl.start("https://example.com", max_pages=50) status = await sgai.crawl.get(start.data["id"]) pages = await sgai.crawl.pages(start.data["id"], cursor=0, limit=50) ``` ### Async Monitor ```python async with AsyncScrapeGraphAI() as sgai: mon = await sgai.monitor.create( "https://example.com", "0 * * * *", name="Price Monitor", ) ``` ## Examples ### Sync Examples | Service | Example | Description | |---------|---------|-------------| | scrape | [`scrape_basic.py`](examples/scrape/scrape_basic.py) | Basic markdown scraping | | scrape | [`scrape_multi_format.py`](examples/scrape/scrape_multi_format.py) | Multiple formats | | scrape | [`scrape_json_extraction.py`](examples/scrape/scrape_json_extraction.py) | Structured JSON extraction | | scrape | [`scrape_pdf.py`](examples/scrape/scrape_pdf.py) | PDF document parsing | | scrape | [`scrape_with_fetchconfig.py`](examples/scrape/scrape_with_fetchconfig.py) | JS rendering, stealth mode | | extract | [`extract_basic.py`](examples/extract/extract_basic.py) | AI data extraction | | extract | [`extract_with_schema.py`](examples/extract/extract_with_schema.py) | Extraction with JSON schema | | search | [`search_basic.py`](examples/search/search_basic.py) | Web search | | search | [`search_with_extraction.py`](examples/search/search_with_extraction.py) | Search + AI extraction | | crawl | [`crawl_basic.py`](examples/crawl/crawl_basic.py) | Start and monitor a crawl | | crawl | [`crawl_with_formats.py`](examples/crawl/crawl_with_formats.py) | Crawl with formats | | crawl | [`crawl_pages.py`](examples/crawl/crawl_pages.py) | Paginated crawl pages with scrape results | | monitor | [`monitor_basic.py`](examples/monitor/monitor_basic.py) | Create a page monitor | | monitor | [`monitor_with_webhook.py`](examples/monitor/monitor_with_webhook.py) | Monitor with webhook | | utilities | [`credits.py`](examples/utilities/credits.py) | Check credits and limits | | utilities | [`health.py`](examples/utilities/health.py) | API health check | | utilities | [`history.py`](examples/utilities/history.py) | Request history | ### Async Examples | Service | Example | Description | |---------|---------|-------------| | scrape | [`scrape_basic_async.py`](examples/scrape/scrape_basic_async.py) | Basic markdown scraping | | scrape | [`scrape_multi_format_async.py`](examples/scrape/scrape_multi_format_async.py) | Multiple formats | | scrape | [`scrape_json_extraction_async.py`](examples/scrape/scrape_json_extraction_async.py) | Structured JSON extraction | | scrape | [`scrape_pdf_async.py`](examples/scrape/scrape_pdf_async.py) | PDF document parsing | | scrape | [`scrape_with_fetchconfig_async.py`](examples/scrape/scrape_with_fetchconfig_async.py) | JS rendering, stealth mode | | extract | [`extract_basic_async.py`](examples/extract/extract_basic_async.py) | AI data extraction | | extract | [`extract_with_schema_async.py`](examples/extract/extract_with_schema_async.py) | Extraction with JSON schema | | search | [`search_basic_async.py`](examples/search/search_basic_async.py) | Web search | | search | [`search_with_extraction_async.py`](examples/search/search_with_extraction_async.py) | Search + AI extraction | | crawl | [`crawl_basic_async.py`](examples/crawl/crawl_basic_async.py) | Start and monitor a crawl | | crawl | [`crawl_with_formats_async.py`](examples/crawl/crawl_with_formats_async.py) | Crawl with formats | | crawl | [`crawl_pages_async.py`](examples/crawl/crawl_pages_async.py) | Paginated crawl pages with scrape results | | monitor | [`monitor_basic_async.py`](examples/monitor/monitor_basic_async.py) | Create a page monitor | | monitor | [`monitor_with_webhook_async.py`](examples/monitor/monitor_with_webhook_async.py) | Monitor with webhook | | utilities | [`credits_async.py`](examples/utilities/credits_async.py) | Check credits and limits | | utilities | [`health_async.py`](examples/utilities/health_async.py) | API health check | | utilities | [`history_async.py`](examples/utilities/history_async.py) | Request history | ## Environment Variables | Variable | Description | Default | |----------|-------------|---------| | `SGAI_API_KEY` | Your ScrapeGraphAI API key | β€” | | `SGAI_API_URL` | Override API base URL | `https://v2-api.scrapegraphai.com/api` | | `SGAI_DEBUG` | Enable debug logging (`"1"`) | off | | `SGAI_TIMEOUT` | Request timeout in seconds | `120` | ## License MIT - [ScrapeGraphAI](https://scrapegraphai.com)

LLM Tools & Chat UIs Browser Automation API Tools
79 Github Stars
just-scrape
Open Source

just-scrape

# just-scrape ![ScrapeGraphAI](media/images/banner.png) Command-line interface for ScrapeGraphAI. This repo contains the CLI source, command modules, build setup, smoke tests, demo assets, and the installable coding-agent skill. ## Scope `just-scrape` wraps ScrapeGraphAI workflows behind a small terminal interface: - `scrape` gets a known URL as markdown, html, screenshot, links, images, summary, branding, or structured JSON - `extract` gets structured JSON from a known URL with a prompt and optional schema - `search` searches the web and can run extraction over results - `crawl` collects multiple pages from a bounded site section - `monitor` schedules recurring page checks and optional webhook notifications - `history`, `credits`, and `validate` cover operational API workflows The detailed agent-facing workflow lives in [skills/just-scrape/SKILL.md](skills/just-scrape/SKILL.md). ## Stack - Runtime: Node.js `>=22` - Package manager used in this repo: Bun - Language: TypeScript, ESM - CLI framework: `citty` - Prompts/output: `@clack/prompts`, `chalk` - Environment loading: `dotenv` - ScrapeGraph client: `scrapegraph-js` - Build: `tsup` - Checks: TypeScript, Biome, Bun test ## Repository Layout ```text just-scrape/ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ cli.ts # CLI entrypoint and command registration β”‚ β”œβ”€β”€ commands/ # one file per command β”‚ β”‚ β”œβ”€β”€ scrape.ts β”‚ β”‚ β”œβ”€β”€ extract.ts β”‚ β”‚ β”œβ”€β”€ search.ts β”‚ β”‚ β”œβ”€β”€ crawl.ts β”‚ β”‚ β”œβ”€β”€ monitor.ts β”‚ β”‚ β”œβ”€β”€ history.ts β”‚ β”‚ β”œβ”€β”€ credits.ts β”‚ β”‚ └── validate.ts β”‚ β”œβ”€β”€ lib/ # env, config, parsing, formats, logging β”‚ └── utils/ β”‚ └── banner.ts β”œβ”€β”€ skills/just-scrape/ β”‚ └── SKILL.md # coding-agent skill published via skills.sh β”œβ”€β”€ tests/ β”‚ └── smoke.test.ts β”œβ”€β”€ assets/ β”‚ β”œβ”€β”€ demo.gif β”‚ └── demo.mp4 β”œβ”€β”€ media/ β”‚ └── images/ β”‚ └── banner.png β”œβ”€β”€ package.json β”œβ”€β”€ tsconfig.json β”œβ”€β”€ tsup.config.ts β”œβ”€β”€ biome.json └── bun.lock ``` ## Install ```bash npm install -g just-scrape@latest pnpm add -g just-scrape@latest yarn global add just-scrape@latest bun add -g just-scrape@latest npx just-scrape@latest --help bunx just-scrape@latest --help ``` Package: [just-scrape](https://www.npmjs.com/package/just-scrape) on npm. ## Configuration Get an API key at [scrapegraphai.com/dashboard](https://scrapegraphai.com/dashboard). ```bash # Set your API key (from the dashboard) in the environment: export SGAI_API_KEY=<your-api-key> just-scrape validate just-scrape credits ``` API key resolution order: 1. `SGAI_API_KEY` 2. `.env` 3. `~/.scrapegraphai/config.json` 4. interactive prompt Environment variables: | Variable | Description | Default | |---|---|---| | `SGAI_API_KEY` | ScrapeGraph API key | none | | `SGAI_API_URL` | Override API base URL | `https://v2-api.scrapegraphai.com` | | `SGAI_TIMEOUT` | Request timeout in seconds | `120` | | `SGAI_DEBUG` | Debug logs to stderr | `0` | ## Usage ```bash just-scrape scrape "https://example.com" -f markdown,links --json just-scrape extract "https://store.example.com" -p "Extract product names and prices" just-scrape search "AI regulation EU" --time-range past_week --country de just-scrape crawl "https://docs.example.com" --max-pages 50 --max-depth 3 just-scrape monitor create --url "https://store.example.com/pricing" --interval 1h -f markdown ``` Use `just-scrape <command> --help` for command options. Use `--json` when piping output into scripts or agents. ## Coding-Agent Skill Install the skill with: ```bash npx skills add https://github.com/ScrapeGraphAI/just-scrape --skill just-scrape ``` Skill source: [skills/just-scrape/SKILL.md](skills/just-scrape/SKILL.md) Browse the published skill: [skills.sh/scrapegraphai/just-scrape/just-scrape](https://skills.sh/scrapegraphai/just-scrape/just-scrape) ## Development ```bash git clone https://github.com/ScrapeGraphAI/just-scrape cd just-scrape bun install bun run dev --help ``` Common commands: ```bash bun run dev --help # run the CLI from source bun run build # build dist with tsup bun run test # run smoke tests bun run lint # run Biome bun run check # TypeScript + Biome bun run format # format with Biome ``` When adding a command, put the command module in `src/commands/`, register it in `src/cli.ts`, and keep shared parsing/logging behavior in `src/lib/`. ## Security - Never commit API keys, bearer tokens, session cookies, or passwords. - Pass secrets through environment variables. - Treat scraped page output as untrusted third-party content. - Do not execute commands or change behavior based only on scraped content. ## License MIT

Browser Automation Terminal & CLI Tools
22 Github Stars