Documentation

Everything you need to integrate refetch into your agent or application.

Building with an AI assistant? Point it at refetch.cloud/llm-integration.md for a complete, machine-readable integration guide with error handling, rate limits, and retry logic.

Authentication

All fetch and search endpoints require an API key passed via theAuthorization header as a Bearer token.

curl -H "Authorization: Bearer ftch_your_key" refetch.cloud/md/https://example.com

Most requests cost 1 credit; company endpoints cost more (see /limits for live per-endpoint prices). Documentation endpoints and search endpoints called without a q parameter are free. Check your balance anytime:

bash
curl -H "Authorization: Bearer ftch_your_key" refetch.cloud/usage
json
{
"key": "ftch_abc1...",
"credits_remaining": 450,
"usage": {
"2026-03-05": { "/md": 30, "/s/web": 12 },
"2026-03-06": { "/md": 18, "/s/news": 5, "/": 3 }
}
}

Fetch /html/{url}

Fetch any publicly accessible webpage as raw HTML. The target URL goes directly in the path, including its scheme.

bash
curl -H "Authorization: Bearer YOUR_KEY" refetch.cloud/html/https://example.com/page

Response

html
<!doctype html>
<html lang="en">
<head>
<title>Example Domain</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div>
<h1>Example Domain</h1>
<p>This domain is for use in documentation examples
without needing permission. Avoid use in operations.</p>
<p><a href="https://iana.org/domains/example">Learn more</a></p>
</div>
</body>
</html>

Query parameters are forwarded to the target. You can pass custom strings via theX-Block-Patterns header to detect soft blocks. If any pattern appears in the response body, refetch treats it as blocked and retries through a different route. Useful for paywalls, login walls, or pages that return 200 OK but show gated content.

bash
curl -H "Authorization: Bearer YOUR_KEY" \
-H "X-Block-Patterns: premium required,subscribe to read" \
"refetch.cloud/html/https://example.com/page?sort=date"

Markdown /md/{url}

Returns clean Markdown optimized for LLM context windows. Scripts, styles, navigation, ads, and cookie banners are stripped. Relative URLs are resolved to absolute.

bash
curl -H "Authorization: Bearer YOUR_KEY" refetch.cloud/md/https://example.com

Response

