<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ihen404</title>
    <description>The latest articles on DEV Community by ihen404 (@ihen404).</description>
    <link>https://dev.to/ihen404</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4100679%2F247f990d-183e-4ba8-b4b2-5a2880d31a11.png</url>
      <title>DEV Community: ihen404</title>
      <link>https://dev.to/ihen404</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ihen404"/>
    <language>en</language>
    <item>
      <title>Building an Autonomous Web Scraper API Gated by x402 Micro-Payments on Base</title>
      <dc:creator>ihen404</dc:creator>
      <pubDate>Tue, 08 Sep 2026 18:58:11 +0000</pubDate>
      <link>https://dev.to/ihen404/building-an-autonomous-web-scraper-api-gated-by-x402-micro-payments-on-base-1jgo</link>
      <guid>https://dev.to/ihen404/building-an-autonomous-web-scraper-api-gated-by-x402-micro-payments-on-base-1jgo</guid>
      <description>&lt;p&gt;Autonomous AI agents need clean web data, but micro-subscriptions and API key signups create friction. To solve this, I built and deployed x402 Web Scraper API—a pay-per-request web scraping service gated by HTTP 402 Payment Required micro-payments on Base.&lt;/p&gt;

&lt;p&gt;Instead of managing accounts or monthly subscriptions, an AI agent requests scraped markdown directly, receives a 402 payment challenge for $0.005 USDC, settles on-chain via Base mainnet, and receives the structured data in a single flow.&lt;/p&gt;

&lt;p&gt;🛠️ How It Works&lt;br&gt;
Agent Requests Scrape: Sends a POST request to /api/scrape with a target URL.&lt;/p&gt;

&lt;p&gt;Server Challenges: The server returns HTTP 402 Payment Required with payment parameters (amount, recipient address, asset address, and chain).&lt;/p&gt;

&lt;p&gt;Agent Settles: The agent executes an on-chain transfer on Base Mainnet.&lt;/p&gt;

&lt;p&gt;Data Returned: Upon payment verification, the server returns LLM-ready content.&lt;/p&gt;

&lt;p&gt;🧪 Quick Start &amp;amp; Client Integration&lt;br&gt;
You can integrate this with your agent using the official client library:&lt;/p&gt;

&lt;p&gt;Bash&lt;br&gt;
npm install x402-scraper-client&lt;/p&gt;

&lt;p&gt;Here is a simple Node.js agent implementation intercepting the x402 payment flow:&lt;br&gt;
import fetch from "node-fetch";&lt;/p&gt;

&lt;p&gt;async function runAgent() {&lt;br&gt;
  const targetUrl = "&lt;a href="https://news.ycombinator.com" rel="noopener noreferrer"&gt;https://news.ycombinator.com&lt;/a&gt;";&lt;br&gt;
  console.log(&lt;code&gt;🤖 Agent requesting web scrape for: ${targetUrl}&lt;/code&gt;);&lt;/p&gt;

&lt;p&gt;const res = await fetch("&lt;a href="https://x402-scraper-api-production-67a4.up.railway.app/api/scrape" rel="noopener noreferrer"&gt;https://x402-scraper-api-production-67a4.up.railway.app/api/scrape&lt;/a&gt;", {&lt;br&gt;
    method: "POST",&lt;br&gt;
    headers: { "Content-Type": "application/json" },&lt;br&gt;
    body: JSON.stringify({ url: targetUrl })&lt;br&gt;
  });&lt;/p&gt;

