Giter Club home page Giter Club logo

ape-cricket's Introduction

ape-cricket

NPM

The ape-cricket is a rest-api exported as Node.js module.

Build Status npm version Node.js Version Known Vulnerabilities

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.news( ) provides updated cricket news
  • apecricket.upcomingMatches( ) provides upcoming match fixtures
  • apecricket.cricketScore( ) provides detailed score card of the match
  • apecricket.playerStats( ) provides players carrer info and stats
  • apecricket.playerFinder( ) provides players ids matching given name string
  • 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:

// Load the full build. 
var apecricket = require("ape-cricket");

schedule

//user api_key
var api_key = "TESTKEY0273"
// calling a endpoint to get response.
apecricket.schedule( api_key, function(response){ 
    // response will be json data of upcoming cricket matches
});

cricket

//user api_key
var api_key = "TESTKEY0273"
// calling a endpoint to get response.
apecricket.cricket( api_key, function(response){ 
    // response will be json data of upcoming cricket matches
});

news

//user api_key
var api_key = "TESTKEY0273"
// calling a endpoint to get response.
apecricket.news( api_key, function(response){ 
    // response will be json data of upcoming cricket matches
});

upcomingMatches

//user api_key
var api_key = "TESTKEY0273"
// calling a endpoint to get response.
apecricket.upcomingMatches( api_key, function(response){ 
    // response will be json data of upcoming cricket matches
});

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

//user api_key
var api_key = "TESTKEY0273"
//match id
var unique_id = "1123492"
// calling a endpoint to get response.
apecricket.cricketScore( api_key, unique_id , function(response){ 
   // response will be json data of mentioned unique_id
});

playerStats

//user api_key
var api_key = "TESTKEY0273"
// player id
var pid = 35320;
// calling a endpoint to get response.
apecricket.playerStats( api_key, pid , function(response){ 
   // response will be json data of mentioned player
});

playerfinder

//user api_key
var api_key = "TESTKEY0273"
// player id
var name = "sach";
// calling a endpoint to get response.
apecricket.playerFinder( api_key, name , function(response){ 
   // response will be json data of matching player ids
});

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

//match id
var unique_id = "1123492"
// calling a endpoint to get response.
apecricket.fantasySummary(api_key, unique_id, function (response) {
   // response will be json data of mentioned unique_id
   console.log(response);
});

fantasySquad

//match id
var unique_id = "1123492"
// calling a endpoint to get response.
apecricket.fantasySquad(api_key, unique_id, function (response) {
   // response will be json data of mentioned unique_id
   console.log(response);
});

ape-cricket's People

Contributors

karthikgangadhar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ape-cricket's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.