> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapegraphai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transition Guide from v1 to v2

> Move from v1 to v2 quickly and safely

## Transition from v1 to v2

<Warning>
  Once you log in, your v1 code will be deprecated in 7 days. The legacy dashboard at [dashboard.scrapegraphai.com/login](https://dashboard.scrapegraphai.com/login/) will remain temporarily available during the transition.
</Warning>

If you are coming from the legacy v1 docs, use this page as your migration checkpoint.

Before anything else, log in to the dashboard at [scrapegraphai.com/login](https://scrapegraphai.com/login).

## Method-by-method migration

Use this table to map old entry points to new ones. Details and examples follow below.

| v1                                                           | v2                                                                                                                                                                                               | Notes                                                                                                                                                                                                     |
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `markdownify`                                                | [**`scrape`**](/services/scrape) with `format="markdown"` (Python) or `format: "markdown"` (JS)                                                                                                  | HTML → markdown and related “raw page” outputs live under [**`scrape`**](/services/scrape).                                                                                                               |
| `smartscraper` / `smartScraper`                              | [**`extract`**](/services/extract)                                                                                                                                                               | Same job: structured extraction from a URL. Rename params and pass extra fetch/LLM options via config objects.                                                                                            |
| `searchscraper` / `searchScraper`                            | [**`search`**](/services/search)                                                                                                                                                                 | Web search + extraction; use `query` (or positional string in JS).                                                                                                                                        |
| `smartcrawler` (single start call)                           | [**`crawl.start`**](/services/crawl), then [**`crawl.get`**](/services/crawl), [**`crawl.stop`**](/services/crawl), [**`crawl.resume`**](/services/crawl), [**`crawl.delete`**](/services/crawl) | Crawl is explicitly async: you poll or track job id.                                                                                                                                                      |
| Monitors (if you used them)                                  | [**`monitor.create`**](/services/monitor), [**`monitor.list`**](/services/monitor), [**`monitor.get`**](/services/monitor), pause/resume/delete                                                  | Same product, namespaced API.                                                                                                                                                                             |
| `sitemap`                                                    | **Removed from v2 SDKs**                                                                                                                                                                         | Discover URLs with [**`crawl.start`**](/services/crawl) and URL patterns, or call the REST sitemap endpoint if your integration still requires it—see [Sitemap](/services/sitemap) and SDK release notes. |
| `healthz` / `checkHealth`, `feedback`, built-in mock helpers | **Removed or changed**                                                                                                                                                                           | Use **`credits`**, **`history`**, and dashboard features; check the SDK migration guides for replacements.                                                                                                |
| `agenticscraper`                                             | **Removed**                                                                                                                                                                                      | Use [**`extract`**](/services/extract) with `FetchConfig` (e.g. `mode="js"`, `stealth=True`, `wait=2000`) for hard pages, or [**`crawl.start`**](/services/crawl) for multi-page flows.                   |

## Code-level transition

### 1. Markdownify → [`scrape`](/services/scrape)

**Before:** `markdownify(url)`.

**After:** `scrape(url, format="markdown")` (Python) or `scrape(url, { format: "markdown" })` (JS).

<CodeGroup>
  ```python Python (v2) theme={null}
  from scrapegraph_py import ScrapeGraphAI, MarkdownFormatConfig

  # reads SGAI_API_KEY from env, or pass explicitly: ScrapeGraphAI(api_key="...")
  sgai = ScrapeGraphAI()

  res = sgai.scrape(
      "https://example.com",
      formats=[MarkdownFormatConfig()],
  )

  if res.status == "success":
      print(res.data.results.get("markdown", {}).get("data", [None])[0])
  ```

  ```javascript JavaScript (v2) theme={null}
  import { ScrapeGraphAI } from "scrapegraph-js";

  // reads SGAI_API_KEY from env, or pass explicitly: ScrapeGraphAI({ apiKey: "..." })
  const sgai = ScrapeGraphAI();

  const res = await sgai.scrape({
    url: "https://example.com",
    formats: [{ type: "markdown" }],
  });

  if (res.status === "success") {
    console.log(res.data?.results.markdown?.data?.[0]);
  }
  ```
</CodeGroup>

### 2. SmartScraper → [`extract`](/services/extract)

**Before (v1):** `website_url` + `user_prompt`, optional flags on the same object.

**After (v2):** `url` + `prompt`; move fetch-related flags into `FetchConfig` / `fetchConfig`.

<CodeGroup>
  ```python Python (v1) theme={null}
  from scrapegraph_py import Client

  client = Client(api_key="your-api-key")
  response = client.smartscraper(
      website_url="https://example.com",
      user_prompt="Extract the title and price",
      stealth=True,
  )
  ```

  ```python Python (v2) theme={null}
  from scrapegraph_py import ScrapeGraphAI, FetchConfig

  sgai = ScrapeGraphAI()
  res = sgai.extract(
      "Extract the title and price",
      url="https://example.com",
      fetch_config=FetchConfig(stealth=True),
  )

  if res.status == "success":
      print(res.data.json_data)
  ```

  ```javascript JavaScript (v1) theme={null}
  import { smartScraper } from "scrapegraph-js";

  const response = await smartScraper(apiKey, {
    website_url: "https://example.com",
    user_prompt: "Extract the title and price",
    stealth: true,
  });
  ```

  ```javascript JavaScript (v2) theme={null}
  import { ScrapeGraphAI } from "scrapegraph-js";

  const sgai = ScrapeGraphAI();

  const res = await sgai.extract({
    url: "https://example.com",
    prompt: "Extract the title and price",
  });

  if (res.status === "success") {
    console.log(res.data?.json);
  }
  ```
</CodeGroup>

### 3. SearchScraper → [`search`](/services/search)

**Before:** `searchscraper` / `searchScraper` with a prompt-style query.

**After:** `search` with `query` (Python keyword argument; JS first argument is the query string).

<CodeGroup>
  ```python Python (v2) theme={null}
  from scrapegraph_py import ScrapeGraphAI

  sgai = ScrapeGraphAI()
  res = sgai.search(
      "Latest pricing for product X",
      num_results=5,
  )

  if res.status == "success":
      for r in res.data.results:
          print(r.title, "-", r.url)
  ```

  ```javascript JavaScript (v2) theme={null}
  import { ScrapeGraphAI } from "scrapegraph-js";

  const sgai = ScrapeGraphAI();

  const res = await sgai.search({
    query: "Latest pricing for product X",
    numResults: 5,
  });

  if (res.status === "success") {
    for (const r of res.data?.results ?? []) console.log(r.title, "-", r.url);
  }
  ```
</CodeGroup>

### 4. [Crawl](/services/crawl) jobs

**Before:** One-shot `crawl(...)` style usage depending on SDK version.

**After:** Start a job, then poll or webhook as documented:

<CodeGroup>
  ```python Python (v2) theme={null}
  from scrapegraph_py import ScrapeGraphAI

  sgai = ScrapeGraphAI()

  start = sgai.crawl.start(
      "https://example.com",
      max_depth=2,
      include_patterns=["/blog/*"],
      exclude_patterns=["/admin/*"],
  )

  status = sgai.crawl.get(start.data.id)
  print(status.data.status, status.data.finished, "/", status.data.total)
  ```

  ```javascript JavaScript (v2) theme={null}
  import { ScrapeGraphAI } from "scrapegraph-js";

  const sgai = ScrapeGraphAI();

  const start = await sgai.crawl.start({
    url: "https://example.com",
    maxDepth: 2,
    includePatterns: ["/blog/*"],
    excludePatterns: ["/admin/*"],
  });
  const status = await sgai.crawl.get(start.data.id);
  ```
</CodeGroup>

### 5. REST calls

If you call the API with `curl` or a generic HTTP client:

* Use the v2 host and path pattern: **`https://v2-api.scrapegraphai.com/api/<endpoint>`** (e.g. [`/api/scrape`](/services/scrape), [`/api/extract`](/services/extract), [`/api/search`](/services/search), [`/api/crawl`](/services/crawl), [`/api/monitor`](/services/monitor)).
* Replace JSON fields to match v2 bodies (e.g. `url` and `prompt` instead of `website_url` and `user_prompt` on extract; `formats: [{ type: "markdown" }]` instead of `format: "markdown"`).
* Authenticate with the **`SGAI-APIKEY`** header.

Exact paths and payloads are listed under each service (for example [Scrape](/services/scrape)) and in the [API reference](/api-reference/introduction).

## What else changed in v2 (docs & product)

* Unified and clearer API documentation
* Updated service pages and endpoint organization
* New guides for MCP server and SDK usage

## Recommended path

1. Log in at [scrapegraphai.com/login](https://scrapegraphai.com/login)
2. Start from [Introduction](/introduction)
3. Follow [Installation](/install)
4. Upgrade packages: `pip install "scrapegraph-py>=2.0.1,<2.1.0"` / `npm i scrapegraph-js@latest` (requires **`scrapegraph-py` 2.0.1** with **Python ≥ 3.12**, and **`scrapegraph-js` ≥ 2.1.0** with **Node ≥ 22**)

## SDK migration guides (detailed changelogs)

* [Python SDK Migration Guide](https://github.com/ScrapeGraphAI/scrapegraph-py/blob/main/MIGRATION_V2.md)
* [JavaScript SDK Migration Guide](https://github.com/ScrapeGraphAI/scrapegraph-js/blob/main/MIGRATION.md)

Full method documentation:

* [Python SDK](/sdks/python)
* [JavaScript SDK](/sdks/javascript)

## Legacy v1 docs

You can still access v1 documentation here:

* [v1 Introduction](/v1/introduction)
