Tennis API documentation

48 REST endpoints and a live WebSocket, documented from the API's own specification with real responses.

The Tennis API is a REST API over HTTPS that returns JSON. Live scores also stream over a WebSocket. Every endpoint below is documented from the API's own OpenAPI document, and every example response is real output captured from the production API.

Base URL

text
https://api.citoapi.com/api/v1/tennis

Authentication

Send your API key in the x-api-key header (Authorization: Bearer <key> also works). Get a free key at citoapi.com/dashboard/keys. Keys are secret: call the API from your server, not from a browser.

bash
curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.citoapi.com/api/v1/tennis/matches/live"

Response format

Every response carries success: true or false. List endpoints return items with total, page, page_size and total_pages; single resources return their fields at the top level next to success.

json
{
  "success": true,
  "items": [ { "id": "s365_2026_4764920", "tournament_name": "Wimbledon", "round": "F", "score": "6-7 7-6 6-3 6-4", "winner_id": "atp_206173" } ],
  "total": 31,
  "page": 1,
  "page_size": 2,
  "total_pages": 16
}

Pagination

List endpoints take page (from 1) and page_size. Each endpoint's maximum page_size is listed in its parameter table.

Conditional requests

Responses carry an ETag. Send it back in If-None-Match and an unchanged resource answers 304 Not Modified with no body, which is the cheapest way to poll.

Errors

Errors return success: false and an error object with a stable code, a message that says what to fix, and details for validation problems.

json
{
  "success": false,
  "error": {
    "code": "VALIDATION",
    "message": "date: Field required",
    "status": 422,
    "details": [ { "type": "missing", "loc": ["query", "date"], "msg": "Field required" } ]
  }
}
HTTPerror.codeMeaning
401MISSING_API_KEY / invalid keyNo key, or a key that is not valid.
403GAME_NOT_INCLUDEDA Starter key chose another sport; tennis is not on this key.
403HISTORY_WINDOW_EXCEEDEDThe record is older than your plan's history window (Free 30 days, Starter 90 days). The message names the window.
404NOT_FOUNDNo resource with that id.
422VALIDATIONA parameter is missing or invalid; details names it.
429RATE_LIMITToo many calls. Retry-After and X-RateLimit-* headers say when to retry.
503TENNIS_UPSTREAM_UNAVAILABLEThe data service is briefly unavailable. Safe to retry.

Plans and limits

Limits are enforced by the API exactly as listed. The archive back to 1968 and real-time scores need Pro or Scale.

PlanCalls / monthCalls / minuteHistoryLive scoresWebSockets
Free50010Last 30 days60-second delayNo
Starter ($15, tennis)10,00030Last 90 days60-second delayNo
Pro ($59)250,000100Full archive (1968-)Real time+$15/mo add-on
Scale ($100)1,000,000400Full archive (1968-)Real timeIncluded