{"id":21757832,"url":"https://github.com/sanwebinfo/cricket-api","last_synced_at":"2025-04-13T12:09:14.765Z","repository":{"id":213583692,"uuid":"688577018","full_name":"sanwebinfo/cricket-api","owner":"sanwebinfo","description":"Free Live Cricket Score JSON API -  Cricket API","archived":false,"fork":false,"pushed_at":"2024-01-05T07:38:23.000Z","size":275,"stargazers_count":60,"open_issues_count":1,"forks_count":44,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T12:09:01.491Z","etag":null,"topics":["cricket","cricket-api","cricket-app","cricket-data","cricket-score","cricket-stats","json","php","xml"],"latest_commit_sha":null,"homepage":"https://sanwebinfo.github.io/cricket-api/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanwebinfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-07T16:30:15.000Z","updated_at":"2025-04-05T16:46:44.000Z","dependencies_parsed_at":"2023-12-26T09:33:27.658Z","dependency_job_id":"ba693c35-9939-459d-8cc4-9378a527ad52","html_url":"https://github.com/sanwebinfo/cricket-api","commit_stats":null,"previous_names":["sanwebinfo/cricket-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanwebinfo%2Fcricket-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanwebinfo%2Fcricket-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanwebinfo%2Fcricket-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanwebinfo%2Fcricket-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanwebinfo","download_url":"https://codeload.github.com/sanwebinfo/cricket-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710448,"owners_count":21149190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cricket","cricket-api","cricket-app","cricket-data","cricket-score","cricket-stats","json","php","xml"],"created_at":"2024-11-26T11:17:15.301Z","updated_at":"2025-04-13T12:09:14.745Z","avatar_url":"https://github.com/sanwebinfo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Free Cricket API 🍔\n\nCricket API - Live Cricket Score JSON API 🏏  \n\n***PHP, Node.js and deno Cricket API was not working due to the Cricbuzz Mobile site being Fully Redesigned - The full Site Structure was Changed it's a bit complex to get data - Please Consider using this Python Cricket API Version - Breaking Changes: JSON API Structure was changed update your app or website according to the changes in JSON data***  \n\nunofficial API Data Fetched from `Cricbuzz.com`  \n\nThis is an unofficial API and not Linked or Partnered with Any Brands/Company.  \n\n\u003e **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 or create Docker Container - \u003chttps://github.com/sanwebinfo/cricket-api?tab=readme-ov-file#free-deploy-\u003e**  \n\n## How it Works? 🤔\n\nScrape the data using `BeautifulSoup` and export a output via JSON using `Flask` micro web framework.\n\nEverything is scraped live and shown to end users in realtime.\n\nExample: **API URL 🌐**\n\n```sh\n# Copy the 5 digit code from cricbuzz Current Live Match URL \nhttp://127.0.0.1:5000/score?id=\u003cMatch ID\u003e\n```\n\n## Requirements and Features 📑\n\n- Python 3\n- install Required Modules via `requirements.txt`\n- Virtual Environment for Running Flask server\n- CORS Header\n- Multiple timezone Support for get the Match Starting time\n- Self-hosting support with gunicorn\n- Nginx, Apache2 or Lightspeed for support Proxy\n- HTTPS (For Secure SSL Connections)  \n\n## Installation 🍯\n\n- Download or Clone Repo to your Server/localhost\n\n```sh\ngit clone https://github.com/sanwebinfo/cricket-api\ncd cricket-api/api\n\n## install python env\nsudo apt install python3-venv\n\n## Create Virtual Env\npython3 -m venv venv\n\n## Activate Virtual Env\nsource venv/bin/activate\n\n## install Modules\npython3 -m pip install -r requirements.txt\n\n## verify\npython3 -m flask --version\n\n## start the dev server \nflask --app index.py --debug run --host=0.0.0.0 --port=5000\n\n## Exit from Virtual Env\ndeactivate\n```\n\n- Test the API\n\n```sh\n## API Home page\nhttp://127.0.0.1:5000/\n\n## GET Match data\nhttp://127.0.0.1:5000/score?id=\u003cMatch ID\u003e\n```\n\n### Example Response 🌐\n\n![Cricket API](https://raw.githubusercontent.com/sanwebinfo/cricket-api/main/images/screenshot.jpg)  \n\n```json\n{\n    \"title\": \"Australia vs Pakistan, 2nd Test - Live Cricket Score\",\n    \"update\": \"Day 1: 3rd Session\",\n    \"livescore\": \"AUS 168/3 (60)\",\n    \"runrate\": \"CRR: 2.8\",\n    \"batterone\": \"Travis Head\",\n    \"batsmanonerun\": \"5\",\n    \"batsmanoneball\": \"(5)\",\n    \"batsmanonesr\": \"100\",\n    \"battertwo\": \"Marnus Labuschagne\",\n    \"batsmantworun\": \"36\",\n    \"batsmantwoball\": \"(98)\",\n    \"batsmantwosr\": \"36.73\",\n    \"bowlerone\": \"Shaheen Afridi\",\n    \"bowleroneover\": \"19\",\n    \"bowleronerun\": \"61\",\n    \"bowleronewickers\": \"0\",\n    \"bowleroneeconomy\": \"3.21\",\n    \"bowlertwo\": \"Aamer Jamal\",\n    \"bowlertwoover\": \"12\",\n    \"bowlertworun\": \"37\",\n    \"bowlertwowickers\": \"1\",\n    \"bowlertwoeconomy\": \"3.08\"\n}\n```\n\n## Code Examples ☕\n\n- WordPress\n\n```php\nfunction display_api_response() {\n  $base_url = 'http://127.0.0.1:5000/score?id=';\n  $match_id = '123456';\n  $url = $base_url.$match_id;\n  $response = wp_remote_get($url);\n  global $body;\n  $body = json_decode( $response['body'], true );\n}\nadd_action( 'init', 'display_api_response' );\n```\n\nReplace `http://127.0.0.1:5000` with your API URL  \n\n- Fetch API (Javascript)\n\n```js\nvar match_id = '123456';\n\nasync function fetchscore() {\n    try {\n        const response = await fetch('http://127.0.0.1:5000/score?id=' + match_id);\n        const data = await response.json();\n        console.log(data);\n    } catch (exception) {\n        console.log('Connection issue');\n    }\n}\nfetchscore();\n```\n\n## Free Deploy 😍\n\n- Deploy on Vercel\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fsanwebinfo%2Fcricket-api%2Ftree%2Fmain%2Fapi)  \n\n## Development\n\n- Update Submodule\n\n```sh\ngit submodule update --remote --merge\n```\n\n## Contributing 🙌\n\nYour PR's are Welcome\n\n## Disclaimer 🗃\n\n- This is not an Offical API from Cricbuzz - it's an Unofficial API\n- This is for Education Purpose only - use at your own risk on Production Site\n\nAll Credits Goes to \u003chttps://www.cricbuzz.com/\u003e\n\n## LICENSE 📕\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanwebinfo%2Fcricket-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanwebinfo%2Fcricket-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanwebinfo%2Fcricket-api/lists"}