extract_links
Extract all hyperlinks from a URL or raw HTML, returning link details like href, text, and type. Useful for discovering pages and anchors before fetching them.
Instructions
Extract all hyperlinks from a URL (or raw HTML). Returns array of {href, text, title, section, isExternal, hash, type} grouped to dedupe. Great for discovering pages/anchors before fetching them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL to fetch and parse. Required unless 'html' is provided. | |
| html | No | Raw HTML to parse instead of fetching. If given, 'url' is used only as base for resolving relative links. | |
| limit | No | Max links to return. | |
| filter | No | Regex pattern; only links whose href or text match are returned. | |
| baseUrl | No | Base URL for resolving relative links when using 'html'. Defaults to 'url'. | |
| sameDomainOnly | No | Only return links on the same domain as the base URL. |