---
title: "Extract API"
description: "Get the best Markdown for any URL with SerpApi's Extract API, plus page information, meta tags, structured data, links, images and media as JSON."
url: https://serpapi.com/extract-api
site: "SerpApi – Real-time search engine results API"
signup: https://serpapi.com/users/sign_up
engine: "extract"
docs:
  pricing: https://serpapi.com/pricing.md
  integrations: https://serpapi.com/integrations.md
---

# Extract API

Get the best Markdown for any URL with SerpApi's Extract API, plus page information, meta tags, structured data, links, images and media as JSON.

## Example Request

```
GET https://serpapi.com/search?api_key=YOUR_API_KEY&engine=extract&url=QUERY
```

## API parameters

### Search Query

| Parameter | Required | Description |
|-----------|----------|-------------|
| `url` | **Yes** | Parameter defines the URL of the page to extract. It must be an absolute `http` or `https` URL. Search pages that have a dedicated SerpApi engine, such as Google or Bing, are redirected to that engine. |

### Mode

| Parameter | Required | Description |
|-----------|----------|-------------|
| `mode` | No | Parameter defines the extraction mode. It can be set to: `scrape` (default) - Extract a single page. `map` - List the website's URLs from the page links and sitemaps. `crawl` - Follow links on the same website and extract every page visited.  **Crawl mode consumes one search credit per successfully extracted page.** |

### Crawl &amp; map settings

| Parameter | Required | Description |
|-----------|----------|-------------|
| `max_pages` | No | Used with `mode=crawl`. Parameter defines the maximum number of pages to extract, including the starting page. Default: `10`. Maximum: `100`. Each successfully extracted page consumes one search credit. |
| `max_depth` | No | Used with `mode=crawl`. Parameter defines how many links deep the crawl follows from the starting page. `0` extracts only the starting page. Default: `2`. Maximum: `3`. |
| `include_subdomains` | No | Used with `mode=map` and `mode=crawl`. Parameter defines whether to include other subdomains of the same website, e.g. `blog.example.com` when starting from `www.example.com`. Default: `false` (same host only). |
| `include_sitemap` | No | Used with `mode=map`. Parameter defines whether to also read the website's sitemaps, from `/sitemap.xml` and `/robots.txt`. Default: `true`. |

### Fetch &amp; content settings

| Parameter | Required | Description |
|-----------|----------|-------------|
| `prefetch_delay` | No | Parameter defines a delay in milliseconds before the first page is fetched (0–10,000). Default: `0`. The Extract API doesn't run JavaScript, so this is not a rendering delay. |
| `timeout` | No | Parameter defines the HTTP request timeout in milliseconds (1,000–120,000). Default: `30,000` (30 seconds). |
| `include_tags` | No | Parameter defines a comma-separated list of CSS selectors to keep, e.g. `article, main, .post-content`. Everything else inside `<body>` is removed before parsing. |
| `exclude_tags` | No | Parameter defines a comma-separated list of CSS selectors to remove before parsing, e.g. `nav, footer, .ads, #cookie-banner`. |
| `include_markdown` | No | Parameter defines whether to include the page's main content as Markdown in `markdown`. Default: `true`. |

### SerpApi parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `engine` | **Yes** | Set parameter to `extract` to use the Extract API engine. |
| `device` | No | Parameter defines the device to use to get the results. It can be set to `desktop` (default) to use a regular browser, `tablet` to use a tablet browser (currently using iPads), or `mobile` to use a mobile browser. |
| `no_cache` | No | Parameter will force SerpApi to fetch the Extract results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to `false` (default) to allow results from the cache, or `true` to disallow results from the cache. `no_cache` and `async` parameters should not be used together. |
| `async` | No | Parameter defines the way you want to submit your search to SerpApi. It can be set to `false` (default) to open an HTTP connection and keep it open until you got your search results, or `true` to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our [Searches Archive API](https://serpapi.com/search-archive-api) to retrieve your results. `async` and `no_cache` parameters should not be used together. `async` should not be used on accounts with [Ludicrous Speed](https://serpapi.com/plan) enabled. |
| `zero_trace` | No | Enterprise only. Parameter enables [ZeroTrace mode](https://serpapi.com/zero-trace-mode). It can be set to `false` (default) or `true`. Enable this mode to skip storing search parameters, search files, and search metadata on our servers. This may make debugging more difficult. |
| `api_key` | **Yes** | Parameter defines the SerpApi private key to use. |
| `output` | No | Parameter defines the format of the result. It can be set to `json` (default) to get a structured JSON of the results, `html` to get the raw HTML retrieved, or `md` to get a Markdown-formatted version optimized for LLMs and AI agents. |
| `json_restrictor` | No | Parameter defines the fields you want to include in the output, reducing payload size for faster response. See the [JSON Restrictor documentation](https://serpapi.com/json-restrictor) for more details. |

## Response Example

Truncated sample response. URLs are illustrative and not accessible.

```json
{
  "page_information": {
    "title": "Coffee - Wikipedia",
    "final_url": "https://en.wikipedia.org/wiki/Coffee",
    "canonical": "https://en.wikipedia.org/wiki/Coffee",
    "language": "en",
    "favicon": "https://en.wikipedia.org/static/favicon/wikipedia.ico"
  },
  "meta_tags": {
    "generator": "MediaWiki 1.47.0-wmf.23",
    "robots": "max-image-preview:standard"
  },
  "open_graph": {
    "image": "https://thumb.wikimedia.org/wikipedia/commons/thumb/e/e4/Latte_and_dark_coffee.jpg/1280px-Latte_a...",
    "image_width": "1200",
    "image_height": "750",
    "title": "Coffee - Wikipedia",
    "type": "website"
  },
  "json_ld": [
    {
      "@context": "https://schema.org",
      "@type": "Article",
      "name": "Coffee",
      "url": "https://en.wikipedia.org/wiki/Coffee",
      "sameAs": "http://www.wikidata.org/entity/Q8486",
      "mainEntity": "http://www.wikidata.org/entity/Q8486",
      "author": {
        "@type": "Organization",
        "name": "Contributors to Wikimedia projects"
      },
      "publisher": {
        "@type": "Organization",
        "name": "Wikimedia Foundation, Inc.",
        "logo": {
          "@type": "ImageObject",
          "url": "https://www.wikimedia.org/static/images/wmf-hor-googpub.png"
        }
      },
      "datePublished": "2004-04-18T21:41:42Z",
      "dateModified": "2026-08-28T14:28:49Z",
      "image": "https://upload.wikimedia.org/wikipedia/commons/e/e4/Latte_and_dark_coffee.jpg?utm_source=en.wikip...",
      "headline": "brewed beverage made from seeds of Coffea genus"
    }
  ],
  "markdown": "Toggle the table of contents\n\n# Coffee\n\n210 languages\n\n- [Afrikaans](https://af.wikipedia.org/wik...",
  "inline_links": [
    {
      "title": "Jump to content",
      "link": "https://en.wikipedia.org/wiki/Coffee#bodyContent",
      "internal": true,
      "serpapi_extract_link": "https://serpapi.com/search.json?device=desktop&engine=extract&url=https%3A%2F%2Fen.wikipedia.org%..."
    }
  ],
  "inline_images": [
    {
      "source": "https://en.wikipedia.org/static/images/icons/enwiki-25.svg"
    }
  ],
  "feeds": [
    {
      "title": "Wikipedia Atom feed",
      "source": "https://en.wikipedia.org/w/index.php?title=Special:RecentChanges&feed=atom",
      "type": "application/atom+xml"
    }
  ]
}
```

