Free Cricket API - Live Cricket Score JSON API ๐Ÿ

Overview

Free Cricket API ๐Ÿ”

Live Cricket Score API ๐Ÿ

unofficial API Data Fetched from Cricbuzz.com

This is an unofficial API and not Linked or Partnered with Any Brands/Company.

Recently we shutdown our Free API Server due to bulk API Calls Personally we Suggest you to Self Host this API on your server - instant Deploy on Vercel and Heroku - https://github.com/mskian/cri-deploy#free-deploy-

How it Works? ๐Ÿค”

We are just fetching the data from Cricbuzz using PHP cURL preg_match and preg_math_all. It's kind of scraping but we are not storing any data or link in our end.

Everything is scraped live and shown to end users in realtime.

Example: API URL ๐ŸŒ

https://localhost:6001/cri.php?url=<Live Match URL>

Requirements ๐Ÿ“‘

  • Server with PHP Support
  • PHP 7.2 or 7.3 or 7.4 (Test upto PHP 8)
  • PHP cURL
  • Nginx, Apache2 or Lightspeed
  • HTTPS (For Secure SSL Connections)

Installation ๐Ÿฏ

  • Download or Clone Repo to your Server
git clone https://github.com/mskian/cricket-api.git
cd cricket-api
cd cri
  • Test the API
php -S localhost:6001

Usage ๐ŸŸ

  • Get the Live Match Score URL from - https://www.cricbuzz.com/cricket-match/live-scores
  • Enter them Directly or replace www with m

Example ๐Ÿ“‹

http://localhost:6001/cri.php?url=https://www.cricbuzz.com/live-cricket-scores/30524/53rd-match-indian-premier-league-2020

(OR)

http://localhost:6001/cri.php?url=https://m.cricbuzz.com/live-cricket-scores/30524/53rd-match-indian-premier-league-2020

Example Response ๐ŸŒ

Cricket API

{
    "success": true,
    "livescore": {
        "title": "Sunrisers Hyderabad vs Mumbai Indians, 56th Match",
        "current": "SRH - 145\/0 (16.2)",
        "batsman": "Wriddhiman Saha*",
        "batsmanrun": "57",
        "ballsfaced": "(43)",
        "fours": "7",
        "sixes": "1",
        "bowler": "Nathan Coulter-Nile*",
        "bowlerover": "3.2",
        "bowlerruns": "25",
        "bowlerwickets": "0",
        "partnership": "145(98)",
        "recentballs": "Data Not Found",
        "lastwicket": "... 0 0 4 1 | 0 4 1 1 0 1 | 1 0",
        "runrate": "CRR: 8.88",
        "commentary": [
            "16.2 Coulter-Nile to W Saha, no run, 139.1kph, ",
            "16.1 Coulter-Nile to Warner, 1 run, 124.4kph, length, nipping in off the pitch onto middle. Warner makes room and slaps it to deep point ",
            "15.5 Pattinson to Warner, no run, 139.7kph, backs away, cuts, but ends up miscuing it back down the pitch ",
            "15.4 Pattinson to W Saha, 1 run, swivels, one-legged, pulling it to the man in the deep behind square ",
            "15.3 Pattinson to Warner, 1 run, 118.2kph, back of a length, taking pace off, keeping it outside off for Warner to have to reach out. And he does connect this time, to guide it to third man ",
            "15.1 Pattinson to Warner, no run, 134.5kph, full, outside off, quick, just inside the tramline. Warner stretches, but can't quite connect ",
            "14.6 Coulter-Nile to Warner, 1 run, 130.6kph, length, nips back in, and Warner jumps away at the last moment with an opened bat face to steer it through point ",
            "14.4 Coulter-Nile to Warner, no run, skids through as it seams back in sharply to go under Warner's crouched swat, thudding off his thighs towards backward point ",
            "14.3 Coulter-Nile to Warner, no run, 136.4kph, serious bouncer, climbing back in. Nope, it's the circumstances that determines its ferocity, and with an 18 runs | 33 balls equation, this is gently left alone ",
            "14.2 Coulter-Nile to W Saha, 1 run, 136.9kph, full, on middle with the angle-in. Saha goes wristy, through mid-wicket ",
            "14.1 Coulter-Nile to W Saha, no run, 117kph, in-cutter into the tummy. Saha gets cramped in what looked like an initial attempt to cut, and so drops his wrists, opens his bat face and runs out to short third man ",
            "13.6 D Kulkarni to Warner, 2 runs, 105.4kph, and very comfortable. Around the fourth-stump, which Warner lines up to and punches through point ",
            "13.5 D Kulkarni to W Saha, 1 run, 127.6kph, full, on off, quiet flick, long-on "
        ],
        "teamone": "Data Not Found",
        "teamtwo": "Data Not Found",
        "update": "Sunrisers Hyderabad need 5 runs in 22 balls"
    }
}

