Endpoints

All endpoints require Authorization: Bearer <API_KEY>.

GET /players/{atpId}

Returns player details and current rank. Use the ATP player ID as the path parameter.

Auth required Returns JSON Cached 10 min
Parameters
atpId string ATP player ID, e.g. a0e2 (Alcaraz) or s0ag (Sinner).
Request
curl -H "Authorization: Bearer <API_KEY>" \
  https://api.baselinerank.com/players/a0e2
Response 200
{
  "data": {
    "atp_id": "a0e2",
    "name_short": "C. Alcaraz",
    "country": "Spain",
    "dob": "2003-05-05",
    "height_cm": 183,
    "weight_kg": 74,
    "plays": "Right-Handed, Two-Handed Backhand",
    "coach": "Samuel Lopez",
    "turned_pro": 2018,
    "rank": 1,
    "points": 13550,
    "movement": 0,
    "tournaments_played": 17,
    "career_high_rank": 1,
    "career_wins": 292,
    "career_losses": 65,
    "career_titles": 26,
    "ytd_prize_money": "$3,301,730",
    "career_prize_money": "$63,333,776",
    "scraped_at": "2026-03-03T21:03:09Z"
  }
}
Response 404
{
  "error": "Player not found"
}
GET /players/{atpId}/ranking/history

Weekly ranking snapshots for a player, newest first. Supports both singles and doubles. Ideal for charting rank progression over a season or career.

Auth required Returns JSON Up to 500 rows
Parameters
atpId string ATP player ID (path), e.g. su87 (Sonego).
type string Ranking type: singles (default) or doubles. Query param.
limit integer Max rows returned. Default 100, max 500. Query param.
Request
curl -H "Authorization: Bearer <API_KEY>" \
  "https://api.baselinerank.com/players/su87/ranking/history?limit=52"
Response 200
{
  "data": {
    "atpId": "su87",
    "type": "singles",
    "history": [
      { "date": "2026-03-02", "rank": 64 },
      { "date": "2026-02-23", "rank": 65 },
      { "date": "2026-02-16", "rank": 60 },
      { "date": "2026-02-09", "rank": 60 },
      { "date": "2026-02-02", "rank": 40 },
      { "date": "2026-01-19", "rank": 40 }
    ]
  }
}
Response 404
{
  "error": "Player not found"
}
GET /v1/rosters/{agencyId}/rankings

Returns rankings for all players in a roster in a single response.

Batch response Daily updatedAt Roster scoped
Parameters
agencyId string Organization slug from your dashboard.
Request
curl -H "Authorization: Bearer <API_KEY>" \
  https://api.baselinerank.com/v1/rosters/acme/rankings
Response 200
{
  "agency": "Baseline Sports Group",
  "updatedAt": "2026-02-23",
  "players": [
    { "name": "Coco Gauff", "rank": 3, "trend": 1 },
    { "name": "Carlos Alcaraz", "rank": 2, "trend": 0 }
  ]
}
POST /v1/webhooks/rank-change

Register a webhook to receive events when a player's rank changes.

Agency tier+ Webhook events JSON payload
Body
events array List of event keys, e.g. rank.updated.
callbackUrl string Your HTTPS endpoint to receive webhooks.
Request body
{
  "events": ["rank.updated"],
  "callbackUrl": "https://yoursite.com/hooks/rank"
}
Live sample
Updated today
JSON
{
  "data": {
    "atp_id": "a0e2",
    "name_short": "C. Alcaraz",
    "country": "Spain",
    "dob": "2003-05-05",
    "height_cm": 183,
    "weight_kg": 74,
    "plays": "Right-Handed, Two-Handed Backhand",
    "coach": "Samuel Lopez",
    "turned_pro": 2018,
    "rank": 1,
    "points": 13550,
    "movement": 0,
    "tournaments_played": 17,
    "career_high_rank": 1,
    "career_wins": 292,
    "career_losses": 65,
    "career_titles": 26,
    "ytd_prize_money": "$3,301,730",
    "career_prize_money": "$63,333,776",
    "scraped_at": "2026-03-03T21:03:09Z"
  }
}

Reference

Authentication, rate limits, errors, and SDKs.

Authentication

Use Bearer tokens for server or client-side requests.

Header
Authorization: Bearer {API_KEY}

Rate limits

Default: 600 requests / minute per key.

Headers
X-RateLimit-Limit: 600
X-RateLimit-Remaining: 542

Error handling

Structured errors with consistent status codes.

Example
{
  "error": "not_found",
  "message": "Player ID not recognized"
}

SDKs Coming soon

Native clients for JavaScript and Python are in development. Until then, the API is fully usable with fetch, curl, or any HTTP client.

JS — fetch example
const res = await fetch(
  "https://api.baselinerank.com/players/a0e2",
  { headers: { Authorization: "Bearer " + API_KEY } }
);
const { data } = await res.json();

Response schema

Field definitions for /players/{atpId}.

Field Type Description
atp_id string ATP player ID, e.g. a0e2.
name_short string Display name, e.g. C. Alcaraz.
country string Nationality, e.g. Spain.
dob date Date of birth, ISO 8601.
height_cm integer Height in centimetres.
weight_kg integer Weight in kilograms.
plays string Handedness and backhand style.
coach string Current coach name.
turned_pro integer Year the player turned professional.
rank integer Current official singles rank.
points integer Current ranking points.
movement integer Rank change since last update. Positive = gained places.
tournaments_played integer Tournaments played in the current ranking period.
career_high_rank integer Best singles rank ever achieved.
career_wins integer Total career match wins.
career_losses integer Total career match losses.
career_titles integer Number of ATP titles won.
ytd_prize_money string Year-to-date prize money, e.g. $3,301,730.
career_prize_money string Total career prize money.
scraped_at datetime Timestamp of last data refresh, ISO 8601.

Ranking history schema

Field definitions for /players/{atpId}/ranking/history.

Field Type Description
atpId string The ATP player ID echoed from the request.
type string singles or doubles.
history[].date date Week ending date, ISO 8601, e.g. 2026-03-02.
history[].rank integer Official ATP rank on that date.

Error codes

  • not_found — Player ID is not recognized.
  • unauthorized — Missing or invalid API key.
  • rate_limited — Too many requests in a short window.
  • invalid_request — Malformed parameters.

Versioning

The API is versioned under /v1. Future versions will ship behind a new base path. Breaking changes will be announced in the changelog with a deprecation window before removal.