Scraoe Agent

Scraoe Agent

posted Originally published at dev.to 2 min read

x402

agents

webdev

api
I'm a graphic designer. Not a developer.

AI has been eating into my design work, so instead
of fighting it, I decided to learn how to build
AI-native tools. This is my story of building my
first pay-per-use API using x402 — the new HTTP
payment standard from Coinbase.

What is x402?
x402 revives the long-forgotten HTTP 402 "Payment
Required" status code. Instead of subscriptions or
API keys, clients pay per request using USDC on Base.

The flow is simple:

Client calls your endpoint
Server returns 402 with payment instructions
Client pays $0.01 USDC on Base
Client retries with payment proof
Server returns the data
No accounts. No API keys. No subscriptions.

What I built
Scrape Agent — a pay-per-use web scraping API.

Send any URL, pay $0.01 USDC, get back clean text,
links, or HTML from that page.

Endpoint: https://scrapeagent.xyz/api/scrape/x402
Method: POST
Price: $0.01 USDC on Base

How to try it
Install agentcash (an x402 client):

npx agentcash fetch https://scrapeagent.xyz/api/scrape/x402 \
-m POST \
-b '{"url":"https://example.com","extract":"text"}'

You'll need a tiny amount of USDC on Base in your
agentcash wallet. The payment happens automatically.

The response you get back
{
"protocol": "x402",
"version": 2,
"priceUSD": "0.01",
"url": "https://example.com",
"status": "ok",
"title": "Example Domain",
"content": "This domain is for use in...",
"wordCount": 42,
"elapsed": 312
}

The tech stack
Vercel Edge Functions (serverless, fast)
x402 v2 protocol
USDC on Base mainnet
Zod for request validation
Zero dependencies for scraping (pure fetch + regex)
What I learned
Building this as a non-developer was challenging but
completely possible with AI assistance. The x402
protocol is surprisingly elegant — the hardest part
was getting the exact response format right.

The biggest insight: AI agents need data. Web
scraping is one of the most fundamental things any
agent needs to do. Pay-per-use makes perfect sense
for this use case — why pay a monthly subscription
when you only scrape occasionally?

What's next
I'm planning to build more agents:

Image alt-text generator ($0.02/image)
Brand color palette extractor ($0.02/scan)
Design feedback API ($0.25/critique)
If you're a developer interested in the x402
ecosystem, check out x402.org to learn more.

And if you want to try my scraping agent:
https://scrapeagent.xyz

Would love feedback from the developer community —
especially on pricing and use cases I might be
missing!

More Posts

Merancang Backend Bisnis ISP: API Pelanggan, Paket Internet, Invoice, dan Tiket Support

Masbadar - Mar 13

TypeScript Complexity Has Finally Reached the Point of Total Absurdity

Karol Modelskiverified - Apr 23

I’m a Senior Dev and I’ve Forgotten How to Think Without a Prompt

Karol Modelskiverified - Mar 19

Sovereign Intelligence: The Complete 25,000 Word Blueprint (Download)

Pocket Portfolioverified - Apr 1

How I Built a React Portfolio in 7 Days That Landed ₹1.2L in Freelance Work

Dharanidharan - Feb 9
chevron_left

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!