curl -X POST https://win.oneshotagent.com/v1/tools/benchmark \
-H "Content-Type: application/json" \
-H "payment-signature: <base64 x402 payment>" \
-d '{
"attribute": "vehicle_complaints",
"field": "total",
"peers": { "model_year": 2019 },
"key": "HONDA:CR-V:2019"
}'
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
const result = await agent.tool("benchmark", {
attribute: "vehicle_complaints",
field: "total",
peers: { model_year: 2019 },
key: "HONDA:CR-V:2019",
});
{
"success": true,
"data": {
"request_id": "6f1c2a94-0d1e-4b53-9d0e-2f6f0c1f7a11",
"status": "completed",
"tool": "benchmark",
"attribute": "vehicle_complaints",
"field": "total",
"peers": { "model_year": 2019 },
"source": null,
"count": 42,
"min": 0,
"p25": 6,
"median": 19,
"p75": 52.5,
"max": 311,
"as_of": "2026-09-30T12:00:00.000Z",
"coverage": "Vehicles sold in the United States",
"population": "looked_up",
"value": 37,
"percentile": 66.67
}
}
Research & Enrich
Benchmark
Where a value sits among its peers: count, quartiles, median and the place of an entity or a value
POST
/
v1
/
tools
/
benchmark
curl -X POST https://win.oneshotagent.com/v1/tools/benchmark \
-H "Content-Type: application/json" \
-H "payment-signature: <base64 x402 payment>" \
-d '{
"attribute": "vehicle_complaints",
"field": "total",
"peers": { "model_year": 2019 },
"key": "HONDA:CR-V:2019"
}'
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
const result = await agent.tool("benchmark", {
attribute: "vehicle_complaints",
field: "total",
peers: { model_year: 2019 },
key: "HONDA:CR-V:2019",
});
{
"success": true,
"data": {
"request_id": "6f1c2a94-0d1e-4b53-9d0e-2f6f0c1f7a11",
"status": "completed",
"tool": "benchmark",
"attribute": "vehicle_complaints",
"field": "total",
"peers": { "model_year": 2019 },
"source": null,
"count": 42,
"min": 0,
"p25": 6,
"median": 19,
"p75": 52.5,
"max": 311,
"as_of": "2026-09-30T12:00:00.000Z",
"coverage": "Vehicles sold in the United States",
"population": "looked_up",
"value": 37,
"percentile": 66.67
}
}
Overview
Compares one numeric field across a set of peers and returns the distribution: how many peers, the minimum, the first quartile, the median, the third quartile and the maximum, and, when you give an entity or a value, where it sits (its percentile). One tool serves every data tool that declares a field for it.attribute names the data tool, field the number to compare, and peers the filters that choose the peer set.
Results return in the response, with no polling.
What the peers are
Benchmark reads the facts we recorded: the current, public (shared) record of each entity. It never reads a private record, for any caller, and never a stored search. Every answer states how many peers were compared (count) and what they are (population):
looked_up: the peers are only the entities that someone has looked up. It is a sample of the source, skewed toward what people ask about, not the whole population.complete: the source is also loaded on a schedule, so the peers are the source’s whole population.
count and population before you rely on a percentile.
Authentication
Requires x402 payment in thepayment-signature header.
Request Body
string
required
The name of a data tool whose facts can be benchmarked, for example
vehicle_complaints. A name that cannot be benchmarked, or that has no recorded facts yet, is refused before payment and the response lists the names that can.string
required
The numeric field to compare, one the data tool declares for Benchmark. For
vehicle_complaints: total, crashes, fires, injuries, deaths. For vehicle_recalls and place_disasters: total.object
Filters that choose the peer set, each a field the data tool declares for grouping:
make and model_year for vehicle_complaints and vehicle_recalls, state for place_disasters. Values match without regard to case. Up to 5 filters. Without any, every recorded entity of the attribute is a peer.string
The entity key of an entity inside the peer set, to place its own value. Give at most one of
key and value. A key that is not one of the peers is refused.number
A value to place in the distribution. It need not belong to any entity.
string
The source to read when the attribute has facts from more than one. Without it, such a request is refused and the response lists the sources.
Response (200)
integer
How many peers were compared. Never fewer than 20.
number
The distribution of
field over the peers. Quartiles are interpolated.string
When the newest peer fact was last seen (ISO 8601)
string
Which entities the source covers
string
looked_up or complete, as abovenumber | null
The value placed: the one you gave, or the entity’s own.
null when you gave neither.number | null
Where
value sits among the peers, 0 to 100: the share of peers below it plus half the share equal to it. null when you gave neither key nor value.attribute, field, peers and source.
curl -X POST https://win.oneshotagent.com/v1/tools/benchmark \
-H "Content-Type: application/json" \
-H "payment-signature: <base64 x402 payment>" \
-d '{
"attribute": "vehicle_complaints",
"field": "total",
"peers": { "model_year": 2019 },
"key": "HONDA:CR-V:2019"
}'
import { OneShot } from "@oneshot-agent/sdk";
const agent = new OneShot({ privateKey: process.env.AGENT_PRIVATE_KEY });
const result = await agent.tool("benchmark", {
attribute: "vehicle_complaints",
field: "total",
peers: { model_year: 2019 },
key: "HONDA:CR-V:2019",
});
{
"success": true,
"data": {
"request_id": "6f1c2a94-0d1e-4b53-9d0e-2f6f0c1f7a11",
"status": "completed",
"tool": "benchmark",
"attribute": "vehicle_complaints",
"field": "total",
"peers": { "model_year": 2019 },
"source": null,
"count": 42,
"min": 0,
"p25": 6,
"median": 19,
"p75": 52.5,
"max": 311,
"as_of": "2026-09-30T12:00:00.000Z",
"coverage": "Vehicles sold in the United States",
"population": "looked_up",
"value": 37,
"percentile": 66.67
}
}
See Pricing for the price of a call.
Errors
Refused before any payment:400 invalid_input: the attribute is not a data tool or cannot be benchmarked,fieldis not one it declares, or apeersfilter is not one it declares. The response lists the attributes that can be benchmarked.400 no_data: nothing is recorded for the attribute yet. The response lists the attributes that have recorded facts.400 invalid_request: a field has the wrong shape, bothkeyandvaluewere given, or there are more than 5 peer filters.
request_id and receipt_id; a failed call of this kind is refunded automatically:
400 too_few_peers: fewer than 20 peers. The response givescount,minimumandpopulation. Widen thepeersfilters.400 not_in_population:keyis not one of the peers, or has no number infield.400 invalid_inputwithsources: the peers have facts from several sources andsourceis missing.