Basic Event Details
Let's learn to fetch details for events using the Discovery API.
We'll cover the following
Event details
Apart from searching the events, one major use case of the Discovery API is to fetch details of events. To do this, we can use the events endpoint by passing the event ID as a URL parameter.
The URL for this endpoint is as follows:
https://app.ticketmaster.com/discovery/v2/events/{id}
This endpoint takes the ID of an event as a required URL parameter and a couple of optional query parameters. The table below gives an overview of these parameters:
Parameter | Type | Category | Description |
| string | required | The ID of the event 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. |
As before, the response is a JSON object containing the details of the event. Let's take a look at some of the keys of this response object—you can visit this lesson to see the full details of all the keys:
Property | Type | Description |
| object | An object container. It contains links to the datasets for the related venues and attractions, as well as a link to itself. |
| object | An object container. It contains two properties, |
| string | The type of the entity. For events, the value is |
| string | The ID of the event. |
| string | The name of the event. |
| string | A description of the event. |
| array[object] | The images of the event. These are represented as an array of the object, with each object holding information regarding an image. |
| object | The dates of the event, including the start and end dates, as well as the dates when the general public can access the event. |
| object | The information regarding the sales dates, including the start and end dates of public event sales and presales. |
| string | Any information regarding the event. |
| array[object] | The price ranges for the event tickets. |
| object | The seat map for the event. The object contains a single property that holds the URL for the seat map. |
| array[object] | The information regarding the event's classification (segment, genre, subgenre, type, and subtype). |
In the response objects for the endpoints we discussed previously, the _embedded
property was our primary focus. However, in this case, the _embedded
property only contains the details of the related venues and attractions. We'll discuss the details of these in later lessons.
Get event details
Let's try making a call to this endpoint using the event ID we saved earlier. If you want, you can replace the value of EVENT_ID with another valid event ID.
import jsonimport requestsapi_key = '{{API_KEY}}'response = requests.get('https://app.ticketmaster.com/discovery/v2/events/{{EVENT_ID}}',params = {'apikey' : api_key,}).json()print(json.dumps(response, indent=4))
With that, we've successfully retrieved the details for an event. Let’s now look into some of the information that we get via this call, such as the seat map of the event.
The seat map of an event is a map or diagram of the venue’s seat layout for the event.
The response object includes a property called seatmap
which further contains a single property called staticUrl
. The staticUrl
contains the URL of an image of the seat map for the event. Let’s take a look at the seat map for an event using these properties:
import jsonimport requestsapi_key = '{{API_KEY}}'response = requests.get('https://app.ticketmaster.com/discovery/v2/events/{{EVENT_ID}}',params = {'apikey' : api_key,}).json()try:# extracting the url of the seatmapseatmap = response['seatmap']['staticUrl']print(f'<img src={seatmap} width=500px>')
In the code above, we've simply made an API call to the events endpoint to fetch the details of an event. Then we've extracted the URL of the seat map (at line 13) and rendered it to the console using the HTML <img>
tag.