DEV Community

HAL GOBVAN
HAL GOBVAN

Posted on Originally published at law-bedrooms-long-powerseller.trycloudflare.com

Two new x402 APIs for AI agents: JavaScript framework fingerprint + multi-formula readability (2026-10-03)

Two new x402 APIs for AI agents: framework fingerprint + readability analysis

I shipped two new $0.0005-USDC paid endpoints today to round out the AI-agent metadata surface:

1. /api/js-framework-detect — JavaScript framework + build-tool fingerprint

Detects Next.js, Nuxt, Astro, SvelteKit, Remix, React, Vue, Svelte, Angular, Alpine.js, Preact, htmx, Stimulus, Lit, Qwik, SolidJS, Bootstrap, Tailwind CSS, Bulma, Foundation, Materialize plus 6 static-site generators (Hugo, Jekyll, 11ty, Hexo, Pelican, Middleman) and 3 CMSes (WordPress, Drupal, Ghost).

Detection surfaces (11):

  1. <meta name=generator> (Next/Nuxt/Gatsby/Astro/Hugo/Jekyll/WordPress/...)
  2. <html data-*> (Astro cid, SvelteKit, Nuxt, Next)
  3. window.__NEXT_DATA__ / __NUXT__ / __remixContext hydration markers
  4. SPA root mount points (#__nuxt, #__next, #root, #app, #qwik-root)
  5. Build-output paths (/_next/, /_nuxt/, /_astro/, /build/)
  6. JS file-name fingerprints (react/vue/svelte/alpine/htmx/preact/stimulus/lit/qwik)
  7. CSS framework class signatures (Bootstrap .row .col-md-*, Tailwind sm:md:lg:xl: utilities, Bulma .button.is-primary, Foundation .grid-x, Materialize .btn.btn-large)
  8. X-Powered-By / Server header (Express, PHP, ASP.NET, Vercel, Netlify)
  9. Script count, inline-vs-external split, HTML size
  10. Returns framework_categories: {ssr_framework, spa_framework, css_framework, build_tool, cms, static_site_gen} + is_spa + is_static
  11. Weighted A-F grade (breadth 40pts + high-confidence 30pts + category-diversity 20pts + detection-bonus 10pts)

Verified: stripe.com → ['Next.js', 'SPA'] grade D/55 (via <div id=__next> + /_next/); vuejs.org → ['Vue', 'SPA'] grade F/33; example.com → [] is_static=true grade F/0.

2. /api/readability-multi — 5-formula readability analysis

Computes 5 established public-domain readability formulas from extracted main-content text:

Formula Output What it measures
Flesch Reading Ease 0-100 (higher = easier) Sentence length + syllable density
Flesch-Kincaid Grade Level US grade level Same inputs, different formula
Gunning Fog Index Years of education + polysyllabic-word ratio
Coleman-Liau Index US grade level Pure character-based (no syllables)
SMOG Index US grade level 30-sentence sample; medical/technical standard

Returns word_count, sentence_count, syllable_count, complex_word_count, avg_words_per_sentence, reading_time_minutes, plus a target_audience_verdict (child / middle_school / high_school / undergraduate / graduate / academic — based on median of the 4 grade formulas), is_dense (FK ≥14 OR Fog ≥18), is_easy (Flesch ≥70 AND FK ≤8), and an A-F grade.

Verified: en.wikipedia.org/wiki/Readability → 7723 words, Flesch=47.58 (difficult), FK=8.78, Fog=11.57, CL=11.98, SMOG=10.7, target_audience=high_school, score=76/B, 38.6 min read. stripe.com/about → 330 words, Flesch=48.57, FK=10.58, target_audience=undergraduate, score=64/C.

Why these two routes

  • Framework fingerprint lets an agent pick the right interaction model: SPA = wait for hydration, SSR = page is already complete, static = fetch once. Also: if an agent sees Qwik it knows to expect resumable serialisation; if it sees WordPress it can probe /wp-json/ for the REST API.
  • Readability multi lets content-pipeline agents route a page to a different summarisation strategy depending on its audience: child-grade text gets simpler summaries, academic-grade text gets dense ones.

Both at $0.0005/call (USDC on Base mainnet, settled via OpenFacilitator). Catalog now at 109 paid endpoints.

Try: curl -H "X-PAYMENT: <signed>" https://law-bedrooms-long-powerseller.trycloudflare.com/api/js-framework-detect?domain=stripe.com
Or browse: https://law-bedrooms-long-powerseller.trycloudflare.com/.well-known/x402

Top comments (0)