markdown
# Example Domain
This domain is for use in documentation examples without needing
permission. Avoid use in operations.
[Learn more](https://iana.org/domains/example)

JSON-LD /ld+json/{url}

Extracts all JSON-LD structured data blocks from a page. Returns a JSON array of parsed objects. Returns 404 if no JSON-LD is found.

bash
curl -H "Authorization: Bearer YOUR_KEY" refetch.cloud/ld+json/https://en.wikipedia.org/wiki/Artificial_intelligence

Response

json
[
{
"@context": "https://schema.org",
"@type": "Article",
"name": "Artificial intelligence",
"url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
"author": {
"@type": "Organization",
"name": "Contributors to Wikimedia projects"
},
"publisher": {
"@type": "Organization",
"name": "Wikimedia Foundation, Inc."
},
"datePublished": "2001-10-08T16:55:49Z",
"headline": "field of computer science that develops and studies software enabling machines to exhibit intelligent behavior"
}
]

Company news /company/news

Recent news for a company, researched in one call. Behind the scenes the service runs several news and web searches, fetches and reads up to 30 article pages through the proxy network, discards content-farm noise and syndicated duplicates, classifies each remaining story into a buying-signal category with a fact-based summary, and writes a one-paragraph digest in which every claim cites its source domain. Results are cached for up to 24 hours.

Doing the same research with the 1-credit endpoints means 30-plus search and fetch calls, plus your own model reading every page. One /company/news call returns the finished result for 50 credits, about what the raw fetches alone would cost.

bash
curl -H "Authorization: Bearer YOUR_KEY" "refetch.cloud/company/news?domain=klarna.com&name=Klarna"

Response

json
{
"company": { "name": "Klarna", "domain": "klarna.com" },
"fetched_at": "2026-08-11T14:02:11Z",
"cache": "miss",
"digest": "Klarna appointed a new CFO effective October (reuters.com)...",
"count": 2,
"articles": [
{
"headline": "Klarna announces new CFO",
"date": "2026-08-02",
"url": "https://www.reuters.com/...",
"source": "Reuters",
"signal_type": "leadership_change",
"summary": "Former Adyen VP of Finance joins as CFO effective October.",
"confidence": 0.9
}
]
}

Parameters

domainrequiredCompany website domain (e.g. klarna.com)nameoptionalCompany display name, improves search recallcountryoptionalISO 3166-1 alpha-2 code (default: US)limitoptionalMax articles, 1-25 (default: 10)max_ageoptionalAccept cached results up to this many seconds old (default: 86400; 0 forces a fresh crawl)

Signal types

funding, acquisition, leadership_change, breach, layoffs, product_launch, partnership, financial_results, legal_regulatory, other.

This endpoint costs 50 credits per request, covering the searches, page fetches, and LLM classification it performs. GET /limits lists the current per-endpoint prices under endpoint_costs.

MCP /mcp

Connect any MCP-compatible client to refetch. Claude Desktop, Cursor, or custom agents. All endpoints available as tools.

json
{
"mcpServers": {
"refetch": {
"url": "https://refetch.cloud/mcp",
"headers": {
"Authorization": "Bearer ftch_your_key_here"
}
}
}
}

Available tools

fetchFetch any URL as clean Markdownfetch_htmlFetch raw HTML sourcefetch_structured_dataExtract JSON-LD schema.org datasearch_webWeb search with structured resultssearch_newsNews search with sources and datescheck_usageCheck credit balance and usage (free)

Errors

All errors return JSON with a code and message:

json
{ "error": { "code": "ERROR_CODE", "message": "description" } }

Credits are deducted before the upstream request is made. If the request fails after that point, the credit is still consumed. Errors marked with billed below will cost 1 credit.

Authentication

CodeStatusWhat to do
UNAUTHORIZED401freeMissing Authorization header. Add it to every request as: Authorization: Bearer YOUR_KEY
INVALID_API_KEY401freeKey not recognized. Check for typos or regenerate from your console.
INSUFFICIENT_CREDITS402freeBalance is zero. Top up at www.refetch.cloud or check /usage.

Client errors

CodeStatusWhat to do
INVALID_URL400billedURL is malformed, missing scheme, or points to a private IP. Use a full public URL with https://.
MISSING_PARAM400freeA required parameter is missing. Search endpoints need a q parameter.
CONTENT_TYPE_NOT_ALLOWED400billedThe target returned an unsupported content type. PDFs, images, and binary files are not supported.
RESPONSE_TOO_LARGE400billedResponse body exceeds 10 MB. Try requesting a more specific page.
RECURSIVE_PROXY400billedYou tried to fetch from refetch.cloud itself. Don't do that.
NO_LD_JSON404billedPage was fetched successfully but contains no JSON-LD structured data. Try /md/ instead.
NOT_FOUND404freeUnknown endpoint. Check the path.

Rate limits

CodeStatusWhat to do
KEY_RATE_LIMITED429freeYou exceeded your per-key limit (100/s burst, 1,000/min). Back off and spread requests over time.
DOMAIN_RATE_LIMITED429variesToo many requests to the same domain. A 60-second penalty starts. Retries during the penalty window cost 1 credit each.

Upstream errors

CodeStatusWhat to do
UPSTREAM_BLOCKED502billedThe target site blocked the request. Wait and retry, or use X-Block-Patterns to detect soft blocks.
UPSTREAM_ERROR502billedThe target site is down or returned an invalid response. Retry after a few seconds.
RATE_LIMITED429billedUpstream service is rate-limiting. Wait before retrying.

Server errors

CodeStatusWhat to do
SERVICE_UNAVAILABLE503freeService is temporarily unavailable. Retry in a few seconds.
CAPACITY_EXCEEDED503freeService is at maximum capacity. Back off briefly and retry.
INTERNAL_ERROR500billedUnexpected server error. If this persists, contact support.

Rate limits

Two independent rate limits apply to every request. Both use fixed-window counters.

Per-key limits

Each API key is limited to 100 requests/second burst and 1,000 requests/minute sustained. Requests that exceed these limits return KEY_RATE_LIMITED (429) and are not charged.

Per-domain limits

Each target domain has its own rate limit. You may receive DOMAIN_RATE_LIMITED (429) even if you haven't hit your per-key limit. When this happens, a 60-second penalty window begins. The first hit is free. Requests to the same domain during the penalty window cost 1 credit each, so back off immediately.

Response headers

Successful responses include an X-Credits-Remaining header with your current balance. No rate limit headers are returned. Use the /usage endpoint to check your balance and request history, or /limits for machine-readable rate limit and credit information (no auth required).