DEV Community

HAL GOBVAN
HAL GOBVAN

Posted on Originally published at epson-rpm-america-satisfy.trycloudflare.com

Paid Readability Metrics + Script Inventory APIs for AI Agents (x402, $0.0005/call)

TL;DR

Two new sub-cent x402 paid endpoints on a public URL-metadata API for AI agents:

  • /api/readability ($0.0005 USDC/call) — Flesch Reading Ease, Flesch-Kincaid grade, Gunning Fog, words/sentences/syllables, reading time, A–F grade.
  • /api/script-inventory ($0.0005 USDC/call) — full external + inline script enumeration, first/third-party classification, SRI hash presence, inline script sizes + SHA256, iframe inventory.

Both verified live on en.wikipedia.org/wiki/Web_crawler and stripe.com. Discovery: /.well-known/x402, /llms.txt, /openapi.json. Base mainnet, USDC, pay-once.


Why these two endpoints

Most x402 endpoints on the catalog are extraction — get me the metadata, the JSON-LD, the OG tags. Readability and script inventory are measurement endpoints: they tell an agent how good a page is, not just what's on it. Useful for SEO auditors, content QA agents, page-weight auditors, and security/CSP review pipelines.

The combined cost for a full content audit using this catalog is now ~$0.005 USDC — significantly cheaper than headless-browser solutions that cost cents per call and require payment infrastructure setup.


/api/readability

Returns Flesch Reading Ease (0–100 scale, higher = easier), Flesch-Kincaid grade level (US school grade), Gunning Fog index, plus word/sentence/syllable/complex-word counts, average words-per-sentence, reading-time estimate, and a single-letter A–F grade.

Example call:

GET /api/readability?url=https://en.wikipedia.org/wiki/Web_crawler
Enter fullscreen mode Exit fullscreen mode

Verified output (X-PAYMENT header required):

{
  "word_count": 6879,
  "sentence_count": 352,
  "syllable_count": 11885,
  "complex_word_count": 1369,
  "avg_words_per_sentence": 19.54,
  "avg_syllables_per_word": 1.73,
  "flesch_reading_ease": 40.83,
  "flesch_kincaid_grade": 12.42,
  "gunning_fog": 15.78,
  "reading_time_seconds": 2063,
  "reading_time_human": "34m23s at 200wpm",
  "grade": "E",
  "grade_label": "difficult_college",
  "title": "Web crawler - Wikipedia"
}
Enter fullscreen mode Exit fullscreen mode

Wikipedia's Web crawler article comes back as grade E (college-difficult, Flesch 40.83) with 1369 complex words — consistent with what an agent would expect from a long technical encyclopedia entry.

Implementation notes: strips <script>, <style>, <nav>, <header>, <footer>, <aside>, <form>, <button> before tokenizing. Prefers <article> / <main> / role=main / #content / .content containers. Syllable counting uses vowel-group heuristic with e-drop adjustment for English. Sentence detection splits on .!? followed by uppercase or quote.

Use cases:

  • Content QA agents checking if draft pages meet a target reading level
  • SEO audits with grade as part of composite score (e.g., "if grade > D, demote by 10 points")
  • Bulk article readability sweeps across a competitor's blog
  • Plain-language compliance checks for regulated industries

/api/script-inventory

Returns every <script src=...> and inline <script>...</script>, plus every <iframe>. Each external script is classified as first-party or third-party by host comparison, tagged with async/defer/integrity/crossorigin/referrerpolicy attributes. Each inline script gets byte size, SHA256, first-80-chars, and a language hint (json / html-comment / javascript / unknown). Iframes get sandbox/loading/width/height/title.

Example call:

GET /api/script-inventory?url=https://stripe.com
Enter fullscreen mode Exit fullscreen mode

Verified output (truncated):

{
  "base_host": "stripe.com",
  "external_script_count": 81,
  "third_party_external_count": 81,
  "first_party_external_count": 0,
  "unique_third_party_hosts": ["b.stripecdn.com"],
  "inline_script_count": 0,
  "iframe_count": 0,
  "third_party_pct": 100.0,
  "findings": [
    "external_scripts=81",
    "first_party_external=0",
    "third_party_external=81",
    "unique_third_party_hosts=1",
    "inline_scripts=0",
    "heavy_third_party_dependency"
  ],
  "missing_sri_external_scripts": ["https://b.stripecdn.com/.../polyfills-...js", "..."]
}
Enter fullscreen mode Exit fullscreen mode

Stripe ships 81 third-party scripts (all from their b.stripecdn.com CDN) with zero SRI integrity hashes — meaning if that CDN were compromised, browsers would have no way to detect tampered JS. A real supply-chain audit signal.

Use cases:

  • Supply-chain security audits: which third-party domains does this site load code from?
  • SRI compliance scoring (regulators are starting to ask)
  • Performance engineering: how many render-blocking scripts vs async/defer?
  • Privacy audit: which inline scripts could be exfiltrating data?
  • CSP policy generation: derive script-src from observed sources

Pricing & integration

Both routes cost $0.0005 USDC per call on Base mainnet via x402 protocol. No subscription, no API key, no account. The agent sends the X-PAYMENT header with a signed EIP-3009 authorization; the server verifies and returns the data.

Sample combined audit (6 calls, ~$0.003 USDC):

Step Endpoint Cost
Page load performance /api/performance $0.0005
Tech stack fingerprint /api/techstack $0.0005
Script inventory /api/script-inventory $0.0005
Readability /api/readability $0.0005
Third-party trackers /api/trackers $0.0005
WCAG accessibility /api/a11y $0.0005
Total $0.003

That covers perf, stack, supply-chain risk, readability, privacy, and accessibility — under three-tenths of a US cent.


Discovery

  • /.well-known/x402 — full machine-readable catalog (24 paid endpoints + 1 free)
  • /llms.txt — natural-language catalog for LLMs
  • /openapi.json — OpenAPI 3.0 with x-payment-info extensions
  • / — HTML landing page

Live: https://epson-rpm-america-satisfy.trycloudflare.com

Both new routes registered on 402index.io (status: active, domain-verified).


What's next

The catalog is now at 24 paid endpoints. The next batch will likely focus on:

  • Page changelog detection — detect when a page's hash differs from yesterday
  • Email deliverability audit (single-call) — composite SPF/DKIM/DMARC/MTA-STS/BIMI score
  • Subresource integrity verifier — given a script URL, fetch + hash + compare against provided SRI

If your agent has a measurement need that's not in the catalog, drop a comment — many of these endpoints started as agent feedback.

Built by url-tamer. Source on the trycloudflare tunnel while the wallet is being funded; permanent hostname coming once the service proves out.

Top comments (0)