ape-cricket
The ape-cricket is a rest-api exported as Node.js module.
Description
The ape-cricket uses cricapi, Free to use, super-high bandwidth, high performance Cricket API. Targeted at Developers and Cricket lovers.
The endpoints exposed are as follows:
- apecricket.schedule( ) provides international fixtures
- apecricket.cricket( ) provides live scrores of ongoing match
- apecricket.upcomingMatches( ) provides upcoming match fixtures
- apecricket.cricketScore( ) provides detailed score card of the match
- apecricket.playerStats( ) provides players carrer info and stats
- apecricket.fantasySummary( ) provides match info and stats
- apecricket.fantasySquad( ) provides team players info
In order to use the above endpoints, u need to have an api_key which can use generated by signing into cricpapi. For testing purpose can use test_api_key "TESTKEY0273"
Installation
Installation is done using the npm install command:
$ npm install ape-cricket
In Node.js:
var apecricket = require("ape-cricket");
schedule
var api_key = "TESTKEY0273"
apecricket.schedule( api_key, function(response){
});
cricket
var api_key = "TESTKEY0273"
apecricket.cricket( api_key, function(response){
});
upcomingMatches
var api_key = "TESTKEY0273"
apecricket.upcomingMatches( api_key, function(response){
});
The endpoints cricketScore() and playerStats() require a string input field "unique_id" and "pid"(player_id). "unique_id" for each match is available from the cricket() endpoint response. and for "pid"(player_id) need to visit cricapi players page. usage is as follows:
cricketScore
var api_key = "TESTKEY0273"
var unique_id = "1123492"
apecricket.cricketScore( api_key, unique_id , function(response){
});
playerStats
var api_key = "TESTKEY0273"
var pid = 35320;
apecricket.playerStats( api_key, pid , function(response){
});
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.
fantasySummary
var unique_id = "1123492"
apecricket.fantasySummary(api_key, unique_id, function (response) {
console.log(response);
});
fantasySquad
var unique_id = "1123492"
apecricket.fantasySquad(api_key, unique_id, function (response) {
console.log(response);
});