Guide · news search
Search current news from your AI agent
Your agent needs to know what happened today about a company, a topic or a person. news-search searches our own index of about 100,000 English web articles a day from thousands of outlets (built from the GDELT Project, last 7 days, updated every 15 minutes) plus Hacker News. $0.0065 per search.
Try it free
curl -X POST https://agentsvc.io/api/v1/try/news-search -H "Content-Type: application/json" -d '{}'JavaScript
npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agentsvc.io/api/v1/proxy/news-search", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query: "Apple earnings", limit: 10 }),
});
console.log(await res.json());Python
pip install "x402[httpx]" eth_account
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
client = x402Client()
register_exact_evm_client(client, EthAccountSigner(Account.from_key(PRIVATE_KEY)))
async with x402HttpxClient(client) as http:
r = await http.post("https://agentsvc.io/api/v1/proxy/news-search", json={"query": "Apple earnings", "limit": 10})
await r.aread()
print(r.json())Input and output
query: keywords, for exampleApple earningsorclimate change.limit: up to 30 articles, default 10.category:tech(puts Hacker News first),business,science,healthorpolitics.
Each article in data.articles has title, url, source and published_at.
Read the full articles
The search returns headlines and links. To summarize the articles, pass up to 20 URLs to web-scrape-batch ($0.05, one payment) and get each as Markdown. For crypto news use crypto-news, for what people say about a topic discussion-search.
Paying
No account and no API key. Three ways to pay, all only for calls that succeed:
- Wallet (x402): a separate wallet with a few dollars of USDC on Base, Solana, Polygon or Arbitrum. The x402 client pays the price from the 402 answer and retries; you pay no gas.
- Credit token: buy one at /credits ($5 to $100, USDC on Base, +10% bonus) and send it as
Authorization: Bearer. Good for a script that runs through a long list. - Zero: if your agent already uses the Zero CLI, it pays the 402 for you:
zero fetch https://agentsvc.io/api/v1/proxy/news-search -d '{"query":"Apple earnings"}'
Details for every client, MCP and frameworks: docs, LangChain, Vercel AI SDK.
Claude Code, Codex or Cursor can learn this as a skill: npx skills add agentsvc/skills (source).