Entities & Entity Endpoints
Entity Endpoints:
- Client.get_entities(start: int = 0, limit: int = 100, include_team: bool = True, league: Optional[str] = None, include_count: bool = False) Union[List[jockmkt_sdk.objects.Entity], Tuple[List[jockmkt_sdk.objects.Entity], int]]
fetch entities (players of any sport). The user will have to paginate.
- Parameters
start (int, optional) – page at which the user wants to start their search, default: 0 (first page of entities)
limit (int, optional) – number of entities the user wants to display, default: 100 (displays 100 entities)
include_team (bool, optional) – include team information for the entity, default: False
league (str, optional) – filter by league, must be one of: [‘nba’, ‘nfl’, ‘nhl’, ‘pga’, ‘mlb’, ‘nascar’]
include_count (bool, optional) – include the count of available entities for this request as part of a tuple in the return value
- Returns
a list of league-specific Entity objects, or a tuple of the list and the available entity count.
- Return type
List[objects.Entity] | Tuple[List[objects.Entity], int]
- Client.get_entity(entity_id: str, include_team: bool = False) jockmkt_sdk.objects.Entity
fetch a specific entity based on their entity id
- Parameters
- Returns
a league-specific entity object, one of:
objects.NBAEntity,objects.NFLEntity,objects.NHLEntity,objects.NascarEntity,objects.PGAEntity,MLBEntitywhich are all children of theobjects.Entity- Return type
entities = client.get_entities()
entity = client.get_entity(entity_id="en_6025693d374b384994316c1e13f40416")
These methods return league-specific entity objects. get_entities returns a list of them, get_entity returns information about one specific entity.
for entity in entities:
print(entity)
Returns:
* an objects.Entity object, which is then filtered to their specific league.
Entity Objects
All entities contain the following information:
- class jockmkt_sdk.objects.Entity(entity: dict)
parent class for all entity objects, containing all universal fields shared between entity types
the user can print any entity object via print(entity) – see docs for information regarding responses
- Variables
entity_id – the entity’s ID, which can be used to search for a specific entity’s information
league – the league in which the entity plays
name – the entity’s full name
first_name – the entity’s first name
last_name – the entity’s last name
updated_at – when the entity was last updated
news – a dict containing news related to the entity
- class jockmkt_sdk.objects.NBAEntity(entity)
NBA-specific entity data
- Variables
team_id – the entity’s team_id for use collecting team info
team – a dict containing team-related information
preferred_name – player’s preferred name
position – player’s position
height – player’s height
weight – player’s weight
jersey_number – player’s jersey number
college – player’s college
birthdate – player’s birthdate
rookie_year – player’s rookie year
status – whether the player is currently active
injury_status – player’s current injury status (day-to-day, injured reserve, etc.)
injury_type – type of injury (concussion, knee, etc.)
- class jockmkt_sdk.objects.NFLEntity(entity)
NFL-specific entity data
- Variables
team_id – the entity’s team_id for use collecting team info
team – a dict containing team-related information
preferred_name – player’s preferred name
position – player’s position
height – player’s height
weight – player’s weight
jersey_number – player’s jersey number
college – player’s college
birthdate – player’s birthdate
rookie_year – player’s rookie year
status – whether the player is currently active
injury_status – player’s current injury status (day-to-day, injured reserve, etc.)
injury_type – type of injury (concussion, knee, etc.)
- class jockmkt_sdk.objects.NHLEntity(entity)
NHL-specific entity data
- Variables
team_id – the entity’s team_id for use collecting team info
team – a dict containing team-related information
preferred_name – player’s preferred name
position – player’s position
height – player’s height
weight – player’s weight
jersey_number – player’s jersey number
handedness – is the player right or left-handed
rookie_year – player’s rookie year
status – whether the player is currently active
injury_status – player’s current injury status (day-to-day, injured reserve, etc.)
injury_type – type of injury (concussion, knee, etc.)
- class jockmkt_sdk.objects.PGAEntity(entity)
PGA-specific entity data
- Variables
preferred_name – player’s preferred name
birthday – player’s birthday
height – player’s height
weight – player’s weight
college – player’s attended college - not applicable to international players
rookie_year – player’s rookie year
country – player’s country of origin
injury_status – player’s current injury status (day-to-day, injured reserve, etc.)
injury_type – type of injury (concussion, knee, etc.)
- class jockmkt_sdk.objects.NASCAREntity(entity)
Nascar-specific entity data
- Variables
team_id – the entity’s team_id for use collecting team info
team – a dict containing team-related information
points_eligible – is the driver eligible to score points
in_chase – is the driver in the chase
cars – a list of cars that the driver races
birthday – driver’s birthday
birthplace – where the driver was born
rookie_year – when did the driver first start racing
status – is the driver active or inactive
injury_status – is driver in, out or questionable (day-to-day, etc.)
injury_type – type of injury the driver is experiencing
- class jockmkt_sdk.objects.MLBEntity(entity)
MLB-specific entity data
- Variables
team_id – the entity’s team_id for use collecting team info
team – a dict containing team-related information
preferred_name – player’s preferred name
position – player’s position
jersey_number – player’s jersey number
college – player’s alma mater
debut – player’s rookie year and date
status – whether the player is currently active
birthdate – player’s birthdate
injury_status – player’s current injury status (day-to-day, injured reserve, etc.)
injury_type – type of injury (concussion, knee, etc.)