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

# Migrating to Web Data API

> Move a Web Scraping API or Fast Search API integration to Web Data API: new API key, new base URL, Bearer authentication and endpoint mapping.

**Web Data API** replaces two legacy products:

* **Web Scraping API** is replaced by [/scrape](https://help.decodo.com/docs/web-data-api-scrape-introduction).
* **Fast Search API** is replaced by [/search](https://help.decodo.com/docs/web-data-api-search-introduction).

Existing setups keep working, so you can migrate at your own pace. The request parameters stay the same. You only change the API key, the base URL and the authentication header.

## What changes

| | Legacy | Web Data API |
| :- | :- | :- |
| **Base URL** | `https://scraper-api.decodo.com` (Web Scraping API)<br />`https://fastsearch.decodo.com` (Fast Search API) | `https://data.decodo.com/v1` |
| **Authentication** | `Authorization: Basic TOKEN VALUE` | `Authorization: Bearer TOKEN VALUE` |
| **Credentials** | A separate token for each product | One API key for every endpoint |

## Endpoint mapping

| Legacy endpoint | Web Data API endpoint |
| :- | :- |
| `POST https://scraper-api.decodo.com/v2/scrape` | `POST https://data.decodo.com/v1/scrape` |
| `POST https://scraper-api.decodo.com/v3/task` | `POST https://data.decodo.com/v1/task` |
| `POST https://scraper-api.decodo.com/v3/task/batch` | `POST https://data.decodo.com/v1/task/batch` |
| `GET https://scraper-api.decodo.com/v3/task/{task_id}` | `GET https://data.decodo.com/v1/task/{task_id}` |
| `GET https://scraper-api.decodo.com/v3/task/{task_id}/results` | `GET https://data.decodo.com/v1/task/{task_id}/results` |
| `POST https://fastsearch.decodo.com/v0/search` | `POST https://data.decodo.com/v1/search` |

## Migration steps

### 1. Get a Web Data API key

Your legacy token doesn't work with Web Data API, and the new API key doesn't work with the legacy endpoints. Copy your Web Data API key from the [dashboard](https://dashboard.decodo.com/).

### 2. Update the URL and the authentication header

Replace the legacy URL with its Web Data API endpoint from the table above. Then change `Basic` to `Bearer` in the `Authorization` header and use your new API key.

<CodeGroup>
  ```shellscript Before (Web Scraping API) theme={null}
  curl --request 'POST' \
      --url 'https://scraper-api.decodo.com/v2/scrape' \
      --header 'Accept: application/json' \
      --header 'Authorization: Basic TOKEN VALUE' \
      --header 'Content-Type: application/json' \
      --data '
      {
        "target": "google_search",
        "query": "laptop",
        "parse": true
      }
  '
  ```

  ```shellscript After (/scrape) theme={null}
  curl --request 'POST' \
      --url 'https://data.decodo.com/v1/scrape' \
      --header 'Accept: application/json' \
      --header 'Authorization: Bearer TOKEN VALUE' \
      --header 'Content-Type: application/json' \
      --data '
      {
        "target": "google_search",
        "query": "laptop",
        "parse": true
      }
  '
  ```
</CodeGroup>

<CodeGroup>
  ```shellscript Before (Fast Search API) theme={null}
  curl --request 'POST' \
      --url 'https://fastsearch.decodo.com/v0/search' \
      --header 'Accept: application/json' \
      --header 'Authorization: Basic TOKEN VALUE' \
      --header 'Content-Type: application/json' \
      --data '
      {
        "query": "laptop"
      }
  '
  ```

  ```shellscript After (/search) theme={null}
  curl --request 'POST' \
      --url 'https://data.decodo.com/v1/search' \
      --header 'Accept: application/json' \
      --header 'Authorization: Bearer TOKEN VALUE' \
      --header 'Content-Type: application/json' \
      --data '
      {
        "query": "laptop"
      }
  '
  ```
</CodeGroup>

### 3. Keep your request body

You don't need to change any parameters:

* **/scrape** accepts the same [parameters](https://help.decodo.com/docs/web-data-api-scrape-parameters) as Web Scraping API, including `target`, `headless`, `proxy_pool` and `parse`. The response format is the same too.
* **/search** accepts the same [parameters](https://help.decodo.com/docs/web-data-api-search-parameters) as Fast Search API. The response includes `organic`, `top_stories` and `status`, and can include extra fields such as `answer_box`, `people_also_ask` and `related_searches`.

### 4. Test, then switch

Send a few requests with the new setup and compare the results with your legacy integration. Keep the legacy integration running until you've confirmed that the new one works.

## What's new

Web Data API also adds two endpoints that the legacy products didn't have:

* [/crawl](https://help.decodo.com/docs/web-data-api-crawl-introduction) collects up to 10,000 pages from a site, starting from the URL you submit.
* [/map](https://help.decodo.com/docs/web-data-api-map-introduction) lists the URLs found on a page and in the site's top-level sitemap, without scraping page content.

***

<Columns cols={2}>
  <Card title="Support" href="https://direct.lc.chat/12092754" cta="Let's chat!">
    Need help or just want to say hello? Our support is available 24/7. \
    You can also reach us anytime via email at [support@decodo.com](mailto:support@decodo.com).
  </Card>

  <Card title="Feedback" href="mailto:feedback@decodo.com" cta="Share feedback">
    Can't find what you're looking for? Request an article! \
    Have feedback? Share your thoughts on how we can improve.
  </Card>
</Columns>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.