Code Examples โ˜•

  • WordPress
## API Auth and Get data
function display_api_response() {
  $base_url = 'https://YOUR-API-Domain.com/cri.php?url=';
  $score_path = 'https://www.cricbuzz.com/live-cricket-scores/30524/53rd-match-indian-premier-league-2020';
  $url = $base_url.$score_path;
  $response = wp_remote_get($url);
  global $body;
  $body = json_decode( $response['body'], true );
}
add_action( 'init', 'display_api_response' );

Replace YOUR-API-Domain with your actual API Domain

  • Fetch API (Javascript)
var url = 'https://www.cricbuzz.com/live-cricket-scores/30524/53rd-match-indian-premier-league-2020';

async function fetchscore() {
    try {
        const response = await fetch('https://api.example.com/cri.php?url=' + url);
        const data = await response.json();
        console.log(data);
    } catch (exception) {
        console.log('Connection issue');
    }
}
fetchscore();

Free Deploy ๐Ÿ˜

  • Deploy on Heroku

Deploy

  • Deploy on Vercel

Deploy with Vercel

How Deploy Works? - https://github.com/mskian/cri-deploy

Development ๐Ÿฉ

git clone https://github.com/mskian/cricket-api.git
cd cricket-api
cd cri
php -S localhost:3001

Contributing ๐Ÿ™Œ

Your PR's are Welcome

Disclaimer ๐Ÿ—ƒ

  • This is not an Offical API from Cricbuzz - it's an Unofficial API
  • This is for Education Purpose only - use at your own risk on Production Site

All Credits Goes to https://www.cricbuzz.com/

My other Projects ๐Ÿค“

# Project Name Description
01 Live Cricket Score Static Site A Simple Scrape Method - Fetch the Live Cricket Score from espncricinfo.com using Nodejs and Cheerio.js
02 IPL Special Cricket API for Get the Live IPL Cricket Score
03 Live IPL Score Update on Telegram Get Live IPL cricket Score on Telegram
04 Live Cricket Score Wordpress Plugin (JS Version) Get Live Cricket Score on Wordpress site call API using Javascript Fetch API
05 Live Cricket Score Wordpress Plugin (Wp Remote URL) Get Live Cricket Score on Wordpress site call API using Wordpress HTTP Remote URL
06 PWA Web App Real-time Live Cricket Score Web app + PWA Built using Nuxt.js
07 Cricket API Nodejs JSON API Node.js Version
08 Cricket Score Widget Live Cricket Score Javascript Widget Build using Svelte JS

LICENSE ๐Ÿ“•

MIT

