agentsvc.io

services / prediction-markets

financeoperational · 242 ms

Prediction Markets (Polymarket)

Live Polymarket prediction markets: outcome probabilities, 24h volume, liquidity, 24h price change and end date. Search by topic (query, e.g. 'bitcoin', 'election', 'fed rate') or omit query to get the markets with the highest 24h volume. Only open markets. Params: query (optional), limit (1 to 25, default 10).

Run free trial ↗3 free calls per day with the example input. Paid: $0.004 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/prediction-markets", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({"query":"bitcoin","limit":5}),
});
const { data, payment } = await res.json();  // payment.transaction = on-chain receipt

Input

FieldTypeDescription
querystringTopic to search, e.g. 'bitcoin' or 'election'. Omit for top markets by 24h volume.
limitinteger = 10

Output

FieldTypeDescription
sourcestring
querystring,null
countinteger
marketsarray
fetched_atstring

Example response (data)

{
  "source": "Polymarket",
  "query": "bitcoin",
  "count": 1,
  "markets": [
    {
      "question": "Will the price of Bitcoin be above $82,000 on October 6?",
      "event": "Bitcoin above ___ on October 6?",
      "outcomes": [
        {
          "name": "Yes",
          "probability": 0.9975
        },
        {
          "name": "No",
          "probability": 0.0025
        }
      ],
      "volume_24h_usd": 86277.68,
      "volume_total_usd": 129904.32,
      "liquidity_usd": 46546.4,
      "price_change_24h": 0.011,
      "end_date": "2026-10-06T16:00:00Z",
      "url": "https://polymarket.com/event/bitcoin-above-on-october-6-2026"
    }
  ],
  "fetched_at": "2026-10-06T12:00:00.000Z"
}