{"id":15759291,"url":"https://github.com/karthikgangadhar/cricapi","last_synced_at":"2025-07-24T17:02:35.406Z","repository":{"id":56843903,"uuid":"110210007","full_name":"KarthikGangadhar/CricApi","owner":"KarthikGangadhar","description":"This is ruby gem for cricapi live data access","archived":false,"fork":false,"pushed_at":"2018-06-29T08:48:34.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T20:38:17.923Z","etag":null,"topics":["cricket-endpoint","fantasy-api","hashie","httparty","rake","rspec","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/CricApi","language":"Ruby","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/KarthikGangadhar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-10T06:14:03.000Z","updated_at":"2021-09-10T15:20:55.000Z","dependencies_parsed_at":"2022-08-26T22:50:22.759Z","dependency_job_id":null,"html_url":"https://github.com/KarthikGangadhar/CricApi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarthikGangadhar%2FCricApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarthikGangadhar%2FCricApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarthikGangadhar%2FCricApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KarthikGangadhar%2FCricApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KarthikGangadhar","download_url":"https://codeload.github.com/KarthikGangadhar/CricApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243459134,"owners_count":20294344,"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-endpoint","fantasy-api","hashie","httparty","rake","rspec","ruby","ruby-gem"],"created_at":"2024-10-04T10:04:35.689Z","updated_at":"2025-03-13T18:31:57.102Z","avatar_url":"https://github.com/KarthikGangadhar.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CricApi\n\nWelcome to cric-api. The live cricket score, player statistics and fantasy scorecard API allow you to get API data anytime, 24x7 at your fingertips. It's extremely simple, easy to use - with a huge collection of examples.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'CricApi'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install CricApi\n\n## Usage\n\nThe [CricApi](http://www.cricapi.com/), Free to use, super-high bandwidth, high performance Cricket API. Targeted at Developers and Cricket lovers.\n\n\nIn order to use the [CricApi](http://www.cricapi.com/) endpoints, u need to have an api_key which can use generated by signing into [cricapi](http://www.cricapi.com/). For testing purpose can use test_api_key \"TESTKEY0273\"\n\nThere are 8 endpoints, Usage is as Follow\n\n```ruby\n    require 'CricApi'\n    \n    api_key = \"TESTKEY0273\"\n    cricapi = CricApi::Request.new(api_key)\n```\n#### cricket endpoint \n\n```ruby \n   \n    cricapi.cricket\n    # =\u003e {\n  \t    \"ttl\": 2,\n  \t    \"v\": \"1\",\n  \t    \"cache\": true,\n  \t    \"data\": [\n    \t\t      {\n      \t\t\t \"unique_id\": \"1122751\",\n      \t\t\t \"description\": \"Mid West Rhinos 213/6 * v Mashonaland Eagles 321/10 \",\n      \t\t\t \"title\": \"Mid West Rhinos 213/6 * v Mashonaland Eagles 321/10 \"\n    \t\t      }\n    \t    ]\n    \t }\n```\n#### schedule endpoint\n    \t \n```ruby\n\n    cricapi.schedule\n    # =\u003e { \t\t\t\n  \t    \"data\": [\n    \t\t      {\n      \t\t\t \"unique_id\": \"will generate 1-2 days before match\",\n      \t\t\t \"name\": \"India v Sri Lanka at Kolkata, 1st Test - day 1\",\n      \t\t         \"date\": \"16 November 2017\"\n    \t\t      },\n    \t\t      {\n      \t\t\t \"unique_id\": \"will generate 1-2 days before match\",\n      \t\t\t \"name\": \"India v Sri Lanka at Kolkata, 1st Test - day 2\",\n      \t\t\t \"date\": \"17 November 2017\"\n    \t\t       }\n    \t\t    ]\t\t\n    \t }    \t \t    \n```\n\n#### cricketScore endpoint\nThis requires a match unique_id, which will be provide by cricket endpoint \n    \t \n```ruby\n\n    unique_id = \"1034809\"\n    cricapi.cricketScore(unique_id)\n    # =\u003e {\n  \t    \"matchStarted\": true,\n  \t    \"team-1\": \"England\",\n  \t    \"team-2\": \"India\",\n  \t    \"cache\": true,\n  \t    \"v\": \"1\",\n  \t    \"ttl\": 2,\n  \t    \"provider\": {\n    \t\t\"source\": \"Various\",\n    \t\t\"url\": \"https://cricapi.com/\",\n    \t\t\"pubDate\": \"2017-11-11T06:24:19.712Z\"\n  \t    },\n\t}   \t \t    \n```\n\n#### matches endpoint\n\n```ruby\n    cricapi.matches\n    # =\u003e {\n  \t    \"matches\": [\n    \t\t\t {\n      \t\t\t    \"unique_id\": 1124063,\n      \t\t\t    \"date\": \"2017-11-10T00:00:00.000Z\",\n      \t\t\t    \"team-2\": \"Band-e-Amir Region\",\n      \t\t\t    \"team-1\": \"Mis Ainak Region\",\n      \t\t\t    \"type\": \"First-class\",\n      \t\t\t    \"dateTimeGMT\": \"2017-11-07T04:30:00.000Z\",\n      \t\t\t    \"squad\": true,\n      \t\t\t    \"toss_winner_team\": \"Band-e-Amir Region\",\n      \t\t\t    \"matchStarted\": true\n    \t\t\t} \n    \t\t      ]\n           }\t\t\t\t    \t \t    \n```\n\n#### playerStats endpoint \nThis requires a players pid, which will be obtained [here](http://www.cricapi.com/players/) \n    \t \n```ruby\n\n    pid = \"32350\"\n    cricapi.playerStats(unique_id)\n    # =\u003e {\n  \t\t\t\"pid\": 35320,\n  \t\t\t\"profile\": \"\\n\\nSachin Tendulkar has been the most complete batsman of his time, the most prolific runmaker of all time, and arguably the biggest cricket icon the game has ever known. His batting was based on the purest principles: perfect balance, economy of movement, precision in stroke-making, and that intangible quality given only to geniuses - anticipation. If he didn't have a signature stroke - the upright, back-foot punch comes close - it's because he was equally proficient at each of the full range of orthodox shots (and plenty of improvised ones as well) and can pull them out at will.  \\n\\n\",\n \t\t\t\"imageURL\": \"http://cricapi.com/playerpic/35320.jpg\",\n  \t\t\t\"battingStyle\": \"Right-hand bat\",\n  \t\t\t\"bowlingStyle\": \"Right-arm offbreak, Legbreak googly\",\n  \t\t\t\"majorTeams\": \"India,Asia XI,Mumbai,Mumbai Indians,Yorkshire\",\n  \t\t\t\"currentAge\": \"44 years 186 days\",\n  \t\t\t\"born\": \"April 24, 1973, Bombay (now Mumbai), Maharashtra\",\n  \t\t\t\"fullName\": \"Sachin Ramesh Tendulkar\",\n  \t\t\t\"name\": \"Sachin Tendulkar\",\n  \t\t\t\"country\": \"India\",\n  \t\t\t\"playingRole\": \"Top-order batsman\"\n  \t\t}\n  \t\t \t \t    \n```\n\n#### playerFinder endpoint\nThis takes player name as input\n    \t \n```ruby\n\n    name = \"Tendulkar\"\n    cricapi.fantasySquad(name)\n    # =\u003e \n    #Array of players in the format: \n     \n    {\n  \t\t\"data\": [\n    \t\t\t  {\n      \t\t\t\t\"pid\": 35320,\n      \t\t\t\t\"fullName\": \"Sachin Ramesh Tendulkar\",\n      \t\t\t\t\"name\": \"Sachin Tendulkar\"\n    \t\t\t  }\n  \t\t\t]\n    }\t\t\n                                              \t\n\t  \t    \n```\n\n The remaining 2 are Fantasy API endpoints, Fantasy API are billable since they're designed to help you generate income by running Fantasy Cricket portals. Each hit is 1 credit. You get 250 credits free. Deducted from your prepaid account. \n\n#### fantasySummary endpoint\nThis requires a match unique_id, which will be provide by cricket endpoint \n    \t \n```ruby\n\n    unique_id = \"1034809\"\n    cricapi.fantasySummary(unique_id)\n    # =\u003e\n    #Array of teams of the format: \n     {\n  \t    \t\"team\": [{\n\t\t\t\"name\": \"Gloucestershire\",\n\t\t\t\"players\": [{ // active batsmen/bowlers/fielders only\n\t\t\t\"pid\": \"298564\",\n\t\t\t\"name\": \"WA Tavare\"\n\t\t}, ... ]\n\t\t}, {\n\t\t\t\"name\": \"Leicestershire\",\n\t\t\t\"players: [...]\n\t\t}]\n\t }\n\t \n\t#Inning-wise, Player-wise array of Batting scores of the format:\n\n\t[{\n\t\t\"title\": \"Gloucestershire 1st innings\",\n\t\t\"scores\": [\n\t\t\t[{\n\t\t\t\t\"pid\": \"298564\",                  // -----------------\u003e Use this with playerStats CricAPI for more info\n\t\t\t\t\"batsman\": \"WA Tavare\",\n\t\t\t\t\"dismissal-info\": \"c Cosgrove b Jones\",\n\t\t\t\t\"R\": \"7\",                   // -----------------\u003e Runs\n\t\t\t\t\"M\": \"14\",                  // -----------------\u003e Minutes Batted\n\t\t\t\t\"B\": \"13\",                  // -----------------\u003e Balls Played\n\t\t\t\t\"4s\": \"1\",                  // -----------------\u003e FOURs hit\n\t\t\t\t\"6s\": \"0\",                  // -----------------\u003e SIXes hit\n\t\t\t\t\"SR\": \"53.84\"                  // -----------------\u003e Strike Rate / 100 Balls\n\t\t\t}, ... ]\n\t\t]\n\t}, {\n\t\t\"title\": \"Gloucestershire 2nd innings\",\n    \t\"scores\": [ ... ]\n\t}, ...]   \t\n\t  \t    \n\t#Inning-wise, Player-wise array of Bowling scores of the format:\n\t\n\t[{\n\t\t\"title\": \"Bowling\",\n\t\t\"scores\": [\n\t\t\t[{\n\t\t\t\t\"pid\": \"6903\",                  // -----------------\u003e Use this with playerStats CricAPI for more info\n\t\t\t\t\"bowler\": \"CJ McKay\",\n\t\t\t\t\"O\": \"11\",                  // -----------------\u003e Overs bowled (decimal value)\n\t\t\t\t\"M\": \"1\",                  // -----------------\u003e Maidens bowled\n\t\t\t\t\"R\": \"42\",                  // -----------------\u003e Runs conceded\n\t\t\t\t\"W\": \"1\",                  // -----------------\u003e Wickets taken\n\t\t\t\t\"Econ\": \"3.81\",                  // -----------------\u003e Economy of runs per 6 balls\n\t\t\t\t\"0s\": \"48\"                  // -----------------\u003e Dot balls bowled\n\t\t\t}, ... ]\n\t\t]\n\t\t\t}, {\n\t\t\"title\": \"Bowling\",\n    \t\"scores\": [ ... ]\n\t}, ...]\n\t\n\t#Inning-wise, Player-wise array of Fielding scores of the format:\n\t\n\t[{\n\t\t\"title\": \"Fielding\",\n\t\t\"scores\": [\n\t\t\t[{\n\t\t\t\t\"pid\": \"6903\",                  // -----------------\u003e Use this with playerStats CricAPI for more info\n\t\t\t\t\"name\": \"CJ McKay\",\n\t\t\t\t\"catch\": 3,                  // -----------------\u003e Catches\n\t\t\t\t\"lbw\": 4,                  // -----------------\u003e LBWs\n\t\t\t\t\"stumped\": 2,                  // -----------------\u003e Stumped\n\t\t\t\t\"bowled\": 0                  // -----------------\u003e Bowled\n\t\t\t}, ... ]\n\t\t]\n\t}, {\n\t\t\"title\": \"Fielding\",\n    \t\"scores\": [ ... ]\n\t}, ...]\n\t\n\t \n```\n\n#### fantasySquad endpoint\t\nThis requires a match unique_id, which will be provide by cricket endpoint \t\n    \t \t\n```ruby\t\n\t\n    unique_id = \"1034809\"\t\n    cricapi.fantasySquad(unique_id)\t\n    # =\u003e \t\n    #Array of Squad entries in the format: \t\t\n\t{\n\t  \"squad\": [\n\t    {\n\t      \"name\": \"Ireland Women\",\n\t      \"players\": [\n\t        {\n\t          \"pid\": 1150585,\n\t          \"name\": \"Orla Prendergast\"\n\t        },\n\t        {\n\t          \"pid\": 418420,\n\t          \"name\": \"Laura Delany\"\n\t        },\n\t        {\n\t          \"pid\": 418423,\n\t          \"name\": \"Kim Garth\"\n\t\t\t}\n\t\t}\t\n\t]\n\t}                                    \t\t\n\t  \t    \t\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/karthikgangadhar/CricApi. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the CricApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[karthikgangadhar]/CricApi/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarthikgangadhar%2Fcricapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarthikgangadhar%2Fcricapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarthikgangadhar%2Fcricapi/lists"}