Comments
  • This site cannot be reached

    This site cannot be reached

    I was running php server in the localhost and entered the URL in the browser. But the site cannot be reached.

    I am using php -S localhost:6001 to run the server and entered the URL: http://localhost:6001/cri.php?url=https://www.cricbuzz.com/live-cricket-scores/38337/1st-odi-south-africa-tour-of-england-2022.

    But I was getting the following error in the terminal cricket_api_seerver

    cricket_api_browser

    opened by sumanth2002629 2
  • data does not fetching

    data does not fetching

    http://localhost/cricket-api/cri/cri.php?url=www.cricbuzz.com/cricket-match/live-scores

    {
      "success": true,
      "livescore": {
        "title": "India tour of England, 2021",
        "current": "Data Not Found",
        "batsman": "Data Not Found",
        "batsmanrun": "Data Not Found",
        "ballsfaced": "Data Not Found",
        "fours": "Data Not Found",
        "sixes": "Data Not Found",
        "bowler": "Data Not Found",
        "bowlerover": "Data Not Found",
        "bowlerruns": "Data Not Found",
        "bowlewickets": "Data Not Found",
        "partnership": "Data Not Found",
        "recentballs": "Data Not Found",
        "lastwicket": "Data Not Found",
        "runrate": "Data Not Found",
        "commentary": "Data Not Found",
        "teamone": "Data Not Found",
        "teamtwo": "Data Not Found",
        "update": "Data Not Found"
      }
    }
    
    question 
    opened by MuneebKhan1764 1
  • Errors related to partnership, recent balls and last wicket vars.

    Errors related to partnership, recent balls and last wicket vars.

    Sometimes the partnership shows last wicket data. When this happens recent balls show "Data Not Found" and recent balls data is shown by lastwicket var. Screenshot_20211127_125908

    bug 
    opened by sudhanshuprasad2002 2
  • Error in mixing second batsman and second bowler

    Error in mixing second batsman and second bowler

    Please refer to the images given below. Here when the 2nd batsman is not displayed on the site. The 2nd bowler stats is mixed with the 2nd batsman of the current playing team.

    Please also add the opponent team score also.

    01

    02

    bug 
    opened by sudhanshuprasad2002 5
  • Please add the following things

    Please add the following things

    Add Bowler's "M" "Economy" and also for fetching data of previous bowlers data as well. Also add 2nd Batsman stats and "SR" for batsman. please add these things

    enhancement 
    opened by sudhanshuprasad2002 4
Owner
Santhosh Veer
Blogger ๐Ÿ“ Web Developer ๐Ÿ”ง Open Source Lover ๐Ÿ’—
Santhosh Veer
A simple script i made that generate a valid http(s) proxy in json format with its geo-location info

Gev Proxy Generator GPG is a simple PHP script that generate a proxy using free services on the web, the proxy is HTTP(s) and it generate it in json f

gev 1 Nov 15, 2021
PHP cURL for feed Instagram Graph API

php-curl-instagram-graph PHP cURL for feed Instagram Graph API Script made based on the new (2020) Instagram API that requires authorization token gen

null 12 Apr 13, 2022
Transform your WordPress site into a modern GraphQL server: graphql-api.com.

GraphQL API for WordPress Transform your WordPress site into a modern GraphQL server: graphql-api.com. This plugin is the implementation for WordPress

GraphQL API 151 Dec 14, 2022
A PHP HttpClient for the Neo4j ReST API with MultiDB Support

NeoClient This repository has moved Neoxygen's NeoClient has been moved to https://github.com/graphaware/neo4j-php-client Version 3 of this library is

Neoxygen 120 Oct 19, 2022
PHP Curl ile letgo api kรผtรผphanesi oluลŸturuldu. php ile letgo giriลŸ yap.

Kendi LETGO API ile iลŸlemler gerรงekleลŸtirelim. // email iลŸlemleri $server = 'imap.gmail.com'; $user = '[email protected]'; $pass = 'password'; $port = 9

Gรถrkem Bayraktar 2 Nov 3, 2022
KTMB (Keretapi Tanah Melayu Berhad) Station Schedule Checker in PHP via MyRailTime 2.0's API

