-
Notifications
You must be signed in to change notification settings - Fork 12
/
example.php
39 lines (25 loc) · 1.02 KB
/
example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload
use MySportsFeeds\MySportsFeeds;
$data_query = new MySportsFeeds('1.2', true);
$data_query->authenticate('<YOUR_API_KEY>', '<YOUR_ACCOUNT_PASSWORD>');
$data = $data_query->getData(
'nba', // league
'2016-2017-regular', // season identifier
'player_gamelogs', // feed name
'json', // format (must be one of: "csv", "json", or "xml")
// add any number of additional valid parameters, with "name=value" format
'player=stephen-curry'
);
var_dump($data);
$data_query = new MySportsFeeds('2.0', true);
$data_query->authenticate('<YOUR_API_KEY>', 'MYSPORTSFEEDS');
$data = $data_query->getData(
'nba', // league
'2016-2017-regular', // season identifier
'seasonal_player_gamelogs', // feed name
'json', // format (must be one of: "csv", "json", or "xml")
// add any number of additional valid parameters, with "name=value" format
'player=stephen-curry'
);
var_dump($data);