Developer API
Integrate A Versus B 's comparison data into your applications. Search, retrieve, and embed thousands of structured comparisons.
Pricing
Free
100 requests/day
- ✓All comparison endpoints
- ✓JSON responses
- ✓CORS enabled
- ✓Community support
Pro
10,000 requests/day
- ✓Everything in Free
- ✓Priority support
- ✓Usage analytics dashboard
- ✓Bulk search endpoints
Enterprise
Unlimited requests
- ✓Everything in Pro
- ✓Custom categories
- ✓Dedicated support
- ✓SLA guarantee
- ✓White-label embed
Getting Started
1. Get your API key
Create a free API key by sending a POST request:
curl -X POST https://www.aversusb.net
/api/v1/keys \
-H "Content-Type: application/json" \
-d '{"email": "you@example.com", "name": "My App"}'Save the returned API key securely — it will only be shown once.
2. Make your first request
curl https://www.aversusb.net
/api/v1/comparisons?limit=5 \
-H "X-API-Key: avsb_your_key_here"3. Get a specific comparison
curl https://www.aversusb.net
/api/v1/comparisons/messi-vs-ronaldo \
-H "X-API-Key: avsb_your_key_here"Authentication
Pass your API key in one of three ways:
X-API-Key: avsb_your_key_hereAuthorization: Bearer avsb_your_key_here?api_key=avsb_your_key_hereAPI Endpoints
GET /api/v1/comparisonsList and search comparisons. Supports pagination, search, and category filtering.
| Parameter | Type | Description |
|---|---|---|
| q | string | Search query |
| category | string | Filter by category slug |
| limit | number | Results per page (max 100, default 20) |
| offset | number | Pagination offset (default 0) |
GET /api/v1/comparisons/:slugGet a single comparison by slug. Returns full structured data including entities, key differences, verdict, FAQs, and metadata.
GET /api/v1/embed/:slugGet an embeddable HTML widget for a comparison. Returns HTML that can be rendered in an iframe. No API key required for embed endpoints.
Rate Limiting
Every response includes rate limit headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95When you exceed your rate limit, you'll receive a 429 Too Many Requests response. Limits reset daily at midnight UTC.
Response Format
{
"id": "clx...",
"slug": "messi-vs-ronaldo",
"title": "Messi vs Ronaldo",
"shortAnswer": "Messi excels in playmaking...",
"keyDifferences": [
{
"label": "Goals",
"entityAValue": "838",
"entityBValue": "900",
"winner": "b"
}
],
"verdict": "Both are all-time greats...",
"category": "sports",
"entities": [...],
"faqs": [...]
}Error Codes
| Status | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 404 | Comparison not found |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
Key Management
List your keys
GET /api/v1/keys?email=you@example.comRevoke a key
DELETE /api/v1/keys
{ "keyId": "clx...", "email": "you@example.com" }View usage
GET /api/v1/keys/usage?email=you@example.com&keyId=clx...&days=30Ready to get started?
Create your free API key and start building in minutes.
Go to Dashboard