# x402 Data API > Version: 4.1.0 (updated 2026-11-16) > AI-agent data enrichment — 11 paid tools. Pay per query with x402 (USDC on Base) or Stripe MPP. > All paid endpoints: POST with a JSON body. Unpaid requests return HTTP 402. ## Quick Start — Python (pip install "x402[httpx]" eth-account) ```python import asyncio, os, httpx from eth_account import Account from x402 import x402Client from x402.mechanisms.evm.exact import register_exact_evm_client from x402.http.clients import x402_httpx_transport client = x402Client() register_exact_evm_client(client, Account.from_key(os.environ["PRIVATE_KEY"])) # USDC on Base, 0 ETH needed async def main(): async with httpx.AsyncClient(transport=x402_httpx_transport(client), timeout=60) as http: r = await http.post("https://apix402data.com/api/search", json={"q": "AI agents", "limit": 5, "fields": ["title", "url", "enrichment.sentiment"]}) print(r.status_code, r.json()) asyncio.run(main()) ``` ## Quick Start — Node.js (npm i @x402/fetch @x402/core @x402/evm viem) ```js import { wrapFetchWithPayment } from "@x402/fetch"; import { x402Client } from "@x402/core/client"; import { registerExactEvmScheme } from "@x402/evm/exact/client"; import { privateKeyToAccount } from "viem/accounts"; const client = new x402Client(); registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.PRIVATE_KEY) }); const fetchWithPayment = wrapFetchWithPayment(fetch, client); const res = await fetchWithPayment("https://apix402data.com/api/search", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ q: "AI agents", limit: 5 }), }); console.log(res.status, await res.json()); ``` ## Request options - Every /api/* JSON response includes "schema_version": "1.0" and "cached": bool, plus an X-Response-Time-Ms header. - "fields": ["title","url","enrichment.sentiment"] on /api/search, /api/news and /api/company. - Batch: "queries": [...] on /api/search and "tickers": [...] on /api/company (max 5, priced unit price x count). - "timeout_ms": N on LLM endpoints returns fast with "degraded": true (/api/ai/summarize returns 504 and is not charged). - Idempotency-Key: header: a retry within 15 minutes returns the stored response without a second charge. - A replayed EIP-3009 payment nonce returns 409 Conflict. ## Paid Tools (11) — POST with a JSON body - POST /api/clean-url {"url": "https://www.sec.gov/edgar/searchedgar/companysearch"} ($0.001) Fetch any public HTTPS webpage with SSRF protection, strip navigation/ad boilerplate, and return clean LLM-ready Markdown, word count, and extracted entities as JSON. keys: markdown, word_count, entities[], sentiment, sentiment_score, nlp_method, summary.headline, summary.summary - POST /api/company {"ticker": "NVDA", "include_news": true} ($0.001) Look up public company financials, CIK, recent SEC EDGAR filings (10-K/10-Q/8-K), and recent news sentiment by stock ticker (supports up to 5 batched tickers). keys: results[].ticker, company_name, cik, sic_description, recent_filings[], sentiment, entities[], news[] - POST /api/crypto/news {"asset": "USDC", "limit": 5} ($0.001) Get real-time cryptocurrency and DeFi news headlines enriched with per-article sentiment scores and mentioned token tickers in structured JSON. keys: results[].title, url, sentiment, mentioned_tickers[], sentiment.distribution, sentiment.dominant, mentioned_tickers[].ticker, mentioned_tickers[].count - POST /api/news {"topic": "artificial intelligence regulation", "limit": 5} ($0.001) Fetch real-time breaking news headlines and articles by topic or keyword with automated sentiment polarity and extracted named entities in structured JSON. keys: results[].title, url, source, category, published_at, summary, sentiment, entities[] - POST /api/search {"query": "Base x402 ecosystem adoption", "limit": 5, "fields": ["title", "url", "snippet"]} ($0.001) Search live web and news articles by query (or up to 5 batched queries) via Google News RSS and web indexes. Returns structured titles, URLs, snippets, and source metadata as JSON. keys: results[].title, url, snippet, enrichment.relevance_score, enrichment.sentiment, enrichment.entities[], enrichment.key_takeaway - POST /api/security/preflight-402 {"url": "https://apix402data.com/api/search", "max_acceptable_usd": 0.05, "deep_audit": false} ($0.001) Pre-flight x402 endpoint security firewall. Probes any x402 URL before payment to detect wallet-drain price spikes, SIWx origin spoofing, fake USDC contracts, and prompt injections. keys: safe_to_pay, risk_level, risk_score, quoted_price_usd, network, pay_to, checks.*, warnings[] - POST /api/trends {"seed": "AI agents", "limit": 10} ($0.001) Retrieve trending search queries, rising autocomplete topics, and live technology/market momentum signals from Google Suggest and Hacker News in JSON. keys: trends[].topic, trends[].mentions, trends[].sentiment_distribution, trends[].dominant_sentiment - POST /api/topic-briefing {"topic": "stablecoin machine payments", "max_articles": 8} ($0.02) Generate an executive intelligence briefing on any topic combining multi-source Google News RSS coverage, key entities, sentiment breakdown, and local LLM synthesis. keys: briefing.summary, briefing.key_entities[], briefing.key_developments[], briefing.sentiment, briefing.confidence, degraded - POST /api/ai/summarize {"text": "Paste article or document text here...", "max_bullets": 5} ($0.03) Compress long articles, transcripts, or raw text into concise bulleted takeaways, key entities, and sentiment using local GPU inference with zero cloud data leakage. keys: result.summary, result.key_points[], result.entities[], result.sentiment, result.tags[] - POST /api/company/compare {"tickers": ["NVDA", "AMD", "MSFT"]} ($0.03) Compare 2 to 5 public companies side-by-side using live SEC EDGAR financial metrics, filing activity, and recent news sentiment in a normalized JSON matrix. keys: companies[], comparison.comparison_summary, comparison.sector_overlap, comparison.key_differences[], comparison.relative_size - POST /api/research/bundle {"query": "Coinbase Base USDC volume", "ticker": "COIN", "url": "https://en.wikipedia.org/wiki/USD_Coin"} ($1.00) Composite executive research dossier (Stripe card-eligible). Runs web search, breaking news, SEC company intelligence, and optional URL extraction in parallel in one call. keys: search.results[], news.results[], company, page.clean_text, synthesis.summary, synthesis.key_findings[], sources_used ## Payment (two rails) - x402: 402 carries PAYMENT-REQUIRED (base64 JSON, USDC on Base eip155:8453). Retry with PAYMENT-SIGNATURE or X-PAYMENT. Receipt: PAYMENT-RESPONSE. - Stripe MPP (routes >= $0.01, when the 402 includes it): WWW-Authenticate: Payment challenge. Retry with Authorization: Payment . Receipt: Payment-Receipt. ## Free Preview Endpoints (zero cost, validate before paying) - GET /api/search/check?q= — Data availability, result count, field list - GET /api/company/check?ticker= — Ticker validation + full tracked ticker and sector list - GET /api/news/check?category=&q= — News availability + valid categories - GET /api/clean-url/check?url= — URL validation (SSRF check), cache status - GET /api/security/preflight-402/check?url= — Pre-flight target validation (https + SSRF), last scan ## Free Discovery - GET / — Service discovery (JSON for agents, HTML for browsers) - GET /health — Health check + data coverage stats - GET /pricing — Prices, payment rails, valid categories/tickers/topics - GET /llms.txt — This file - GET /openapi.json — Full OpenAPI spec - GET /.well-known/mcp.json — MCP tool manifest ## MCP Config (paste into Claude Desktop / Cursor) ```json { "mcpServers": { "x402-data-api": { "url": "https://apix402data.com/.well-known/mcp.json", "transport": "http", "payment": {"protocol": "x402", "network": "eip155:8453", "asset": "USDC"} } } } ```