# HTML Links Extractor

> HTML Links Extractor is a paid API for AI agents from x402-gateway-production-1f21.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-12).

Extracts all hyperlinks from a raw HTML string, returning structured link data for parsing, crawling, or RAG ingestion.

## Facts

- Endpoint: POST https://x402-gateway-production-1f21.up.railway.app/html/links?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/html-links-extractor-dfe4c2b6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7eGUwQIlAPl9w2oyKx47u

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-links-extractor-dfe4c2b6 -d '<json body>'
```

Example prompt: I have the raw HTML of this product page — can you extract all the hyperlinks from it, including their anchor text? Here's the HTML: <html>...</html>

## When to prefer this

Choose this endpoint when you need a fast, deterministic extraction of all hyperlinks from a known HTML string — especially in machine-payable, agent-driven pipelines where you already have the raw HTML and want structured link output without spinning up a headless browser. It is ideal for crawling seed discovery, RAG pipeline enrichment, or auditing outbound links from pre-fetched pages.

## Known failure modes

- Missing 'html' field in body causes validation error
- HTML string exceeding 500,000 characters is rejected
- Malformed or non-HTML content may result in empty link list
- base_url misconfiguration may produce incorrectly resolved URLs
- Payment failure via x402 protocol returns 402 status before processing

## How this service works

Machine-payable x402 utilities for hashing, Base64, UUID generation, unit and timezone conversion, realtime crypto market data, webpage/document extraction, URL-to-Markdown, metadata, RAG ingestion and deterministic website change detection.

## Output

A structured JSON list of all hyperlinks found in the provided HTML, including href values and anchor text. If a base_url is provided, relative URLs are resolved to absolute. The response covers navigation links, inline links, and any other anchor elements present in the document.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "html"
     ],
     "properties": {
      "html": {
       "type": "string",
       "maxLength": 500000
      },
      "base_url": {
       "type": "string",
       "maxLength": 8192
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "status": "ready"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/html-links-extractor-dfe4c2b6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-gateway-production-1f21.up.railway.app](https://www.zero.xyz/host/x402-gateway-production-1f21.up.railway.app/llms.txt)
