Skip to main content

Get your API key

Visit the HASP Dashboard to create an account and generate your API key.

Make your first API call

Fetch a webpage

curl -X POST https://api.hasp.sh/v1/fetch \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "url": "https://example.com"
  }'
Response:
{
  "url": "https://example.com",
  "title": "Example Domain",
  "snippet": "# Example Domain\n\nThis domain is for use in documentation examples without needing permission. Avoid use in operations.\n\n[Learn more](https://iana.org/domains/example)",
  "cost": 0.0005,
  "remaining_credits": 3
}

Search the web

curl -X POST https://api.hasp.sh/v1/search \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "queries": ["artificial intelligence news"],
    "limit": 10,
    "category": "news"
  }'

Next Steps