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 / 성공한 호출

공개 ID: web.scrape · 버전 1

가격

USD 0.000700 / 성공한 호출

빠른 시작

API 키로 이 도구를 검색한 다음 반환된 provider와 endpoint의 사양을 확인한 후 실행하세요.

GLOOP_API_BASE에 API 주소를, GLOOP_API_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());
도구 API 문서 · POST /v1/inspect

입력 스키마

{
  "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"
}

출력 스키마

{
  "type": "object"
}

같은 카테고리의 도구