Skip to content

An unofficial Cricket API client for pulling Player Stats, Live Score, Fixtures, Tables and Results data of Cricket Matches

Notifications You must be signed in to change notification settings

tarun7r/Cricket-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cricket Hub - Cricket API 2.0

This is a simple Flask web application that provides an API and a user-friendly website to retrieve Player Stats, Live Scores, Fixtures, Tables, and Results data of Cricket Matches (ODI, T20, Test, and IPL) from the online websites

Website Features

The application now includes a website accessible with the following features:

  • 🎯 Live Scores: View live scores of ongoing matches with real-time updates.
  • 📅 Schedule: Check the schedule of upcoming matches, including dates and teams.
  • 👤 Player Stats: Search for player statistics, including batting and bowling career summaries.
  • ⚖️ Compare Players: Compare two players' stats side by side for better insights.

API Endpoints

The application provides the following API endpoints:

GET /players/{player_name}

This endpoint retrieves information about a cricket player with the given name. The player name should be provided as a URL parameter.

The API returns a JSON object with the following structure:

[
    {
        "Player Name": "Player Name",
        "Country": "Country",
        "Role": "Role",
        "Batting Career Summary 1": {
            "Mode1": "Test",
            "Matches": "Matches",
            "Runs": "Runs",
            "HS": "HS",
            "Avg": "Avg",
            "SR": "SR",
            "100s": "100s",
            "50s": "50s"
        },
        "Batting Career Summary2": {
            "Mode2": "ODI",
            "Matches": "Matches",
            "Runs": "Runs",
            "HS": "HS",
            "Avg": "Avg",
            "SR": "SR",
            "100s": "100s",
            "50s": "50s"
        },
        "Batting Career Summary3": {
            "Mode2": "T20I",
            "Matches": "Matches",
            "Runs": "Runs",
            "HS": "HS",
            "Avg": "Avg",
            "SR": "SR",
            "100s": "100s",
            "50s": "50s"
        }
    }
]

GET /schedule

The API returns a JSON array containing the details of upcoming matches, including date, teams, and tournament.

The API returns a JSON object with the following structure:


[
    "India vs South Africa, 1st ODI",
    "India vs South Africa, 2nd ODI",
    // ... additional matches
]

GET /live

The API returns a JSON array containing the details of live matches, including team names, scores, and overs played.

The API returns a JSON object with the following structure:


[
    "RCB196-7 (20 Ovs) CSK9-2 (2.3 Ovs) Chennai Super Kings need 188 runs",
    // ... additional live matches
]

Live Score

  • Live Score of all the Matches Going on present


Schedule

  • Schedule of the next Upcoming Matches


Individual Player Stats

  • Example: Stats of Virat Kohli | You can use the common name of the Players as well to retrieve the details


Player Comparison

  • Compare two players' batting and bowling statistics side by side.


Update 🚀

The API and website have been enhanced with new features and improvements:

  • 🎯 Added a user-friendly UI website for interacting with live scores, player stats, schedule, and player comparison.
  • ⚡ Optimized the codebase for better performance and reliability.
  • 🔄 Rebased and updated to ensure compatibility with the latest dependencies.

Enjoy the latest version of the Cricket API and website! 🏏

Disclaimer ⚠️

This project is strictly for educational purposes. Not intended for production use. The frontend HTML was generated using GPT

About

An unofficial Cricket API client for pulling Player Stats, Live Score, Fixtures, Tables and Results data of Cricket Matches

Topics

Resources

Stars

Watchers

Forks

Languages