Skip to main content
POST
/
v1
/
fetch
Fetch webpage
curl --request POST \
  --url https://api.hasp.sh/v1/fetch \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "url": "https://example.com",
  "max_tokens": 2000,
  "summary": false
}
'
{
  "url": "https://example.com",
  "title": "Example Domain",
  "snippet": "# Example Domain\n\nThis domain is for use in documentation examples...",
  "cost": 0.0005,
  "remaining_credits": 3
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
url
string<uri>
required

The URL to fetch and convert

Example:

"https://example.com"

max_tokens
integer

Maximum tokens to include in response

Example:

2000

summary
boolean
default:false

Generate AI-powered summary

Response

Successful response

url
string

The fetched URL (may differ due to redirects)

title
string

Page title

snippet
string

Page content in markdown format

cost
number

API call cost in dollars

remaining_credits
number

Your remaining API credits