{"uid":"cap_2qPeYPepl3uU1cReuAYCv","slug":"agent402-tools-html-link-extractor-b9e04198","name":"agent402.tools HTML Link Extractor","description":"Enumerate every <a href> in an HTML string with its anchor text and rel attribute. Optionally resolves relative hrefs against a base URL and filters by a regex on the href. The deterministic way to crawl a page's outlinks without writing a regex.","url":"https://agent402.tools/api/html-links","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"base":{"type":"string","description":"Optional base URL to resolve relative hrefs against"},"html":{"type":"string","description":"Raw HTML string to scan (max 5MB)"},"limit":{"type":"number","description":"Max links to return, 1-1000 (default 200)"},"filter":{"type":"string","description":"Optional regex applied to the href - only matching links are returned"},"unique":{"type":"boolean","description":"Deduplicate by href (default true)"}}},"responseSchema":{"type":"json","example":{"count":2,"links":[{"rel":"","href":"https://agent402.tools/about","text":"About"},{"rel":"","href":"https://example.com/","text":"External"}]}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_wFkT6TwYsyzlP3Y7bP7fg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Enumerates all hyperlinks in an HTML string, returning each href, anchor text, and rel attribute, with optional base URL resolution and regex filtering.","exampleAgentPrompt":"Pull out every link from this HTML and resolve relative hrefs against https://example.com — only return links matching the regex ^https://example\\.com/blog, deduplicated, up to 100 results.","exampleUseCases":null,"resultDescription":"A list of up to 1000 unique hyperlinks found in the HTML, each with its resolved href, anchor text, and rel attribute value, filtered by any provided regex pattern.","failureModes":["HTML string exceeds 5MB limit — returns error","Invalid regex pattern in filter field — returns parse error","Malformed base URL — relative hrefs may not resolve correctly","limit out of range (not 1-1000) — returns validation error","Empty HTML string — returns empty link list"],"whenToPreferThis":"Use this endpoint when you have raw HTML and need a deterministic, structured list of all outlinks without writing custom regex or DOM parsing code. Ideal for crawling pipelines, link audits, or sitemap extraction where you need href, anchor text, and rel attributes together with optional filtering and relative URL resolution.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:54:03.274Z","isFirstParty":false}