# x402 Web Tools

> Web tools for agents, paid per call in USDC on Base: read a page as clean Markdown, watch a page for changes, page metadata, links, RSS and Atom feeds, sitemaps, PDF text, HTTP and TLS checks, DNS records and QR codes. Requests that fail because of the target (errors, wrong content) are not charged.

Paid per call over x402 in USDC (eip155:8453); no account or API key. Every endpoint is a GET with query parameters. Use /v1/read to read a page, /v1/watch to see what changed since your last check, /v1/pdf-text for PDFs. A 422 answer means the target could not be read; no payment is settled for it.

## Endpoints

### GET https://web.kagurazaka.dev/v1/read ($0.002 USDC)

Fetch a public web page and return its main content as clean Markdown (Mozilla Readability, as in Firefox Reader View, then Markdown with absolute links and tables), with title, byline, site name, published date, language, excerpt and a token estimate. Navigation, ads and footers are left out. Pages that cannot be read (errors, not HTML) are not charged.

Input (query parameters):
  - `url` (string, required): https URL of the page
  - `max_chars` (integer): cut the Markdown at this many characters (1000-200000, default 50000)

Example input:

```json
{"url":"https://en.wikipedia.org/wiki/HTTP_402"}
```

### GET https://web.kagurazaka.dev/v1/watch ($0.003 USDC)

Check a web page for changes: each call compares the page's readable text with your previous check of the same URL (kept per paying wallet for 90 days) and returns whether it changed, when you last checked, and the added and removed lines. The first call records the page. Use name to keep several watches of one URL apart.

Input (query parameters):
  - `url` (string, required): https URL of the page
  - `name` (string): optional name to keep separate watches of the same URL (up to 64 characters)

Example input:

```json
{"url":"https://www.x402.org/"}
```

### GET https://web.kagurazaka.dev/v1/metadata ($0.001 USDC)

Title, description, canonical URL, language, author, published and modified dates, favicon, RSS and Atom feeds, Open Graph and Twitter card tags, JSON-LD structured data and the h1/h2 outline of a public web page.

Input (query parameters):
  - `url` (string, required): https URL of the page

Example input:

```json
{"url":"https://www.x402.org/"}
```

### GET https://web.kagurazaka.dev/v1/links ($0.001 USDC)

Every distinct link on a public web page as absolute URLs with their anchor text, marked internal or external and nofollow, up to 500.

Input (query parameters):
  - `url` (string, required): https URL of the page
  - `only` (string): which links to return (default all)

Example input:

```json
{"url":"https://www.x402.org/","only":"external"}
```

### GET https://web.kagurazaka.dev/v1/feed ($0.001 USDC)

The items of an RSS, Atom or RDF feed as JSON (title, link, id, published date, author, plain-text summary). Given a web page instead of a feed, it finds the feed the page links to.

Input (query parameters):
  - `url` (string, required): https URL of the feed, or of a page that links to one
  - `limit` (integer): how many items (1-100, default 20)

Example input:

```json
{"url":"https://blog.cloudflare.com/rss/","limit":5}
```

### GET https://web.kagurazaka.dev/v1/sitemap ($0.001 USDC)

The URLs a sitemap lists, with last modified dates, or the sitemaps a sitemap index lists. Given a site instead of a sitemap, it finds the sitemap from robots.txt or /sitemap.xml. Gzipped sitemaps are read too.

Input (query parameters):
  - `url` (string, required): https URL of a sitemap, or of the site
  - `limit` (integer): how many URLs (1-1000, default 200)

Example input:

```json
{"url":"https://www.cloudflare.com/"}
```

### GET https://web.kagurazaka.dev/v1/pdf-text ($0.003 USDC)

Extract the text of a PDF at a public URL, page by page, with its title, author and page count. Up to 10 MB; scanned PDFs without a text layer return little text.

Input (query parameters):
  - `url` (string, required): https URL of the PDF
  - `max_pages` (integer): pages to return (1-200, default 50)
  - `max_chars` (integer): characters to return in all (1000-500000, default 100000)

Example input:

```json
{"url":"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"}
```

### GET https://web.kagurazaka.dev/v1/http-check ($0.001 USDC)

Request an https URL and report whether it is reachable, its status, every redirect hop with timings, key and security headers (HSTS, CSP and others), and the TLS certificate with its issuer, the names it covers and the days until it expires. An unreachable URL is a result too, with the reason.

Input (query parameters):
  - `url` (string, required): https URL of the page

Example input:

```json
{"url":"https://x402.org"}
```

### GET https://web.kagurazaka.dev/v1/dns ($0.001 USDC)

A, AAAA, CNAME, MX, TXT, NS, CAA and SOA records of a domain from public resolvers (Cloudflare and Google), or just the types you ask for, and whether the domain exists.

Input (query parameters):
  - `name` (string, required): domain name, such as example.com
  - `types` (string): comma separated record types (default all of A, AAAA, CNAME, MX, TXT, NS, CAA, SOA)

Example input:

```json
{"name":"x402.org","types":"A,MX,TXT"}
```

### GET https://web.kagurazaka.dev/v1/qr ($0.001 USDC)

Encode text or a URL as a QR code: PNG (base64 and a data URL) or SVG, with the size and error correction level you choose.

Input (query parameters):
  - `text` (string, required): what to encode (up to 2000 characters)
  - `size` (integer): width in pixels (64-1024, default 300)
  - `level` (string): error correction level (default M)
  - `format` (string): image format (default png)

Example input:

```json
{"text":"https://www.x402.org/","size":300}
```

## Discovery

- OpenAPI: https://web.kagurazaka.dev/openapi.json
- x402 resources: https://web.kagurazaka.dev/.well-known/x402
