x402AgentTools

🧲CSS Selector Scraper

Fetch a web page server-side (SSRF-guarded) and return every element matching a CSS selector as structured JSON: text content, attributes and HTML. Deterministic extraction for agents that need specific parts of a page without reading the whole document.

🔌 Server-side tool

This tool runs on the server (it fetches third-party URLs directly and cannot run in your browser). Use the paid JSON API below — the worked examples show real server-side results and refresh automatically.

Worked examples

Live examples refresh automatically — call the API for guaranteed-fresh results.

Machine API (x402)

$0.005 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/dev/scrape-selector?url=https%3A%2F%2Fexample.com&selector=h1%2C%20h2&limit=10 HTTP/1.1
Host: localhost:3000

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "dev/scrape-selector",
  "input": {"url":"https://example.com","selector":"h1, h2","limit":10},
  "result": { "value": null, "answer": "" }
}

Agent docs: /llms.txt · OpenAPI spec · integration guide

About this tool

Point it at a page and a CSS selector and get back every matching element as structured JSON — text, attributes and HTML per element. Deterministic extraction for agents building structured views over web pages, with SSRF guarding and hard size caps.

Frequently asked questions

JavaScript-rendered content?

No — server-side fetches see served HTML only. Client-rendered elements are invisible to this tool.

Related tools