The NBA Shot Charts resource returns information about every shot taken in the NBA. It returns the location in x,y format, the shot type (hook, jump, layup, dunk), and whether or not the shot was made, as well as when the shot was taken in the game.
Integer. The ID for the player. Player IDs can be found from the players resource. Without a Player ID, all players will be returned.
Integer. The internal ID of the team. Team IDs can be found from the teams resource.
Integer. The internal ID of the opposing team. Team IDs can be found from the teams resource.
Integer. The internal ID of the game. Game IDs can be found from the games resource.
String. The season that the game was played in. Must be in YYYY format. If a game was played in 2015, but the season started in 2014 it will be listed under the 2014 season.
Enum. Possible values include: Layup, Jump, Hook, Dunk, Alley Oop, Tip. More details about the shot type will be returned. For example, if you pass Jump for this argument you will get Running Jump Shots, Fadeaway Jump Shots, Step Back Jump Shots, and Floating Jump Shots, just to name a few.
Integer. Number of the period that the shot took place in. .
<?php $url = 'http://api.probasketballapi.com/shots'; $api_key = '__YOUR__API__KEY__'; $query_string = 'api_key='.$api_key.'&opponent_id=1610612753&shot_type=Hook'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($ch); curl_close($ch); echo $result; ?>