&lt;p&gt;if (res.status === 402) {&lt;br&gt;
    const paymentReq = await res.json();&lt;br&gt;
    console.log("💰 x402 Payment Gate Triggered!");&lt;br&gt;
    console.log("   Protocol:", paymentReq.protocol);&lt;br&gt;
    console.log("   Network:", paymentReq.network);&lt;br&gt;
    console.log("   Asset:", paymentReq.asset);&lt;br&gt;
    console.log("   Amount:", paymentReq.amount, "units ($" + paymentReq.price_usd + " USD)");&lt;br&gt;
    console.log("   Recipient Wallet:", paymentReq.recipient);&lt;br&gt;
  } else {&lt;br&gt;
    const data = await res.json();&lt;br&gt;
    console.log("✅ Scraped Data:", data);&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;runAgent();&lt;/p&gt;

&lt;p&gt;🔗 Resources &amp;amp; Specs&lt;br&gt;
OpenAPI Spec: &lt;a href="https://x402-scraper-api-production-67a4.up.railway.app/openapi.json" rel="noopener noreferrer"&gt;https://x402-scraper-api-production-67a4.up.railway.app/openapi.json&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AI Plugin Manifest: &lt;a href="https://x402-scraper-api-production-67a4.up.railway.app/.well-known/ai-plugin.json" rel="noopener noreferrer"&gt;https://x402-scraper-api-production-67a4.up.railway.app/.well-known/ai-plugin.json&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub Repository: ihen404/x402-scraper-api&lt;/p&gt;

&lt;p&gt;I'd love to hear feedback or see what agent tools you're building with x402! Feel free to leave a comment or drop a PR on GitHub.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>ai</category>
      <category>web3</category>
    </item>
    <item>
      <title>Building Machine-Payable APIs: Introducing x402 Web Scraper on Base</title>
      <dc:creator>ihen404</dc:creator>
      <pubDate>Sat, 05 Sep 2026 20:01:20 +0000</pubDate>
      <link>https://dev.to/ihen404/building-machine-payable-apis-introducing-x402-web-scraper-on-base-168g</link>
      <guid>https://dev.to/ihen404/building-machine-payable-apis-introducing-x402-web-scraper-on-base-168g</guid>
      <description>&lt;p&gt;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 &lt;strong&gt;x402 Scraper API&lt;/strong&gt;—a web extraction service built natively around the HTTP 402 Payment Required standard.&lt;/p&gt;

&lt;h3&gt;
  
  
  How It Works
&lt;/h3&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Network:&lt;/strong&gt; Base Mainnet
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asset:&lt;/strong&gt; USDC (&lt;code&gt;0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&lt;/code&gt;)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Price:&lt;/strong&gt; $0.005 USDC
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recipient Wallet:&lt;/strong&gt; &lt;code&gt;0x391e20e3f938d9aa3b39c7f4aa1cb6cbd6a9df28&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h3&gt;
  
  
  Quick Start &amp;amp; Verification
&lt;/h3&gt;

&lt;p&gt;Test the endpoint via &lt;code&gt;curl&lt;/code&gt;:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>cryptocurrency</category>
      <category>express</category>
    </item>
    <item>
      <title>Monetize Express.js APIs for AI Agents in 3 Lines of Code with x402</title>
      <dc:creator>ihen404</dc:creator>
      <pubDate>Sat, 29 Aug 2026 19:15:50 +0000</pubDate>
      <link>https://dev.to/ihen404/monetize-expressjs-apis-for-ai-agents-in-3-lines-of-code-with-x402-4i0l</link>
      <guid>https://dev.to/ihen404/monetize-expressjs-apis-for-ai-agents-in-3-lines-of-code-with-x402-4i0l</guid>
      <description>&lt;p&gt;AI agents are increasingly making programmatic requests, but traditional billing (credit cards, OAuth, complex API keys) creates friction for automated microtransactions. &lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;x402-express&lt;/strong&gt;, you can monetize any Express.js endpoint using HTTP 402 payment requirements on Base in 3 lines of code.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Installation
&lt;/h3&gt;

&lt;p&gt;bash&lt;br&gt;
npm install x402-express&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Implementation
&lt;/h3&gt;

&lt;p&gt;Add the middleware to any route you want to protect:&lt;br&gt;
javascript&lt;br&gt;
const express = require('express');&lt;br&gt;
const { x402Middleware } = require('x402-express');&lt;/p&gt;

&lt;p&gt;const app = express();&lt;/p&gt;

&lt;p&gt;app.get('/api/agent-data', x402Middleware({ price: '0.01' }), (req, res) =&amp;gt; {&lt;br&gt;
res.json({ message: "Payment verified via x402!" });&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;app.listen(3000, () =&amp;gt; console.log('Server running on port 3000'));&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Verification &amp;amp; Registry
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/IkeHentrel/x402-express" rel="noopener noreferrer"&gt;github.com/IkeHentrel/x402-express&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP Registry:&lt;/strong&gt; &lt;code&gt;io.github.ihen404/x402-express&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When an unauthenticated agent hits your endpoint, &lt;code&gt;x402-express&lt;/code&gt; interceptively returns an &lt;code&gt;HTTP 402 Payment Required&lt;/code&gt; payload containing payment parameters, verifying settlements autonomously.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌐 Paid API Specification
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt; &lt;code&gt;POST https://your-deployed-app.up.railway.app/api/scrape&lt;/code&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Protocol:&lt;/strong&gt; &lt;code&gt;x402&lt;/code&gt; (HTTP 402 Payment Required)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Price:&lt;/strong&gt; &lt;code&gt;$0.02 USDC&lt;/code&gt; per request&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Network:&lt;/strong&gt; &lt;code&gt;Base&lt;/code&gt; (&lt;code&gt;chainId: 8453&lt;/code&gt;)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Asset Contract:&lt;/strong&gt; &lt;code&gt;0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913&lt;/code&gt; (USDC)&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Payout Address:&lt;/strong&gt; &lt;code&gt;YOUR_BASE_WALLET_ADDRESS&lt;/code&gt;  &lt;/p&gt;




&lt;h4&gt;
  
  
  1. Unauthenticated Request (HTTP 402 Challenge)
&lt;/h4&gt;

&lt;p&gt;Send a standard POST request without payment headers:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
bash
curl -i -X POST [https://your-deployed-app.up.railway.app/api/scrape](https://your-deployed-app.up.railway.app/api/scrape) \
  -H "Content-Type: application/json" \
  -d '{"url": "[https://news.ycombinator.com](https://news.ycombinator.com)"}'
Expected Response Header:
HTTP/1.1 402 Payment Required
X-Payment-Required: eyJzY2hlbWUiOiJleGFjdCIsInBheVRvIjoiMHhZT1V...
Paid Request (Machine-to-Machine via x402 Client)
AI agents using @ihentrel/x402-express or x402-fetch automatically parse the challenge header, sign a $0.02 USDC payment payload on Base, and retry:
import { fetchWithX402 } from 'x402-client';

const response = await fetchWithX402('[https://your-deployed-app.up.railway.app/api/scrape](https://your-deployed-app.up.railway.app/api/scrape)', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ url: '[https://news.ycombinator.com](https://news.ycombinator.com)' })
});

const data = await response.json();
console.log(data.markdown); // Returns clean Markdown ready for LLM context

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>web3</category>
      <category>express</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
