Skip to main content

Fetch Live cricket scores using python






Status : [this package isn't working as of 08/10/2019]
             Error: https://www.cricbuzz.com/match-api/livematches.json isn't working:(

Hello!
cricbuzz-py can be used to fetch or print the following :
  1. cricket matches 
  2. live scores
  3. status
  4. scores
I'll be adding more soon.

Installing the pip package :

pip install cricbuzz-py

Importing cricbuzz-py:

import cbpy as cb

Fetching match list:

y=cb.gmatchlist()
for x in y:
    print(x)


Printing match list:

cb.pmatchlist()

Fetching Players :


squad,squad_bench = cb.gteam1players(3)
squad,squad_bench = cb.gteam2players(3)


The functions gteam1players(n) or gteam2players(n) returns players in squad and squad bench of the match of index 4. Please do not use 0 for index .  n-1 value is used when retrieving data from match list.

Fetching match score:

k=(cb.glivescore(4))

 If the status of the match is "Upcoming"  or  if there's an error, this function returns a list with appropriate message

If not, it returns a list with the following information,

  • match-type (Test, ODI etc)
  • batting stats
  • batting - innings stats
  • bowling stats
  • bowling-innings stats
  • batsman
  • bowler
  • match-status

Printing Match Score


cb.plivescore(2)

Prints the stats :



Github






Comments

Post a Comment