espn api

    by Sejal Dua

    1

    Query ESPN's undocumented public APIs for real-time scores, stats, and betting odds across 139 leagues.

    Free

    2 usesSecurity scanned

    Works with the AI Agents you already use

    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

    ItemValue
    Endpointhttps://site.api.espn.com/apis/v2/sports/basketball/nba/standings
    MethodGET
    AuthNone (Public)
    Response FormatJSON
    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

    1. Implement a caching layer (e.g., Redis) with a 5-minute TTL as standings do not change every second.
    2. Parse the stats array to extract specific metrics like 'streak' or 'homeRecord'.
    3. Map the team['id'] to the /teams/{id}/roster endpoint 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

    1. Identify league slugs by mapping the sport and league to the internal ESPN identifier.
    2. Select the domain from six possible API domains based on whether you need core stats, CDN-hosted game packages, or site-specific scores.
    3. Construct requests using appropriate query parameters for dates, season types, or pagination.
    4. 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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.jsPython

    Permissions

    Terminal / Shell
    Network Access

    Allowed Hosts

    site.api.espn.com
    sports.core.api.espn.com
    site.web.api.espn.com
    cdn.espn.com
    now.core.api.espn.com
    Listed2 months ago

    What's inside

    Creator

    Sejal Dua

    Sejal Dua

    Frequently Asked Questions

    No, this skill leverages the same undocumented public JSON endpoints that power ESPN's official platforms, meaning you can access live sports data without any API keys, monthly subscriptions, or developer accounts.

    The skill supports 139 leagues, covering major professional sports like the NFL, NBA, MLB, and NHL, as well as international soccer, college sports, and niche leagues available on ESPN's global infrastructure.

    Because these are internal endpoints, ESPN may update data structures without notice; however, this skill includes the specific, versioned paths and parameters required to maintain stability and minimize breakages compared to using retired public portals.

    This skill is designed for any AI agent or development environment capable of making HTTP requests, including Python, JavaScript, and specialized AI frameworks that support external tool integration.

    You receive the precise documentation, endpoint mappings for all six API domains, and the logic required to correctly query and parse ESPN's deeply nested JSON responses for scores, stats, and betting odds.

    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.

    Free