SerpHubAPI

Fetch

POST /v1/fetch — get the cleaned main content of any public web page as Markdown or plain text.

POST https://api.serphubapi.com/v1/fetch

Give it a URL, get back the page's main content with navigation, ads and boilerplate removed — ready to drop into an agent's context. 3 credits per page; failures are free.

Request

ParameterTypeDefaultDescription
urlstring—Required. The page URL (http or https, publicly reachable).
formatstringmarkdownmarkdown or text (plain text with Markdown syntax stripped).
modestringlivelive fetches the page now. cache_first may return a copy fetched within the last hour — free on a cache hit.

URLs pointing at private, local or otherwise non-public addresses are rejected with 400 validation_error.

curl -X POST https://api.serphubapi.com/v1/fetch \
  -H "X-API-Key: shapi_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/blog/espresso-guide", "format": "markdown"}'

Response

{
  "meta": {
    "id": "fet_01J9Z4A2BC",
    "status": "success",
    "engine": "fetch",
    "cached": false,
    "credits_charged": 3,
    "time_ms": 1240
  },
  "url": "https://example.com/blog/espresso-guide",
  "title": "The Complete Espresso Guide",
  "markdown": "# The Complete Espresso Guide\n\nPulling a good shot starts with ..."
}
FieldTypeDescription
metaobjectSame shape as in Search. engine is always fetch.
urlstringThe URL you requested.
titlestringPage title, when one could be determined.
markdownstringThe main content. With format=text this is plain text — the field name stays markdown.

Credits

CaseCredits
Page fetched3
cache_first cache hit0
Page could not be fetched0

Errors

HTTPCodeWhen
400validation_errorMissing/invalid url, or the URL is not publicly reachable
401invalid_api_keyMissing, invalid or disabled key
402insufficient_balanceFewer than 3 credits available
429rate_limitedRate limit or key daily credit limit reached
502all_upstreams_failedThe page could not be fetched (blocked, timed out, too large…). Not charged

Tips

  • To fetch the pages behind search results in one round trip, use include_content on /v1/search instead.
  • Some sites block automated access or require a login; those return 502 and cost nothing.
  • Fetch results are not stored in the search archive; keep the content on your side if you need it later.