Endpoints

All endpoints require Authorization: Bearer <API_KEY>.

GET /me

Returns usage statistics and subscription details for your API key. Useful for building a usage dashboard or checking your renewal date.

Auth required Returns JSON
Request
curl -H "Authorization: Bearer <API_KEY>" \
  https://api.baselinerank.com/me
Response 200
{
  "org": "Acme Tennis Agency",
  "plan": "starter",
  "rate_limit_per_minute": 600,
  "usage": {
    "this_month": 1842,
    "today": 47
  },
  "top_endpoints": [
    { "path": "/players/a0e2", "count": "312" },
    { "path": "/rankings",     "count": "204" }
  ],
  "key_created_at": "2026-03-01T10:00:00Z",
  "last_used_at":   "2026-04-05T08:22:11Z",
  "renewal_date":   "2026-05-01"
}
GET /rankings

Current ATP singles rankings. Returns up to 500 players in a single call — ideal for leaderboard pages or agency dashboards.

Auth required Returns JSON Up to 500 rows
Query parameters
limit integer Number of players to return. Default 100, max 500.
Request
curl -H "Authorization: Bearer <API_KEY>" \
  "https://api.baselinerank.com/rankings?limit=10"
Response 200
{
  "data": [
    { "atp_id": "s0ag", "name_short": "J. Sinner",  "country": "Italy",   "rank": 1, "points": 11330, "movement": 0 },
    { "atp_id": "a0e2", "name_short": "C. Alcaraz", "country": "Spain",   "rank": 2, "points": 9160,  "movement": 1 },
    { "atp_id": "z355", "name_short": "N. Djokovic","country": "Serbia",  "rank": 3, "points": 7720,  "movement": -1 }
  ],
  "meta": { "count": 3, "type": "singles", "updated_at": "2026-04-01" }
}
GET /rankings/doubles

Current ATP doubles rankings. Updated weekly alongside the singles rankings.

Auth required Returns JSON Up to 500 rows
Query parameters
limit integer Number of players to return. Default 100, max 500.
Request
curl -H "Authorization: Bearer <API_KEY>" \
  https://api.baselinerank.com/rankings/doubles
Response 200
{
  "data": [
    { "atp_id": "b705", "name_short": "R. Bopanna", "country": "India",      "rank": 1, "updated_at": "2026-04-01" },
    { "atp_id": "g850", "name_short": "M. Granollers","country": "Spain",    "rank": 2, "updated_at": "2026-04-01" }
  ],
  "meta": { "count": 2, "type": "doubles", "updated_at": "2026-04-01" }
}
GET /players

Paginated list of ATP players with current singles rank. Supports name search — pass search=alcaraz to filter by name.

Auth required Returns JSON Paginated
Query parameters
search string Case-insensitive name filter, e.g. alcaraz.
page integer Page number. Default 1.
limit integer Results per page. Default 50, max 100.
Request
curl -H "Authorization: Bearer <API_KEY>" \
  "https://api.baselinerank.com/players?search=sinner"
Response 200
{
  "data": [
    { "atp_id": "s0ag", "name_short": "J. Sinner", "country": "Italy", "rank": 1 }
  ],
  "meta": { "page": 1, "limit": 50, "total": 1 }
}
GET /players/{atpId}

Full player profile — bio, current rank, points, career statistics, and prize money. 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": 2,
    "points": 9160,
    "movement": 1,
    "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-04-01T06:00:00Z"
  }
}
Response 404
{
  "error": "Player not found"
}
GET /players/{atpId}/ranking

Lightweight endpoint returning just the current rank and last updated date. Use this when you only need the number, not the full player profile.

Auth required Returns JSON
Parameters
atpId string ATP player ID, e.g. su87 (Sonego).
Request
curl -H "Authorization: Bearer <API_KEY>" \
  https://api.baselinerank.com/players/su87/ranking
Response 200
{
  "data": {
    "rank": 64,
    "updated_at": "2026-04-01"
  }
}
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-04-01", "rank": 64 },
      { "date": "2026-03-25", "rank": 65 },
      { "date": "2026-03-18", "rank": 62 },
      { "date": "2026-03-11", "rank": 60 },
      { "date": "2026-03-04", "rank": 60 },
      { "date": "2026-02-25", "rank": 40 }
    ]
  }
}
Response 404
{
  "error": "Player not found"
}
POST /webhook/register

Register an HTTPS endpoint to receive ranking update notifications every Monday. Returns a signing secret — store it securely to verify incoming requests.

Auth required Weekly delivery HMAC-signed
Body
url string Your HTTPS endpoint to receive webhook POST requests.
Request
curl -X POST \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://yoursite.com/hooks/rankings"}' \
  https://api.baselinerank.com/webhook/register
Response 200
{
  "webhook_url": "https://yoursite.com/hooks/rankings",
  "webhook_secret": "whsec_br_a3f8...",
  "message": "Webhook registered. Store the secret — it won't be shown again."
}
DELETE /webhook/register

Disables your webhook endpoint. You will stop receiving ranking update notifications.

Auth required Returns JSON
Request
curl -X DELETE \
  -H "Authorization: Bearer <API_KEY>" \
  https://api.baselinerank.com/webhook/register
Response 200
{
  "message": "Webhook disabled."
}
Live sample
Updated today
JSON
{
  "data": {
    "atp_id": "s0ag",
    "name_short": "J. Sinner",
    "country": "Italy",
    "dob": "2001-08-16",
    "height_cm": 188,
    "weight_kg": 76,
    "plays": "Right-Handed, Two-Handed Backhand",
    "coach": "Simone Vagnozzi",
    "turned_pro": 2018,
    "rank": 1,
    "points": 11330,
    "movement": 0,
    "tournaments_played": 14,
    "career_high_rank": 1,
    "career_wins": 248,
    "career_losses": 67,
    "career_titles": 21,
    "ytd_prize_money": "$5,765,082",
    "career_prize_money": "$44,291,976",
    "scraped_at": "2026-04-01T06:00:00Z"
  }
}

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.

Webhook payload

Sent every Monday to your registered endpoint. Verify authenticity using X-Baseline-Signature.

Field Type Description
event string Always rankings.updated.
timestamp datetime ISO 8601 delivery time.
data.type string singles.
data.updated_at date Date the rankings were updated.
data.top_10 array Top 10 singles players with rank and points.
Verify signature (Node.js)
const sig = req.headers['x-baseline-signature'];
const expected = 'sha256=' + crypto
  .createHmac('sha256', WEBHOOK_SECRET)
  .update(rawBody)
  .digest('hex');
if (sig !== expected) return res.status(401).end();

Versioning

The API is currently unversioned at /. Future breaking changes will be announced in the changelog with a deprecation window before removal.