PlayByPlay Request



Base URL http://data.nba.net/prod/v1/{gameDate}/{gameId}_pbp_{period}.json
Default Response Format JSON
Domain Data
Section Prod
Category Game
Request Class JasonRoman\NbaApi\Request\Data\Prod\Game\PlayByPlayRequest

Runnable Example:

<?php

require_once 'vendor/autoload.php'; // skip this if using a framework / autoloading elsewhere

use JasonRoman\NbaApi\Client\Client;
use JasonRoman\NbaApi\Request\Data\Prod\Game\PlayByPlayRequest;

$client = new Client();

$request  = PlayByPlayRequest::fromArrayWithExamples();
$response = $client->request($request);
The following code will run and return data, as it uses both example and default values. The code shows every available parameter that can be set on this request.
<?php

require_once 'vendor/autoload.php'; // skip this if using a framework / autoloading elsewhere

use JasonRoman\NbaApi\Client\Client;
use JasonRoman\NbaApi\Request\Data\Prod\Game\PlayByPlayRequest;

$client = new Client();

$request = PlayByPlayRequest::fromArray([
    'gameDate' => new \DateTime('2017-02-01'),
    'gameId'   => '0021600732',
    'period'   => 1,
]);

$response = $client->request($request);

 Example URL:

Click the icon to copy the URL to your clipboard, or click the link below to open the raw result in a new window.

http://data.nba.net/prod/v1/20170201/0021600732_pbp_1.json


PHP Result:

Click the button to return the result as a PHP array and PHP object.

gameDate

Required? Yes
Type \DateTime
Default Value 2024-12-05

gameId

Required? Yes
Type string
Regex Format: /^\d{10}$/

period

Required? Yes
Type int
Range: Min: 1

Change any of the filterable values here and submit the form to get results with your chosen filters. This will also give you the corresponding URL as well as the code used to generate the result.



This site has no official affiliation with the National Basketball Association or any other 3rd-party entities listed on this site.
© 2024 Jason Roman