Turn AI scrapers into revenue. HTTP 402 + autonomous payments. Publishers keep 100%.
ScraperKast is the first payment infrastructure enabling publishers to monetize AI agent traffic through HTTP 402, autonomous on-chain payments, and multi-token support.
THE PROBLEM: Over 200 AI bots (GPTBot, ClaudeBot, Perplexity, etc.) scrape millions of pages daily for training data. Publishers pay infrastructure costs but earn nothing from bot traffic. Traditional paywalls don't work - agents can't fill forms or complete OAuth flows.
THE SOLUTION: ScraperKast implements HTTP 402 Payment Required responses with embedded autonomous payment instructions. When an AI agent requests content:
TECHNICAL IMPLEMENTATION:
KeeperHub x402 Protocol: Complete implementation of autonomous payment instructions with on-chain verification. Agents receive exact payment parameters (amount, recipient, token address, network) and execute payments without human intervention.
Uniswap V3 Integration: Publishers accept ANY token through deployed liquidity pools. Agents pay in WETH, DAI, or ETH - Uniswap automatically converts to USDC. We deployed a working WETH/USDC pool on Base Sepolia with real liquidity.
Smart Wallet System: Auto-generated deterministic wallets per publisher with AES-256 encryption. Revenue flows directly to publisher-controlled addresses.
Real-time Analytics: Dashboard tracks bot activity, payment methods, revenue per bot, and provides blockchain transaction proofs.
One-line Integration: Publishers add middleware to existing infrastructure - no architecture changes required.
LIVE DEMOS: Both payment methods work end-to-end on Base Sepolia:
This is the future of agent-to-agent commerce: autonomous, trustless, multi-token, zero-friction payments.
ARCHITECTURE:
ScraperKast is built as a Next.js 14 monorepo with Turborepo, featuring three main components:
KEEPERHUB x402 INTEGRATION:
We implemented the complete x402 protocol specification:
HTTP 402 Response Handler: Custom Next.js middleware intercepts requests from detected bots (via User-Agent parsing) and returns structured payment instructions in JSON format.
Payment Instruction Schema: Each 402 response contains multiple payment options with exact parameters - token addresses, amounts in wei, recipient addresses, network identifiers, and deadline timestamps.
On-chain Verification: When agents retry with X-Payment-Proof headers, we fetch transaction receipts via viem publicClient, verify recipient/amount/token match payment instructions, and confirm block confirmations before releasing content.
Multi-signature Support: Infrastructure supports multiple payment methods (direct transfers, smart contract calls, batch transactions) enabling flexible integration patterns.
The x402 implementation handles edge cases like partial payments, expired deadlines, wrong networks, and provides detailed error responses for debugging.
UNISWAP V3 INTEGRATION:
Complete multi-token payment support through Uniswap V3:
Deployed Liquidity Pool: Created WETH/USDC pool on Base Sepolia (address: 0x2B9a559E491d26e142a712C36616c564c7d366a1) with 0.05% fee tier. Added real liquidity (0.001 WETH + 3.5 USDC) to enable swaps.
Dynamic Quote Generation: Payment instructions include real-time Uniswap quotes showing estimated WETH/ETH amounts needed to receive exact USDC output.
SwapRouter02 Integration: Agents execute exactOutputSingle swaps that deliver precise USDC amounts directly to publisher wallets. Used SwapRouter02 (0x94cC0AaC535CCDB3C01d6787D6413C739ae12bc4) for optimal gas efficiency.
18-decimal USDC Handling: Base Sepolia USDC uses 18 decimals (non-standard). We implemented proper decimal conversion throughout the stack - from sqrtPriceX96 calculations in pool initialization to amount parsing in swap execution.
Transaction Verification: Server detects swap transactions via event log parsing, verifies Uniswap swap events, confirms USDC output amounts, and validates recipient addresses match expected values.
TECHNICAL CHALLENGES & SOLUTIONS:
USDC Decimal Mismatch: Base Sepolia USDC has 18 decimals vs standard 6. Required updates across create-pool.js, add-liquidity.js, agent scripts, and verification endpoints.
SwapRouter Version Compatibility: Initial implementation used SwapRouter v1 ABI with deadline parameter. Base Sepolia uses SwapRouter02 which removed per-call deadlines. Fixed by removing deadline field from ABI.
Supabase/Prisma ID Mismatch: Supabase auth returns UUIDs, Prisma uses CUIDs. Caused user lookup failures. Solution: always query users by email (consistent across systems) rather than ID.
Pool Initialization Math: Calculated correct sqrtPriceX96 for 1 WETH = 3500 USDC accounting for 18-decimal USDC: sqrt(3500 * 10^18 / 10^18) * 2^96 = 1.339e27.
TECH STACK:
AUTONOMOUS AGENT IMPLEMENTATION:
Built two reference agent implementations showing different payment strategies:
agent.js (x402 direct): Detects 402 responses, parses payment instructions, executes USDC transfers via ERC20 approve+transfer, includes payment proof in retry headers.
agent-uniswap.js (multi-token): Detects Uniswap payment options, approves WETH spend, calls exactOutputSingle with calculated max input amounts, handles slippage tolerance.
Both agents use viem walletClient for transaction signing and publicClient for receipt confirmation.
PRODUCTION-READY FEATURES:
PARTICULARLY HACKY/NOTABLE:
We deployed a real Uniswap V3 pool on testnet from scratch - created pool via Factory, initialized with correct sqrtPriceX96, added liquidity via NonfungiblePositionManager. Most testnet demos use existing pools; we proved the full deployment flow.
The payment verification endpoint handles BOTH direct transfers AND Uniswap swaps by parsing transaction logs and detecting event signatures. Single endpoint supports multiple payment methods transparently.
User preferences determine which payment method displays first in 402 responses - high-value publishers might prefer stable USDC, while crypto-native publishers optimize for maximum token variety.
This project demonstrates that autonomous agent payments are not just possible but practical and ready for production deployment. The infrastructure scales to support thousands of bots paying millions of publishers with full blockchain transparency.

