agentsvc.io

services / web-search

weboperational · 457 ms

Web Search

Search for factual information via DuckDuckGo + Wikipedia. Returns heading, abstract (plain-language summary), abstract_url, and results (list of relevant links). Best for: people, places, concepts, history, science. NOT for breaking news — use news-search instead.

Run free trial ↗3 free calls per day with the example input. Paid: $0.003 USDC, no limit.

Call it

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/web-search", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"query":"x402 payment protocol"}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
query *stringSearch query string (e.g. 'current Bitcoin price', 'capital of France', 'Next.js 15 release date')

Output

FieldTypeDescription
querystringThe original search query
headingstringTopic heading from the search engine
abstractstringConcise abstract/summary about the topic (from Wikipedia or similar source)
abstract_urlstringSource URL for the abstract
abstract_sourcestringName of the abstract source (e.g. 'Wikipedia')
resultsarrayRelated search results with URLs
answerstringDirect answer for calculation or fact queries (e.g. '42' for math, '23°C' for temperatures)

Example response (data)

{
  "query": "capital of France",
  "heading": "Paris",
  "abstract": "Paris is the capital and most populous city of France. With an official estimated population of 2,102,650 residents as of 1 January 2023 in an area of more than 105 km²...",
  "abstract_url": "https://en.wikipedia.org/wiki/Paris",
  "abstract_source": "Wikipedia",
  "results": [
    {
      "text": "Paris — Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Paris"
    },
    {
      "text": "Visit Paris — Official Tourism Site",
      "url": "https://www.parisinfo.com/"
    }
  ],
  "answer": ""
}