Skip to main content

Base URL

https://api.comparebench.com

Authentication

Exchange an Auth0 ID token for a session cookie:
curl -si -X POST https://api.comparebench.com/login/yardstick \
  -H "Content-Type: application/json" \
  -d '{"token": "<auth0_id_token>"}'
The response includes a Set-Cookie header. Extract the name=value pair (everything before the first ;) and pass it as a Cookie header on authenticated requests:
curl https://api.comparebench.com/user/me \
  -H "Cookie: session=<value>"
This is how the Yardstick desktop client works — it reads the Set-Cookie from the login response and passes it back directly on every subsequent request.

Make a request

Most product endpoints are public and don’t require a cookie:
# Search CPUs
curl -X POST https://api.comparebench.com/products/cpu \
  -H "Content-Type: application/json" \
  -d '{"page": 1, "limit": 20, "search": "i9-14900k"}'

# Get benchmark types
curl https://api.comparebench.com/benchmarks/types

# Get a build
curl https://api.comparebench.com/builds/1234
Authenticated endpoints require the Cookie header:
# Get current user
curl https://api.comparebench.com/user/me \
  -H "Cookie: session=<value>"

# Upload a build
curl -X POST https://api.comparebench.com/v2/builds/upload \
  -H "Content-Type: application/json" \
  -H "Cookie: session=<value>" \
  -d '{...}'

Response format

List endpoints return a consistent shape:
{
  "results": [...],
  "total": 142
}
Use total to drive pagination. Detail endpoints return the same shape with a single item in results.

Error responses

StatusMeaning
400Validation error — check your request body
401Not authenticated — send a valid session cookie
402Feature requires a higher billing tier
403Forbidden — triggers session logout on the client
429Rate limited — only applies to unauthenticated non-GET requests