Skip to content
Fourohtwo

Use for a robust, outlier-resistant central value with weights ($0.10)

api.marketintelligenceapi.com/api/v1/analytics/weighted-median

Use for a robust, outlier-resistant central value with weights ($0.10): send observations {value, weight}; get the value where cumulative weight reaches half the total. Deterministic definition, exact ties take the midpoint; works on any numeric data you supply.

BasePolygonArbitrumSolanaWorld ChainBase SepoliaAnswering
POSThttps://api.marketintelligenceapi.com/api/v1/analytics/weighted-median

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain,
// inside the spending rules you set on Fourohtwo.
const pay = createPayer({ privateKey: process.env.AGENT_KEY });
const res = await pay("https://api.marketintelligenceapi.com/api/v1/analytics/weighted-median", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"observations":[{"value":10,"weight":1},{"value":20,"weight":5},{"value":100,"weight":1}]}),
});
console.log(await res.json());

Example input

{
  "observations": [
    {
      "value": 10,
      "weight": 1
    },
    {
      "value": 20,
      "weight": 5
    },
    {
      "value": 100,
      "weight": 1
    }
  ]
}

More from Market Intelligence API