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 for events, one major use case for 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:
https://app.ticketmaster.com/discovery/v2/events/{id}
Request parameters
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 | This is the ID of the event for which we want the details. |
| string | optional | This is 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 on the domain they are available on. |
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 fetch from "node-fetch";const endpointUrl = new URL("https://app.ticketmaster.com/discovery/v2/events/{{EVENT_ID}}");const queryParameters = new URLSearchParams({apikey: "{{API_KEY}}",});const options = {method: "GET",};async function getEventDetails() {try {endpointUrl.search = queryParameters;const response = await fetch(endpointUrl, options);printResponse(response);} catch (error) {printError(error);}}getEventDetails();
Here is the explanation for the code above: