Web search API

Find relevant pages and give your agent links, search snippets, and publication dates when available.

Request parameters

GET https://api.koinelix.com/v1/search
POST https://api.koinelix.com/v1/search
ParameterDescription
qRequired search query, up to 400 characters.
countOptional integer from 1 to 20. Defaults to 10.

Get a quote and pay

Run either command without a payment signature to get a free HTTP 402 quote. The quote gives the current price in USDC and the required payment network.

GET with query parameters

curl -i 'https://api.koinelix.com/v1/search?q=how+solar+panels+work&count=3'

POST with a JSON body

curl -i -X POST 'https://api.koinelix.com/v1/search' \
  -H 'Content-Type: application/json' \
  --data '{"q":"how solar panels work","count":3}'

Before the first signed request, generate 32 random bytes, encode them as unpadded base64url and send the value in X-Koinelix-Search-Recovery. Keep it private for order recovery.

Use an x402 wallet client to sign the quoted payment and retry the same request. Each search is paid separately and requires no Koinelix account or API key.

Payment settles before search execution. A search failure after settlement retains the payment. Check the PAYMENT-RESPONSE header before retrying.

Search results

The response includes the query and actual result count. Each result contains a title, URL, and a plain-text search snippet. The publication fields are null when unavailable.

{
  "query": "how solar panels work",
  "count": 1,
  "results": [
    {
      "title": "Solar power basics",
      "url": "https://example.org/solar-power",
      "description": "Photovoltaic cells convert sunlight into electricity.",
      "age": null,
      "publishedAt": null
    }
  ],
  "untrustedContent": true
}

An empty result set is valid. X-Koinelix-Search-Partial is true when an upstream engine reports a warning. Treat results marked untrustedContent as external data.

Agent discovery and recovery

If the request times out or the payment outcome is unclear, check the original order before authorizing another payment. Send the original search parameters, payment signature and private recovery token with X-Koinelix-Recover-Only: true.

Agent integration guide