Web Scrape API

Scrape any web page and get its content back as clean Markdown (or HTML, or raw HTML) plus title and metadata.

USD 0.000700 / successful call

Public ID: web.scrape · Version 1

Pricing

USD 0.000700 / successful call

Quick start

Discover this tool with your API key, then inspect the returned provider and endpoint before running it.

Set GLOOP_API_BASE to your API origin and GLOOP_API_KEY to your server-side key.

curl

curl --fail-with-body "${GLOOP_API_BASE%/}/v1/discover" \
  -H "Authorization: Bearer $GLOOP_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "limit": 5,
  "query": "Web Scrape"
}'

Python

import os, json, urllib.request

url = os.environ['GLOOP_API_BASE'].rstrip('/') + "/v1/discover"
headers = {'Authorization': 'Bearer ' + os.environ['GLOOP_API_KEY']}
headers['Content-Type'] = 'application/json'
data = "{\n  \"limit\": 5,\n  \"query\": \"Web Scrape\"\n}".encode('utf-8')
request = urllib.request.Request(url, data=data, headers=headers)
with urllib.request.urlopen(request) as response:
    print(json.load(response))

Node.js

const url = process.env.GLOOP_API_BASE.replace(/\/$/, '') + "/v1/discover";
const headers = { Authorization: `Bearer ${process.env.GLOOP_API_KEY}` };
headers['Content-Type'] = 'application/json';
const response = await fetch(url, { method: 'POST', headers, body: JSON.stringify({
  "limit": 5,
  "query": "Web Scrape"
}) });
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());
Tool API documentation · POST /v1/inspect

Input schema

{
  "additionalProperties": false,
  "properties": {
    "blockAds": {
      "description": "When true (upstream default), strip ad and cookie-consent elements before capture. Set false to keep them.",
      "type": "boolean"
    },
    "excludeTags": {
      "description": "CSS selectors to drop before capture (for example [\"nav\", \"footer\", \".ads\"]). Applied after includeTags.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "formats": {
      "description": "Which representations of the page to return. Any combination of: markdown (page content as Markdown), html (the page HTML exactly as the browser received it, including head and script tags). Each requested format is returned under the matching output field. Defaults to both. rawHtml is a deprecated alias of html, returned under a rawHtml field for callers that predate the rename; send html instead.",
      "items": {
        "enum": [
          "markdown",
          "html",
          "rawHtml"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "includeTags": {
      "description": "CSS selectors to keep. When set, only content matching these selectors is captured (for example [\"article\", \"main\"] or [\"#content\"]).",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "mobile": {
      "description": "When true, render the page with a mobile viewport and user agent instead of desktop. Some sites serve materially different content to mobile.",
      "type": "boolean"
    },
    "onlyMainContent": {
      "description": "When true, return only the main article content, stripping navigation, headers, footers, and other boilerplate. Defaults to false to capture the full page.",
      "type": "boolean"
    },
    "url": {
      "description": "The full web address of the page to scrape, including its domain, for example https://example.com. The https:// prefix is optional.",
      "minLength": 1,
      "type": "string"
    },
    "waitFor": {
      "description": "Milliseconds to wait for the page to finish rendering before capture. Use this for JavaScript-heavy pages or single-page apps whose content loads after the initial paint. Capped at 15000 to stay within the request timeout. This wait is time you asked us to spend, so your response takes this much longer, and it is excluded from the latency published for this endpoint. If every provider that can wait fails, the page may still be returned, captured without the wait.",
      "maximum": 15000,
      "minimum": 0,
      "type": "integer"
    }
  },
  "required": [
    "url"
  ],
  "title": "Web scrape input",
  "type": "object"
}

Output schema

{
  "type": "object"
}

Tools in the same category