- Home
- Skills
- APIs & Backend
- espn api
espn api
by Sejal Dua
Query ESPN's undocumented public APIs for real-time scores, stats, and betting odds across 139 leagues.
Free
espn api
Example session with this skill installed
Get the current NBA standings and show me the Python code to fetch them.
- Read your context and instructions
- Compiled the espn api
I have retrieved the logic for the ESPN Standings API. Note that the standard site/v2 endpoint returns a stub, so we must use the specific v2 sports domain for full standings data.
NBA Standings API Implementation
| Item | Value |
|---|---|
| Endpoint | https://site.api.espn.com/apis/v2/sports/basketball/nba/standings |
| Method | GET |
| Auth | None (Public) |
| Response Format | JSON |
import requests
def get_nba_standings():
"""
Fetches current NBA standings from ESPN's internal API.
Uses the v2 domain to avoid the site/v2 stub limitation.
"""
url = "https://site.api.espn.com/apis/v2/sports/basketball/nba/standings"
try:
response = requests.get(url, timeout=15)
response.raise_for_status()
data = response.json()
# Structure: children[0] is usually Eastern, children[1] Western
return data.get('children', [])
except requests.exceptions.RequestException as e:
print(f"Error fetching standings: {e}")
return None
# Example usage
standings = get_nba_standings()
if standings:
for conference in standings:
print(f"\n{conference['name']}")
for team in conference['standings']['entries']:
name = team['team']['displayName']
record = team['stats'][0]['displayValue'] # Overall record
print(f"{name}: {record}")
Next steps
- Implement a caching layer (e.g., Redis) with a 5-minute TTL as standings do not change every second.
- Parse the
statsarray to extract specific metrics like 'streak' or 'homeRecord'. - Map the
team['id']to the/teams/{id}/rosterendpoint if you need to drill down into player data.
Connects securely to your tools. The creator never sees your data.
About this skill
Building sports apps usually involves expensive, tiered data subscriptions. This skill enables you to query ESPN's undocumented public JSON APIs for real-time sports data without any API keys or authentication.
What it does
- Live Scoring retrieves real-time scores, play-by-play data, and win probabilities across 139 leagues.
- Roster Management fetches complete team rosters, active athlete profiles, and career stats.
- League Standings pulls conference and division rankings using specialized versioned endpoints.
- Betting Analysis extracts odds from major providers like DraftKings, FanDuel, and BetMGM.
- Injury Reporting monitors league-wide injury lists and transaction wires in real-time.
How it works
- Identify league slugs by mapping the sport and league to the internal ESPN identifier.
- Select the domain from six possible API domains based on whether you need core stats, CDN-hosted game packages, or site-specific scores.
- Construct requests using appropriate query parameters for dates, season types, or pagination.
- Parse JSON according to known response schemas to handle deeply nested sports data objects.
Frameworks & tools
Works with any language capable of HTTP requests, including Python (requests, httpx), JavaScript (fetch, axios), and curl.
Why this beats prompting it yourself
General AI models often hallucinate API endpoints or suggest outdated authenticated versions like the retired developer portal. This skill provides the specific, undocumented internal paths that power ESPN's own mobile app and web infrastructure.
Use cases
- Build a custom live-score dashboard for a specific NFL or NBA team.
- Automate fantasy sports research by pulling player game logs and injury status.
- Monitor betting line movements across multiple sportsbooks for arbitrage.
- Create real-time news alerts for specific leagues or athletes via the Now API.
Known limitations
As an undocumented API, ESPN may change response shapes without notice. Rate limiting is present, and high-frequency polling requires custom caching logic.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
2 uses
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 2 months ago
- Free with an Agensi account
- Accounts
Espn
- Software
Node.js
Python
Permissions
Allowed Hosts
What's inside
Creator
Sejal Dua
Frequently Asked Questions
New in APIs & Backend
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.