DEV Community

ihen404
ihen404

Posted on

Building Machine-Payable APIs: Introducing x402 Web Scraper on Base

AI agents need clean web data, but traditional subscriptions, credit cards, and API keys create major friction for autonomous programmatic workflows. Today, I am launching x402 Scraper API—a web extraction service built natively around the HTTP 402 Payment Required standard.

How It Works

Instead of managing accounts or API keys, client agents send a standard POST request with a target URL. The API responds with an HTTP 402 status code containing precise on-chain payment parameters:

  • Network: Base Mainnet
  • Asset: USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
  • Price: $0.005 USDC
  • Recipient Wallet: 0x391e20e3f938d9aa3b39c7f4aa1cb6cbd6a9df28

Once settled on-chain, the client resends the request with the transaction proof header (X-Payment) to receive structured JSON containing page titles, meta descriptions, headings, and clean body previews.

Quick Start & Verification

Test the endpoint via curl:


bash
curl -i -X POST [https://x402-scraper-api-production-67a4.up.railway.app/api/scrape](https://x402-scraper-api-production-67a4.up.railway.app/api/scrape) \
  -H "Content-Type: application/json" \
  -d '{"url":"[https://news.ycombinator.com](https://news.ycombinator.com)"}'

Built with Node.js, Express, and @x402/express on Base Mainnet.
Try it out on Railway or integrate it into your Model Context Protocol (MCP) agent workflows!

---

### 2. X (Twitter) Launch Post
Enter fullscreen mode Exit fullscreen mode

Top comments (0)