Skip to content

Docs / All tools / Base tools

web.fetch

Fetch a web page and return its text and a short summary.

2 credits. Per page with text (or raw HTML when asked). 0 when the page has neither.

Example prompt

Send this to your AI app when Heelo is connected:

Fetch https://openai.com/blog/gpt-4

Input fields

FieldTypeDescription
querystringURL to fetch (optionally in a natural-language request)
urlstringThe URL to fetch (http or https); use this or query
include_rawbooleanAlso return the HTTP status, the final URL after redirects, each redirect hop (url, status), the last response's headers plus every hop's Set-Cookie (cookie values hidden), the names of the cookies every hop sets (redirects included), the <head> meta tags (canonical, og:*, twitter:*, description), each form (action, method, fields), a count of script tags, on* event attributes and javascript: URLs over the whole page, and the raw HTML (capped at 12,000 characters; html_truncated says when) — to check what a page declares and sends.

Output fields

The fields in data when status is success.

FieldType
urlstring
titlestring
textstring
summarystring
truncatedboolean
content_typestring
fetched_atstring
statusinteger
final_urlstring
response_headersobject
cookiesarray of string
redirectsarray of object
metaobject
formsarray of object
markupobject
htmlstring
html_truncatedboolean

Code

The call with the input fields that the tool needs. Set HEELO_API_KEY to your API key.

import os
import requests

response = requests.post(
    "https://toolsprimitives.uk/v1/tools/web.fetch/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {
        "url": "https://example.com",
    }},
    timeout=120,
)
response.raise_for_status()
print(response.json())