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.
Step Two: Get the Match Key. You can get the Match Key from Recent Match API & Schedule API.
To get the season based match key, refer the Recent Season API.
The "Access Denied" error occurred when your app generated bill is on overdue
In the case of "InvalidAccessToken" error, 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.
Here are the coverage details
For the Pull-Based approach, To get the updates on a regular basis you need to call the API in the following frequencies.
Match API call frequency: Make sure to call the Match API at the right frequency to get the instant match updates. Call for every 1 hour or a day.
Schedule API: Call it once a day and cache it locally on the user's device.
Auth API: Call it once a day and cache it locally on the user's device.
Note: Call the Auth API, whenever it throws "InvalidAccessToken" error.
Yes, The data can be saved only in Enterprise Plan. All the other plans, do not have rights to save the data.
The sample PHP source code is available here, 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.
Yes, We provide the widgets for all the API's. Use the following iframe widgets. Also, refer the use case
<iframe id="cricketapi_widget" src="http://widget.cricketapi.com/widget_v2/recent_matches/?key=APP-KEY&widget_size=mini" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>
Sample Live Match
<iframe id="cricketapi_widget" src="https://widget.cricketapi.com/widget_v2/match/dev_season_2014_q9/?key=APP-KEY&widget_size=mini" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>
Completed Match
<iframe id="cricketapi_widget" src="https://widget.cricketapi.com/widget_v2/match/nzeng_2018_one-day_04/?key=APP-KEY&widget_size=mini" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>
<iframe id="cricketapi_widget" src="https://widget.cricketapi.com/widget_v2/schedule/?key=APP-KEY&widget_size=mini" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>`
<iframe id="cricketapi_widget" src="http://widget.cricketapi.com/widget_v2/recentseasons/?key=APP-KEY&widget_size=micro" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>
<iframe id="cricketapi_widget" src="http://widget.cricketapi.com/widget_v2/recent_matches/?season_key=pslt20_2018&key=APP-KEY&widget_size=micro" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>
<iframe id="cricketapi_widget" src="http://widget.cricketapi.com/widget_v2/series/pslt20_2018/stats/?key=APP-KEY&show_stats=1" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</
iframe>
<iframe id="cricketapi_widget" src="http://widget.cricketapi.com/widget_v2/series/pslt20_2018/stats/?key=APP-KEY&show_points_table=1" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>
<iframe id="cricketapi_widget" src="http://widget.cricketapi.com/widget_v2/news_aggregation/?key=APP-KEY&widget_size=micro" frameborder="0" allowtransparency="true" xtarget="_blank" style="border:0px;min-height: 400px;min-width: 350px;margin-left: auto;margin-right: auto;display: block;width: 100%;">Loading…</iframe>
Use the Status Overview of the Match API. To get the properties, refer here
Yes, We provide the Data Review Checkpoint in the case of broadcast delay or any other match delays. Refer, Data Review Checkpoint docs
We provide the Wicket types to identify the type of wicket. To get the property of wicket, refer Wicket Type Property
We provide the Player Object, to get the complete player information. Refer, Player Object