Recommend this page to a friend! |
Download .zip |
Info | View files (15) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2023-08-16 (1 month ago) | Not yet rated by the users | Total: 10 This week: 1 | All time: 11,102 This week: 108 |
Version | License | PHP version | Categories | |||
balldontlie-service 1.0 | The PHP License | 5 | PHP 5, Games, Web services |
Description | Author slvler Contributor | |
This package is specific mainly for applications used in United States .
This package can get NBA games and players with Balldontlie API. |
This package provides a convenient wrapper to the Balldontlie API for Laravel applications.
To install this package tou can use composer:
composer require slvler/balldontlie-laravel
Balldontlie::players(237);
it returns an json with player:
{
"data":[
{
"id":237,
"first_name":"LeBron",
"last_name":"James",
"position":"F",
"height_feet": 6,
"height_inches": 8,
"weight_pounds": 250,
"team":{
"id":14,
"abbreviation":"LAL",
"city":"Los Angeles",
"conference":"West",
"division":"Pacific",
"full_name":"Los Angeles Lakers",
"name":"Lakers"
}
}
...
],
"meta": {
"total_pages": 50,
"current_page": 1,
"next_page": 2,
"per_page": 25,
"total_count": 9999
}
}
Balldontlie::teams(14);
it returns an json with team:
{
"data": [
{
"id":14,
"abbreviation":"LAL",
"city":"Los Angeles",
"conference":"West",
"division":"Pacific",
"full_name":"Los Angeles Lakers",
"name":"Lakers"
},
...
],
"meta": {
"total_pages": 1,
"current_page": 1,
"next_page": null,
"per_page": 30,
"total_count": 30
}
}
Balldontlie::games(1);
it returns an json with games:
{
"data": [
{
"id":1,
"date":"2018-10-16T00:00:00.000Z",
"home_team_score":105,
"visitor_team_score":87,
"season":2018,
"period": 4,
"status": "Final",
"time": " ",
"postseason": false,
"home_team":{
"id":2,
"abbreviation":"BOS",
"city":"Boston",
"conference":"East",
"division":"Atlantic",
"full_name":"Boston Celtics",
"name":"Celtics"
},
"visitor_team":{
"id":23,
"abbreviation":"PHI",
"city":"Philadelphia",
"conference":"East",
"division":"Atlantic",
"full_name":"Philadelphia 76ers",
"name":"76ers"
},
},
...
],
"meta": {
"total_pages": 1877,
"current_page": 1,
"next_page": 2,
"per_page": 25,
"total_count": 46911
}
}
Balldontlie::stats();
it returns an json with stats:
{
"data": [
{
"id":29,
"ast":2,
"blk":2,
"dreb":8,
"fg3_pct":0.25,
"fg3a":4,
"fg3m":1,
"fg_pct":0.429,
"fga":21,
"fgm":9,
"ft_pct":0.8,
"fta":5,
"ftm":4,
"game":{
"id":1,
"date":"2018-10-16T00:00:00.000Z",
"home_team_id":2,
"home_team_score":105,
"season":2018,
"visitor_team_id":23,
"visitor_team_score":87
},
"min":"36:49",
"oreb":2,
"pf":3,
"player":{
"id":145,
"first_name":"Joel",
"last_name":"Embiid",
"position":"F-C",
"team_id":23
},
"pts":23,
"reb":10,
"stl":1,
"team":{
"id":23,
"abbreviation":"PHI",
"city":"Philadelphia",
"conference":"East",
"division":"Atlantic",
"full_name":"Philadelphia 76ers",
"name":"76ers"
},
"turnover":5
},
...
],
"meta": {
"total_pages": 2042,
"current_page": 1,
"next_page": 2,
"per_page": 25,
"total_count": 51045
}
}
composer test
The MIT License (MIT). Please see License File for more information.
You're very welcome to contribute. Please see CONTRIBUTING for details.
Files |
File | Role | Description | ||
---|---|---|---|---|
.github (1 directory) | ||||
config (1 file) | ||||
src (4 files, 1 directory) | ||||
tests (2 directories) | ||||
.styleci.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE.md | Lic. | License text | ||
phpunit.xml | Data | Auxiliary data | ||
phpunit.xml.dist | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Facades (1 file) | ||||
Balldontlie.php | Class | Class source | ||
BalldontlieApiWrapper.php | Class | Class source | ||
BalldontlieServiceProvider.php | Class | Class source | ||
HttpResponse.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.