82trust / 100

Html Select

by HTML select in Other

x402 APIPassing, checked 20 min ago

Run a CSS selector against an HTML string and return the matches (text, attrs, and optionally outerHTML for each). The deterministic alternative to regex when you already have the HTML and know the selector - pairs with /api/render or any page you've fetched yourself.

POST https://agent402.tools/api/html-select

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
199 ms typical, 199 ms slowest 5%
Last check
20 min ago
Next check
in 7 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://agent402.tools/api/html-select" \
  -H "content-type: application/json" \
  -d '{"html":"<html><body><h1>One</h1><h1>Two</h1></body></html>","limit":25,"selector":"h1"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fagent402.tools%2Fapi%2Fhtml-select
const res = await pay("https://agent402.tools/api/html-select", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"html":"<html><body><h1>One</h1><h1>Two</h1></body></html>","limit":25,"selector":"h1"}),
});
console.log(await res.json());

Example input

{
  "html": "<html><body><h1>One</h1><h1>Two</h1></body></html>",
  "limit": 25,
  "selector": "h1"
}

Example output

{
  "count": 2,
  "matches": [
    {
      "attrs": {},
      "text": "One"
    },
    {
      "attrs": {},
      "text": "Two"
    }
  ]
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
20 min agoPassed402945 ms$0.001
4 h agoPassed402185 ms$0.001
9 h agoPassed402199 ms$0.001