KTM Station Schedule Checker & Journey Planner in Web Form (PHP) KTMB (Keretapi Tanah Melayu Berhad) Station Schedule Checker & Journey Planner in Web

Sam Sam 1 Jun 24, 2022
A YOURLS plugin allowing the shortening of multiple URLs with one API request.

Bulk URL Shortening - a YOURLS plugin Plugin for YOURLS Plugin URI: github.com/tdakanalis/bulk_api_bulkshortener Description: A YOURLS plugin allowing

Themistoklis Dakanalis 6 Aug 27, 2022
Creating an all in one AI with a web UI to control it. Create your own AI server and/or sell API keys to other people to use your AI.

+ Currently taking an hour or two break to spend some time with the wife. - Then going to work on auto refreshing the chat and document ingestion so y

null 10 Jun 14, 2023
JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

Eboubaker Eboubaker 2 Jul 31, 2022
Live Helper Chat - live support for your website. Featuring web and mobile apps, Voice & Video & ScreenShare. Supports Telegram, Twilio (whatsapp), Facebook messenger including building a bot.

Live helper chat It's an open-source powered application, which brings simplicity and usability in one place. With live helper chat you can bring live

Live Helper Chat 1.7k Dec 29, 2022
SilverStripe live templates - Speed up development with SilverStripe live templates for PhpStorm and WebStorm

SilverStripe live templates My collection of live templates for WebStorm and PhpStorm, following PSR-2, using PHPDoc, and utilizing PHP 5.4 array shor

North Creation Agency 3 Feb 1, 2022
Improve Core Web Vital score for Magento 2 website

Magento 2 Optimization for Google Insights This modules allows you modify the HTML, Javascript, CSS, update the position, optimize CWV (Core Web Vital

Hoang hieu 9 Oct 25, 2022
Easily integrate custom-made NPS (Net Promoter Score) into your application

Laravel NPS Easily integrate custom-made NPS (Net Promoter Score) to your application. Installation You can install the package via composer: composer

H-FARM Innovation 48 Oct 27, 2022
This app is to measure the hand and eye co-ordination speed based on the score generated taken from Database

CoOrdinationSpeedTest Website link: https://skyward-punctures.000webhostapp.com/ Try this only when you are a psychiatrist ?? ?? This app runs as php

MANOJKUMAAR GOWDA 1 Jan 12, 2022
PDF API. JSON to PDF. PDF Template Management, Visual HTML Template Editor and API to render PDFS by json data

PDF Template Management, Visual HTML Template Editor and API to render PDFS by json data PDF ENGINE VERSION: development: This is a prerelease version

Ajous Solutions 2 Dec 30, 2022
๐ŸŒ Free Google Translate API PHP Package. Translates totally free of charge.

Google Translate PHP Free Google Translate API PHP Package. Translates totally free of charge. Installation Basic Usage Advanced Usage Language Detect

Levan Velijanashvili 1.5k Dec 31, 2022
Free ZIP Code API - Free Access to Worldwide Postal Code Data

About Zipcodebase - Free Zip Code API Zipcodebase is a zip code API that was founded in 2019 to solve common issues with postal code data. As we have

SaaS Industries 2 Nov 26, 2022
A simple library to work with JSON Web Token and JSON Web Signature

JWT A simple library to work with JSON Web Token and JSON Web Signature based on the RFC 7519. Installation Package is available on Packagist, you can

Luรญs Cobucci 6.8k Jan 3, 2023
Allows generate class files parse from json and map json to php object, including multi-level and complex objects;

nixihz/php-object Allows generate class files parse from json and map json to php object, including multi-level and complex objects; Installation You

zhixin 2 Sep 9, 2022
Json-normalizer: Provides generic and vendor-specific normalizers for normalizing JSON documents

json-normalizer Provides generic and vendor-specific normalizers for normalizing JSON documents. Installation Run $ composer require ergebnis/json-nor

null 64 Dec 31, 2022