# HTML Link Extractor

> HTML Link Extractor is a paid API for AI agents from markup-tools.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-11-02).

Extracts all hyperlinks from supplied HTML, returning text, rel flags, absolute URLs, and internal/external classification

## Facts

- Endpoint: GET https://markup-tools.x402tookit.com/html-links?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/html-link-extractor-424cb1fe
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_GtdQ3MMMCnk-HzkCwR_W_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability html-link-extractor-424cb1fe
```

Example prompt: Can you extract all the links from this HTML and tell me which ones are internal vs external, and flag any that are nofollow or sponsored? Here's the HTML: <html><body><a href='/about' rel='nofollow'>About</a><a href='https://external.com'>Ext</a></body></html> — the base URL is https://mysite.com.

## When to prefer this

Choose this endpoint when you need a structured, machine-readable breakdown of all hyperlinks in a known HTML snippet — especially when you need rel-flag details (nofollow, ugc, sponsored), internal vs external classification, or absolute URL resolution against a known base. Prefer over a generic scraper when you already have the HTML content and need link-specific metadata rather than full page content extraction.

## Known failure modes

- HTML exceeds 20,000 characters — returns 400 error
- Missing required 'html' query parameter — returns 400
- Invalid or non-HTTP base URL causes relative links to remain unresolved
- Malformed HTML may cause incomplete link extraction
- Very large numbers of links may result in truncated response with truncated flag set to true

## How this service works

List all links in supplied HTML with text, rel flags, absolute URL (against a base) and internal/external split.

## Output

Returns a structured list of all links found in the HTML, each with: href (original), url (resolved absolute), text (anchor text), rel array, nofollow/ugc/sponsored boolean flags, scope (internal/external/fragment/non-http), hidden status, target, and title. Also includes aggregate counts by scope, total links, unique resolved URLs, the effective base URL used, and truncation/degraded status flags.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "html"
     ],
     "properties": {
      "base": {
       "type": "string",
       "description": "Absolute http(s) URL of the page, used to resolve relative links and judge internal vs external"
      },
      "html": {
       "type": "string",
       "description": "HTML to scan, up to 20000 characters (longer is refused with 400)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "links": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "rel": {
          "type": [
           "array",
           "null"
          ],
          "items": {
           "type": "string"
          }
         },
         "ugc": {
          "type": [
           "boolean",
           "null"
          ]
         },
         "url": {
          "type": [
           "null",
           "string"
          ]
         },
         "href": {
          "type": [
           "null",
           "string"
          ]
         },
         "text": {
          "type": [
           "null",
           "string"
          ]
         },
         "scope": {
          "type": [
           "null",
           "string"
          ]
         },
         "title": {},
         "hidden": {
          "type": [
           "boolean",
           "null"
          ]
         },
         "target": {},
         "nofollow": {
          "type": [
           "boolean",
           "null"
          ]
         },
         "sponsored": {
          "type": [
           "boolean",
           "null"
          ]
         }
        }
       }
      },
      "total": {
       "type": [
        "null",
        "number"
       ]
      },
      "counts": {
       "type": [
        "null",
        "object"
       ],
       "p
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/html-link-extractor-424cb1fe/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from markup-tools.x402tookit.com](https://www.zero.xyz/host/markup-tools.x402tookit.com/llms.txt)
