Developer API

Integrate A Versus B 's comparison data into your applications. Search, retrieve, and embed thousands of structured comparisons.

Pricing

Free

$0forever

100 requests/day

  • All comparison endpoints
  • JSON responses
  • CORS enabled
  • Community support

Pro

$99/month

10,000 requests/day

  • Everything in Free
  • Priority support
  • Usage analytics dashboard
  • Bulk search endpoints

Enterprise

$499/month

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:

Create API Key
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

List Comparisons
curl https://www.aversusb.net
/api/v1/comparisons?limit=5 \
  -H "X-API-Key: avsb_your_key_here"

3. Get a specific comparison

Get 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:

Header (recommended)
X-API-Key: avsb_your_key_here
Bearer token
Authorization: Bearer avsb_your_key_here
Query parameter
?api_key=avsb_your_key_here

API Endpoints

GET /api/v1/comparisons

List and search comparisons. Supports pagination, search, and category filtering.

ParameterTypeDescription
qstringSearch query
categorystringFilter by category slug
limitnumberResults per page (max 100, default 20)
offsetnumberPagination offset (default 0)
GET /api/v1/comparisons/:slug

Get a single comparison by slug. Returns full structured data including entities, key differences, verdict, FAQs, and metadata.

GET /api/v1/embed/:slug

Get 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: 95

When you exceed your rate limit, you'll receive a 429 Too Many Requests response. Limits reset daily at midnight UTC.

Response Format

Example: GET /api/v1/comparisons/messi-vs-ronaldo
{
  "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

StatusMeaning
401Missing or invalid API key
404Comparison not found
429Rate limit exceeded
500Internal server error

Key Management

List your keys

GET /api/v1/keys?email=you@example.com

Revoke 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=30

Ready to get started?

Create your free API key and start building in minutes.

Go to Dashboard
Developer API — A Versus B | A Versus B