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 の URL、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"
}