canonical: https://jentic.com/apis/scrapegraphai.com/scrapegraphai

# ScrapeGraph AI API

The ScrapeGraph AI API extracts structured data from web pages using natural language prompts, returning results shaped by an optional JSON output_schema. SmartScraper works on a URL or on raw HTML or Markdown you supply, with options for pagination, infinite scroll, cookies, and browser interaction steps. Markdownify converts a page to Markdown, SearchScraper answers a question by searching the web and extracting from the results, and Crawl follows a site from a starting URL. Each job returns an id whose status and result can be polled, and a credits endpoint reports the remaining balance.

## For AI agents

Extract structured JSON from any web page with a natural language prompt, convert pages to Markdown, run search-and-extract queries, and crawl sites, polling each job by id.

## Scope

Does not host datasets, schedule recurring scrapes, or provide a proxy pool for your own requests. Use for prompt-based extraction, Markdown conversion, search-and-extract, and crawling only.

## Capabilities

- Extract data from a web page with a user_prompt and an optional output_schema for the JSON shape
- Run extraction on raw website_html or website_markdown you already have instead of a live URL
- Scrape across up to 100 pages with total_pages and handle infinite scroll with number_of_scrolls
- Convert a web page to clean Markdown with Markdownify
- Answer a question from live web search results with SearchScraper, filtered by time_range such as past_week
- Crawl a site from a starting URL and extract data with a prompt
- Poll a job's status by request_id and check remaining_credits

## Use cases

### Agent extraction of structured data from a page

A research agent needs specific fields from a web page as JSON, not raw HTML. Through Jentic it searches for 'extract structured data from a web page', loads the SmartScraper operation with its input schema, and sends a user_prompt, the website_url, and an output_schema while the SGAI-APIKEY header is injected at call time. It then polls the job by request_id until the result is ready.

Example prompt: POST `/v1/smartscraper` with user_prompt 'list each product name and price', website_url, and an output_schema, then GET `/v1/smartscraper/{request_id}` until the job completes

### Pages to Markdown for retrieval pipelines

A retrieval-augmented generation pipeline indexes web content as Markdown so chunking keeps headings and lists intact. Markdownify takes a website_url, optionally with custom headers or stealth mode for protected pages, and the result is fetched by request_id when the conversion finishes.

Example prompt: POST `/v1/markdownify` with website_url, then GET `/v1/markdownify/{request_id}` and store the Markdown in the index

### Search-and-extract research

An analyst asks a question that needs fresh web results rather than one known page. SearchScraper takes the question as user_prompt, searches and extracts from the results, and can restrict them with time_range values such as past_24_hours or past_month, returning JSON in the output_schema shape.

Example prompt: POST `/v1/searchscraper` with user_prompt 'recent Series A rounds in climate tech', time_range set to past_month, and an output_schema, then GET `/v1/searchscraper/{request_id}`

### Site crawl with prompt-based extraction

A team auditing a competitor's site wants the same fields from every page. Crawl starts from a website_url, follows the site, and applies the user_prompt to each page, with results collected by task_id once the crawl finishes.

Example prompt: POST `/v1/crawl` with website_url and user_prompt 'extract the plan name and monthly price', then GET `/v1/crawl/{task_id}`

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v1/smartscraper` | Start a SmartScraper job |
| GET | `/v1/smartscraper/{request_id}` | Get SmartScraper status |
| POST | `/v1/markdownify` | Start a Markdownify job |
| POST | `/v1/searchscraper` | Start a SearchScraper job |
| POST | `/v1/crawl` | Start a crawl |
| GET | `/v1/crawl/{task_id}` | Get crawl result |
| GET | `/v1/credits` | Get credit balance |

## Key resources

- **SmartScraper jobs** — Prompt-driven extraction from a URL, HTML, or Markdown with an optional output schema
- **Markdownify jobs** — Page-to-Markdown conversions
- **SearchScraper jobs** — Search-and-extract answers filtered by time range
- **Crawl tasks** — Multi-page crawls from a starting URL
- **Credits** — Remaining and used credit totals

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 63 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 76 / 100
  - Developer Experience & Jentic Compatibility: 59 / 100
  - AI-Readiness & Agent Experience: 49 / 100
  - Agent Usability: 94 / 100
  - Security: 50 / 100
  - AI Discoverability: 78 / 100
- **View full report:** https://jentic.com/apis/scrapegraphai.com/scrapegraphai/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring ScrapeGraph AI by hand means sending the SGAI-APIKEY header, starting each job and polling it by request_id, and tracking credit costs for options like stealth. Through Jentic you install once, import ScrapeGraph AI from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** ScrapeGraph AI takes the target URL and prompt in the request body, so rules bound which operations your agent may call, not which sites it scrapes. Limit the agent to the operations it needs, such as Markdownify and its status read, and crawls or search jobs are not included unless you add them.
- **Credential handling:** Your ScrapeGraph AI key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'extract data from a web page' or 'convert a page to Markdown', and Jentic returns the matching ScrapeGraph AI operation with its input schema so the agent sends the right prompt and options.

## Related APIs

- **Firecrawl API** — Scrape and crawl websites into Markdown and structured data for LLMs
- **ScrapingDog API** — Proxy-backed web scraping that returns raw page content
- **Apify API** — Run hosted scraping actors and store their datasets

## FAQ

### What authentication does the ScrapeGraph AI API use?

Per its OpenAPI spec, the ScrapeGraph AI API authenticates with an API key sent in the SGAI-APIKEY header on every operation. Through Jentic the key is stored by your own instance and attached at call time, so the agent never sees it.

### Can I control the JSON shape the ScrapeGraph AI API returns?

Yes. SmartScraper, SearchScraper, and Crawl accept an output_schema object, a JSON schema that structures the extracted results. SmartScraper also takes plain_text to return text instead of JSON.

### What are the rate limits for the ScrapeGraph AI API?

The OpenAPI spec does not specify rate limits. Usage is metered in credits, and GET `/v1/credits` returns remaining_credits and total_credits_used. Check https://docs.scrapegraphai.com for current limits.

### Is there a ScrapeGraph AI MCP server?

You don't need an MCP server to give your agent ScrapeGraph AI. Jentic connects it directly from the API Directory: import it, store your credential once, and your agent calls the scrape, markdown, search, and crawl operations on demand without another server's tool definitions in its context.

### How do I scrape a page with a prompt through Jentic?

Search Jentic for 'extract structured data from a web page', load the POST `/v1/smartscraper` operation, and send a user_prompt with the website_url. Poll GET `/v1/smartscraper/{request_id}` for the result. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Can I limit what my agent is allowed to do with the ScrapeGraph AI API?

Yes. Write a rule that allows only POST `/v1/markdownify` and its status read, so a retrieval agent can convert pages to Markdown but cannot start crawls or search jobs that spend more credits. Every call it makes is logged.

### Does the ScrapeGraph AI API handle bot protection?

The scrape, Markdownify, and crawl request bodies accept a stealth flag that enables anti-detection techniques, which the spec notes adds 4 credits to the request.
