Here is the procedure to call the API.
Step One: You need to get the Access Token to access the API. Call the Auth API using the following CURL Command.
$ curl -X POST \ -d "access_key=YOUR_ACCESSKEY" \ -d "secret_key=YOUR_SECRETKEY" \ -d "app_id=YOUR_APPID" \ -d "device_id=YOUR_DEVICEID" \ https://rest.cricketapi.com/rest/v2/auth/
access_key & secret_key will be provided upon providing the App details on your app page.
app_id can be any string. It is the ID for the app.
device_id can be any string. It is a device identification id.
To get the season based match key, refer the Recent Season API.
There are several reasons for "Access Denied" error. Here is the list of possibilities and the corresponding points which may help you rectify the error.
If you do not have an access to the match which you request, it may throw "Access Denied" error. In this case, Check your plans Match Access rights.
If you do not have an access to the API which you try to access, it may throw "Access Denied" error. In this case, Check your plans API Access rights.
If you do not have an access to the schedule which you try to access, it may throw "Access Denied" error. In this case, check your plans Schedule Access rights.
In the case of"Invalid Access Token", you need to re-generate the access token. Generally, you need to re-generate the access token for every 24 hours from the time you generated the access token.
ICC matches (Men) - Full Members Matches only IPL matches Champions League Big Bash Caribbean League Ram Slam T20 League Pakistan Super League T20 Africa T20 Cup Bangladesh Premier League
And the following leagues which we have added in 2017,
ICC Women's World Cup 2017 T20 Global League 2017 Tamil Nadu Premier League 2017 Karnataka Premier League 2017 Indian Women’s Tour of South Africa T20 2018
In the year 2018, We have extended it to the following: NatWest T20 2018 South Africa Vs. Bangladesh Women 2018 India Vs. England Women 2018 Women's Tri Series, Women's Asia Cup 2018 More ICC Women's matches from the quarter of the 2018 year.
The Same information is available here https://www.cricketapi.com/docs/coverage/
The Business Plan is a Pull-Based Approach whereas the Enterprise Plan is a Push - Notification. In the Pull-Based approach, you have to call the API manually every time. In the Push Notification, you do not need to call the server every time. Cricket API Push Notification will serve the data automatically on your end, here you no need to call the API repeatedly to fetch the data. Push is must faster than pull-based approach
The Business Plan does not provide the Server Access whereas for the Enterprise Plan we give the Server Access.
The Business Plan has 3,60,000 Free Request, and the Enterprise Plan has 900,000 Free Request.
In the Enterprise Plan, you get the Priority Technical Support.
How to choose a plan for Cricket Fantasy Game website or application? If you have the logic of Cricket Fantasy Game i.e if you have the logic to calculate the Fantasy Player Credit Value and the Fantasy Match Points then you need to choose Live Score & Stats API. If you do not have an logic for Cricket Fantasy Game, the Fantasy API helps you with Fantasy Player Credit Value and the Fantasy Match Points. You do not need to calculate on your end. In this case, choose the Fantasy API.
How to get the regular updates of Cricket API? For the Pull-Based approach, To get the updates on a regular basis you need to call the API daily once.
When the plan will get activated and how to activate the plan? Upon purchase, the plan can be activated any time from App details page. The plan Validity starts only when you activate the plan. Use the "Activate" button to activate your plan.
What to do if the free request/ Usage gets over?
The free request can be re-charged using the Usage Plans.
To get additional 3,36,000 request, purchase the Usage 360K plan. To get additional 12,00,000 requests, purchase the usage 1.2M plan.
Can the data be saved? The data can be saved only in Enterprise Plan. All the other plans, do not have rights to save the data.
Can you provide the PHP sample code?
The sample PHP source code is available in https://gist.github.com/Rajesh-jai/f98476576b0af594885a, it will help you for the development.
In the enclosed PHP Code, you can update lzconfig.php with your CricketAPI app details. In example.php we have mentioned how to use each API.
For Windows users sometimes the PHP will have outdated HTTPS certificates, here is the solution for it https://gist.github.com/Rajesh-jai/5399d874ef98bcf591a2
Sample Live Match
SEASON RECENT MATCHES
Use the Status Overview of the Match API.
Yes, We provide the Data Review Checkpoint in the case of broadcast delay or any other match delays. Refer, https://www.cricketapi.com/docs/Reference/Properties/#match-review-checkpoint
How do we know the wicket type? We provide the Wicket types. To get the property of wicket, refer https://www.cricketapi.com/docs/Reference/Properties/#wicket-types
How to get the complete player information? We provide the Player Object, to get the complete player information. Refer, https://www.cricketapi.com/docs/Reference/Player-Object/ (Not sure about this question)
Not sure, what plan to choose? Just get in touch us. We are committed to providing a solution to all cricket data requirements. Feel free to write your technical questions, to know about best practice and guidelines.