x402 Payment-Gated Agent
SEO Gap Analysis
Agent
AI-powered SEO analysis agent. Pay $0.001 USDC per request with x402. Poll for status, fetch the report.
Agent Endpoints
1
Start Analysis
POSTSubmit a URL and keyword. Requires x402 payment ($0.50 USDC on Base Sepolia). Returns runId for status polling.
curl
curl -X POST "https://your-domain.com/api/workflows/seo-analysis" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","userId":"0xYourWalletAddress","targetKeyword":"web design agency"}'Endpoint
https://your-domain.com/api/workflows/seo-analysis
Request body (Step 1 only)
{
"url": "https://example.com",
"userId": "0xYourWalletAddress",
"targetKeyword": "web design agency"
}Response
{
"success": true,
"runId": "seo_1772369564721_6dji43bb4",
"message": "SEO analysis started"
}First request returns 402 Payment Required. Use purl (curl + payments) for automatic handling:
# Install: brew install stripe/purl/purl
# Add wallet: purl wallet add
purl -X POST "http://localhost:3000/api/workflows/seo-analysis" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","userId":"0xYourWallet","targetKeyword":"web design"}'2
Check Status
GETPoll this endpoint to check workflow progress. When status is "completed", fetch the report.
curl
curl "https://your-domain.com/api/report/seo_1772369564721_6dji43bb4/status"
Endpoint
https://your-domain.com/api/report/{runId}/statusResponse
{
"status": "analyzing",
"progress": 45,
"completedSteps": {
"userSiteData": true,
"discoveredKeywords": true,
"competitorData": false,
"patterns": false,
"gaps": false,
"recommendations": false,
"reportHtml": false
}
}Poll every 3–5 seconds. When status is "completed", call the report endpoint.
3
Fetch Report
GETRetrieve the full SEO report when status is "completed".
curl
curl "https://your-domain.com/api/report/seo_1772369564721_6dji43bb4"
Endpoint
https://your-domain.com/api/report/{runId}Response
{
"runId": "seo_1772369564721_6dji43bb4",
"status": "completed",
"userUrl": "https://example.com",
"score": 72,
"reportData": {},
"createdAt": "2026-03-01T12:00:00.000Z"
}Try it
Run an analysis from the browser. Sign in and pay with USDC on Base Sepolia.