Endpoints

Authenticated endpoints require Authorization: Bearer <API_KEY>. Demo endpoints (below) are public and do not need a key.

Open the interactive docs →

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 or WTA 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
tour string Tour to return. atp (default) or wta.
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": 10400, "movement": null },
    { "atp_id": "a0e2", "name_short": "C. Alcaraz", "country": "Spain",  "rank": 2, "points": 13550, "movement": null },
    { "atp_id": "z355", "name_short": "A. Zverev",  "country": "Germany","rank": 3, "points": 4555,  "movement": null }
  ],
  "meta": { "count": 3, "type": "singles", "updated_at": "2026-06-01" }
}
GET /rankings/doubles

Current ATP doubles rankings from the latest weekly snapshot. Updated alongside singles, though doubles coverage may lag.

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": "va08", "name_short": "A. Vavassori", "country": "Italy",   "rank": 17, "updated_at": "2026-03-02" },
    { "atp_id": "mo55", "name_short": "L. Miedler",   "country": "Austria", "rank": 22, "updated_at": "2026-03-02" }
  ],
  "meta": { "count": 2, "type": "doubles", "updated_at": "2026-03-02" }
}
GET /players

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

Auth required Returns JSON Paginated
Query parameters
tour string Tour to return. atp (default) or wta.
search string Case-insensitive name filter, e.g. swiatek.
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
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-05T00:00:00.000Z",
    "height_cm": 183,
    "weight_kg": 74,
    "plays": "Right-Handed, Two-Handed Backhand",
    "coach": "Samuel Lopez",
    "turned_pro": 2018,
    "rank": 2,
    "points": 13550,
    "movement": null,
    "tournaments_played": null,
    "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-06-01T06:00:02.378Z"
  }
}
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": 70,
    "updated_at": "2026-06-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-06-01", "rank": 70 },
      { "date": "2026-05-25", "rank": 70 },
      { "date": "2026-05-18", "rank": 69 },
      { "date": "2026-05-11", "rank": 66 },
      { "date": "2026-05-04", "rank": 66 },
      { "date": "2026-04-29", "rank": 62 }
    ]
  }
}
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. Use it to verify incoming requests via X-Baseline-Signature."
}
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-16T00:00:00.000Z",
    "height_cm": 191,
    "weight_kg": 77,
    "plays": "Right-Handed, Two-Handed Backhand",
    "coach": "Simone Vagnozzi, Darren Cahill",
    "turned_pro": 2018,
    "rank": 1,
    "points": 10400,
    "movement": null,
    "tournaments_played": null,
    "career_high_rank": 1,
    "career_wins": 328,
    "career_losses": 88,
    "career_titles": 24,
    "ytd_prize_money": "$912,500",
    "career_prize_money": "$57,544,926",
    "scraped_at": "2026-06-01T06:00:02.378Z"
  }
}

Demo endpoints (no API key)

The Try it live widget below uses unauthenticated demo routes so visitors can preview responses without a key. Rate-limited to 30 requests/minute per IP.

Endpoints
curl "https://api.baselinerank.com/demo/players?search=sinner&limit=8"
curl "https://api.baselinerank.com/demo/players/a0e2"

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

Plain-text error messages with consistent HTTP status codes.

Example
{
  "error": "Player not found"
}

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 datetime Date of birth, ISO 8601 (e.g. 2003-05-05T00:00:00.000Z).
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 | null Rank change since last update. Positive = gained places. null when unavailable.
tournaments_played integer | null Tournaments played in the current ranking period. null when unavailable.
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 responses

Errors return a single error string. HTTP status indicates the category.

  • 401"Missing or invalid Authorization header" or "Invalid or revoked API key"
  • 404"Player not found"
  • 429"Rate limit exceeded. Try again in a moment." (includes code: "rate_limited")
  • 400 — Validation errors, e.g. "url is required" or "URL must use HTTPS"

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.