Game Theory
Approval voting API
Tallies approval ballots (each voter approves any subset of candidates), returning per-candidate approvals, ranking, winner and approval rate. Answers 'Who wins under approval voting?', 'What fraction of voters approved the winner?'.
Price$0.04per request
MethodPOST
Route/v1/gametheory/approval-voting
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
social-choicevotingapprovalballotselectiontallywinnerdecision
API URL
Integration docshttps://x402.hexl.dev/v1/gametheory/approval-votingExample request
{
"candidates": [
"A",
"B",
"C"
],
"ballots": [
{
"approved": [
"A",
"B"
],
"count": 3
},
{
"approved": [
"B",
"C"
],
"count": 2
},
{
"approved": [
"A"
],
"count": 1
}
]
}Example response
{
"totalBallots": 6,
"approvals": {
"A": 4,
"B": 5,
"C": 2
},
"winner": "B",
"ranking": [
"B",
"A",
"C"
],
"winnerApprovalRate": 0.833333,
"interpretation": "Approval winner is B with 5 approvals (83.3% of ballots)."
}Input schema
{
"type": "object",
"required": [
"candidates",
"ballots"
],
"properties": {
"candidates": {
"type": "array",
"items": {
"type": "string"
},
"examples": [
[
"A",
"B",
"C"
]
]
},
"ballots": {
"type": "array",
"items": {
"type": "object"
},
"examples": [
[
{
"approved": [
"A",
"B"
],
"count": 3
},
{
"approved": [
"B",
"C"
],
"count": 2
},
{
"approved": [
"A"
],
"count": 1
}
]
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}