Call it
curl https://api.peume.com/v1/call/fetch \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"urls": []
}
}'const res = await fetch("https://api.peume.com/v1/call/fetch", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"urls": []
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/fetch",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"urls": []
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: fetch.
Parameters
urlsRequiredarray1-10 http(s) URLs to fetch, processed in parallel. Private IPs, localhost, and cloud metadata endpoints are rejected. A failure on one URL never fails the batch — it appears in errors[] instead.
purposestringOptional short statement of the task these results are for — the goal behind the request, not the request itself. uses it as an extra ranking signal. Example: 'Compare pricing tiers across vendors for a procurement report'. Max 2000 characters.
formatstringOutput format for each result's `text`. 'markdown' (default) is best for LLM consumption, 'html' returns cleaned semantic HTML, 'json' returns a structured document tree. All three are rendered from the same cleaned page, so none brings back the navigation or footer the cleaning removes — 'include_selectors' does (e.g. ['body']). 'markdown' escapes underscores, also inside JSON documents ('node_id' becomes 'node\_id'); 'html' and 'json' keep them.
markdown · html · json
linksbooleanInclude every <a href> on the page as absolute URLs in the result's `links` array. Defaults to false.
image_linksbooleanInclude every <img src> on the page as absolute URLs in the result's `image_links` array. Defaults to false.
ttlintegerCache freshness tolerance in seconds. Omit to accept any cached entry, 0 to force a live fetch, or a positive number to accept entries younger than that many seconds.
per_url_timeout_msintegerPer-URL wall-clock budget in milliseconds (1-110000). A URL exceeding it returns a 'timeout' entry in errors[] while the rest of the batch still completes.
if_none_matchstringAn ETag saved from a prior fetch of this URL, forwarded verbatim as the If-None-Match request header. Single URL only. An unchanged page returns not_modified: true instead of a body.
if_modified_sincestringA Last-Modified value saved from a prior fetch of this URL, forwarded verbatim as the If-Modified-Since request header. Single URL only.
include_etag_and_last_modifiedbooleanReturn `etag` and `last_modified` on each result so they can be replayed as if_none_match / if_modified_since on a later call. Defaults to false. Fetch does not store them for you. Pair it with ttl=0: validators come from the origin, so a cached hit returns none.
include_selectorsarray1-20 CSS selectors scoping extraction to elements matching ANY entry, concatenated in document order. Automatic boilerplate removal is bypassed. A partial miss still succeeds and reports unmatched_selectors; a total miss fails that URL with selector_not_matched plus candidate_selectors retry hints.
exclude_selectorsarray1-20 CSS selectors for elements to remove BEFORE extraction, applied before include_selectors so it also prunes inside selected regions. Entries that match nothing are a no-op.
