# PadelRank API — consolidated reference for coding agents This file summarizes the public partner API. The authoritative machine-readable contract is: https://api.padelrank.me/openapi.json Human docs: https://developers.padelrank.me/docs Index: https://developers.padelrank.me/llms.txt AI guide: https://developers.padelrank.me/docs/ai Do not invent behaviour that is not listed here or in OpenAPI. ## Product PadelRank provides amateur padel doubles ratings for integrators. You can look up player ratings and form, list public rankings, estimate foursome balance, plan multi-player sessions, read partnership chemistry, register players, submit 2v2 results, receive webhooks, and import external rating priors. You cannot book courts, search by distance, delete players/matches, or read proprietary ranking internals. ## Base URL and format - Base URL: https://api.padelrank.me - Version prefix: /v1 - JSON request/response bodies - Timestamps: ISO 8601 UTC - Body size limit: 256 KiB (413 if larger) - Handler timeout: 25 seconds (504) ## Authentication Headers (equivalent permissions): - Authorization: Bearer pr_live_YOUR_API_KEY - X-API-Key: pr_live_YOUR_API_KEY Key types: - pr_live_… — full scopes; needs active/trialing subscription (past_due can still read; writes 402) - pr_test_… — read-only on the same host and data; works before subscription; writes 403 Scopes: - read:players — GET player, form, search; also match list/get - read:rankings — GET rankings - read:intelligence — predict, chemistry, session, partners, integrity - write:players — POST players - write:matches — POST matches (and match reads / rating-story) - write:external-ratings — POST external-ratings/upsert - write:webhooks — manage webhook endpoints Never put keys in frontend JavaScript, git, or logs. ## Rating object (partner-safe) { "padelrank_score": 2840, "confidence_level": "provisional|established|verified", "confidence_label": "Medium confidence", "matches_played": 22 } padelrank_score is floored at 0 and not capped. Partner responses never expose internal rating state or ranking-library identifiers. ## Endpoints ### GET /health (no auth) Liveness: { status: "ok", service: "api", timestamp } ### GET /ready (no auth) Readiness. 503 uses { status, reason } (not partner error envelope). ### GET /openapi.json (no auth) OpenAPI 3.1 document. ### GET /v1 (auth, no specific scope) Version index with endpoint map. ### GET /v1/players/{username} (read:players) Username pattern: ^[a-z0-9_]{3,30}$ 200: player + rating + created_at 404: unknown or private ### GET /v1/players/{username}/form (read:players) Query: window (1–50, default 10). Rolling form_index / form_label card. ### GET /v1/players/{username}/partners (read:intelligence) Top partnership affinities (synergy_score). ### GET /v1/players/{username}/integrity (read:intelligence) Opaque risk_band + signals for league hosts. ### GET /v1/players/search (read:players) Query: q (required, 2–64), limit (1–50, default 20), offset (0–1000, default 0) Literal prefix search. Returns results + pagination fields. ### POST /v1/players (write:players, live key) Body: username (required), display_name?, country_code?, city?, profile_is_public? (default true) 201 created true / 200 created false for existing username ### GET /v1/rankings (read:rankings) Query: country_code?, city? (exact, case-insensitive), limit (default 50, max 100), offset (max 10000) Ordered by score desc. rank = offset + index + 1 ### POST /v1/intelligence/predict (read:intelligence) Body: { format: "2v2", player_ids: [uuid x4 distinct] } order A-left, A-right, B-left, B-right 200: draw_probability, balance_rating (high|medium|low), team_a, team_b balance_rating: high >= 0.12, medium >= 0.07, else low Allowed for test keys. ### GET /v1/intelligence/chemistry (read:intelligence) Query: player_a, player_b. Partnership synergy_score (opaque 0–100). ### POST /v1/intelligence/session (read:intelligence) Body: player_ids[4..32], rounds?, format americano|fixed_teams. Fair round plan. ### POST /v1/matches (write:matches, live key) Body: played_at, winning_team A|B, participants[4], trust_tier? (default partner_attested), external_ref?, set_scores? trust_tier: partner_attested | player_confirmed | tournament_official | imported partner_attested/tournament_official/imported complete and may update ratings player_confirmed stays pending without rating update Idempotency: external_ref and/or Idempotency-Key (8–128: A-Za-z0-9._:-) Same ref + same winner + same trust_tier => 200 idempotent_replay Different winner/trust_tier => 409 idempotency_conflict Emits webhooks match.completed and rating.updated when applicable. ### GET /v1/matches (write:matches OR read:players) Lists calling partner's matches. Query: limit, offset, external_ref?, status? ### GET /v1/matches/{id} (write:matches OR read:players) Match + participants + set_scores + scoreline. Other partners' matches => 404 ### GET /v1/matches/{id}/rating-story (write:matches OR read:players) Partner-safe post-match narratives when rating events exist. ### GET/POST /v1/webhooks (write:webhooks, live key) HTTPS endpoints for match.completed and rating.updated. signing_secret returned once on create. ### DELETE /v1/webhooks/{id} (write:webhooks, live key) Revoke endpoint. ### POST /v1/external-ratings/upsert (write:external-ratings, live key) Body: provider_id, dry_run?, entries[1..500] Does NOT change padelrank_score. Upsert by profile_id + provider_id. ## Errors { "error": "validation_error", "message": "The request is invalid.", "request_id": "…" } Common HTTP: 401 unauthorized, 402 payment_required, 403 forbidden, 404 not_found, 409 idempotency_conflict, 413 payload_too_large, 422 validation_error, 429 rate_limit_exceeded (+ Retry-After), 500, 503, 504 request_timeout ## Pagination Collections return limit, offset, total, has_more plus the named array (results|rankings|matches). ## Rate limits Plan defaults (headers are authoritative for the account): - Starter 10k/month, 60/min - Pro 100k/month, 300/min - Scale 500k/month, 600/min - Enterprise custom Headers may include X-RateLimit-*, X-Quota-*, X-RateLimit-Burst-*. ## Versioning Current: /v1. Additive fields OK. Breaking changes => new major path with >= 90 days notice. ## Not available - Separate sandbox host - Official SDKs - Delete player/match endpoints - Ranking algorithm disclosure - Hosted fantasy league UX (partners build that on these events) ## Integration prompt Read https://developers.padelrank.me/docs/ai and follow the copy-ready prompt there.