Segments, Genres and Subgenres
Learn to fetch details for segments, genres, and sub-genres using the Discovery API.
We'll cover the following
Segment details
Segments are top-level classifications alongside types. They represent the primary genre of entities such as events and attractions. Some examples of segments include sports, music, and film.
The Discovery API offers a segments endpoint that we can use to fetch details for a particular segment. The diagram below gives an overview of this endpoint:
The URL for this endpoint is as follows:
https://app.ticketmaster.com/discovery/v2/classifications/segments/{id}
Here, {id}
is the ID of the segment we want to fetch the details for. Apart from this URL parameter, we can provide a couple of optional query parameters as well. The table below gives an overview of all these parameters:
Parameter | Type | Category | Description |
| string | required | The ID of the segment we want the details for. |
| string | optional | The locale in ISO code format. Multiple comma-separated values can be provided. When omitting the country part of the code (only |
| array[string] | optional | If provided, the results are filtered based on the domain they are available on. |
The response JSON object contains the following properties:
Property | Type | Description |
| object | This contains a link to the current dataset. |
| object | This contains details regarding the related genres and sub-genres. |
| string | The ID of the segment. |
| string | The primary ID of the segment. |
| string | The name of the segment. |
| string | The locale in which the content is returned. |
Segments are top-level classifications—they contain related genres, which further contain related subgenres. Details regarding these related genres and subgenres are contained within the _embedded
property in the response object.
Let's make a call to this endpoint using the segment IDs in the table below:
Segment | ID |
Sports | KZFzniwnSyZfZ7v7nE |
Music | KZFzniwnSyZfZ7v7nJ |
Arts & Theater | KZFzniwnSyZfZ7v7na |
Film | KZFzniwnSyZfZ7v7nn |
Now, try to replace the value of the segment_id
variable on line 5 with an ID from the table above to fetch details for that specific segment:
import jsonimport requestsapi_key = '{{API_KEY}}'segment_id = 'KZFzniwnSyZfZ7v7nE'response = requests.get('https://app.ticketmaster.com/discovery/v2/classifications/segments/' + segment_id,params = {'apikey' : api_key}).json()print(json.dumps(response, indent=4))
Genre details
Genres represent the secondary classification of entities after segments. Examples of genres within the sports segment include basketball, baseball, and cricket. We can use the genres endpoint to fetch details for a specific genre.
The URL for this endpoint is mentioned below:
https://app.ticketmaster.com/discovery/v2/classifications/genres/{id}
Here, {id}
is the ID of the genre we want to fetch details for. Apart from this URL parameter, we can provide a couple of optional query parameters as well. The table below gives an overview of all these parameters:
Parameter | Type | Category | Description |
| string | required | The ID of the genre we want the details for. |
| string | optional | The locale in ISO code format. Multiple comma-separated values can be provided. When omitting the country part of the code (only |
| array[string] | optional | If provided, the results are filtered based on the domain they are available on. |
The response object contains the following properties:
Property | Type | Description |
| object | This contains a link to the current dataset. |
| object | This contains details regarding the related sub-genres. |
| string | The ID of the genre. |
| string | The name of the genre. |
| string | The locale in which the content is returned. |
Genres further contain several subgenres—the details of these subgenres are contained within the _embedded
property.
Below is a list of genres from the sports segment. Let's make a call to this endpoint using the IDs in the table below:
Genre | ID |
Basketball | KnvZfZ7vAde |
Baseball | KnvZfZ7vAdv |
Cricket | KnvZfZ7vAdk |
Football | KnvZfZ7vAdE |
Try to replace the value of the genre_id
variable on line 5 with an ID from the table above:
import jsonimport requestsapi_key = '{{API_KEY}}'genre_id = 'KnvZfZ7vAde'response = requests.get('https://app.ticketmaster.com/discovery/v2/classifications/genres/' + genre_id,params = {'apikey' : api_key}).json()print(json.dumps(response, indent=4))
Subgenre details
Subgenres represent the tertiary level of genres. That means they represent the entities after genres. Examples of sub-genres within the basketball genre include NBA, minor league basketball, and college basketball. We can use the subgenres endpoint to fetch details for a specific sub-genre.
The URL for this endpoint is given below:
https://app.ticketmaster.com/discovery/v2/classifications/subgenres/{id}
Here, {id}
is the ID of the subgenre we want to fetch details for. Apart from this URL parameter, we can provide a couple of optional query parameters as well. The table below gives an overview of all these parameters:
Parameter | Type | Category | Description |
| string | required | The ID of the sub-genre we want the details for. |
| string | optional | The locale in ISO code format. Multiple comma-separated values can be provided. When omitting the country part of the code (only |
| array[string] | optional | If provided, the results are filtered based on the domain they are available on. |
The response object contains the following properties:
Property | Type | Description |
| object | This contains a link to the current dataset. |
| string | The ID of the sub-genre. |
| string | The name of the sub-genre. |
| string | The locale in which the content is returned. |
Since subgenres are first-level classifications, they don't contain any further classifications. This explains the absence of the _embedded
property in the response for this endpoint.
The list of subgenres from the basketball genre is given below. Let's make a call to this endpoint using the subgenre IDs from the following table:
Subgenre | ID |
NBA | KZazBEonSMnZfZ7vFJA |
WNBA | KZazBEonSMnZfZ7vFJF |
Minor League | KZazBEonSMnZfZ7vFJd |
College | KZazBEonSMnZfZ7vFJv |
Replace the value of the subgenre_id
variable on line 5 with an ID from the table above as shown in the code widget below:
import jsonimport requestsapi_key = '{{API_KEY}}'subgenre_id = 'KZazBEonSMnZfZ7vFJA'response = requests.get('https://app.ticketmaster.com/discovery/v2/classifications/subgenres/' + subgenre_id,params = {'apikey' : api_key}).json()print(json.dumps(response, indent=4))