Search for Venues
Let's learn to search for and filter venues using Ticketmaster's Discovery API.
We'll cover the following
Venue search
A venue is where an event takes place. We can search for venues and filter the search results through the Discovery API's venues endpoint.
The URL for this endpoint is mentioned below:
https://app.ticketmaster.com/discovery/v2/venues
There are no required parameters for this endpoint. However, we can provide several optional parameters to filter the search results. An overview of some of the parameters is given below—you can visit this lesson to see the complete list of parameters:
Parameter | Type | Category | Description |
| string | optional | If provided, the search results are filtered by the venue ID. |
| string | optional | A keyword on which the search is performed. |
| string | optional | The radius of the area in which we want to search for venues. |
| enum['miles', 'km'] | optional | The unit of the radius. The default value is |
| number | optional | The number of results to be returned per page. The default value is |
| number | optional | The page number to be returned. The default value is |
| string | optional | The sorting order of the search results. Allowable values are, |
| string | optional | If provided, the search results are filtered based on the country. |
| string | optional | If provided, the search results are filtered based on the geohash. |
The table below gives an overview of the keys of the response object:
Property | Type | Description |
| object | This contains a single property, |
| object | This contains links to the first, next, and last pages in the search results, as well as the link to the current page. |
| object | This contains information regarding the pages of the search results, including the size of each page, the total number of elements, the total number of pages, and the current page. |
Like before, the response object returned as the result of a single API call represents a single page of the search results—by default, the first page. We can specify the page we want using the page
query parameter or use the links in the _links
property to navigate to the next or previous pages of the results.
The actual results of the search are stored within the venues
array in the _embedded
property, where each array element represents a venue. We'll discuss the details of the venue objects in a later chapter.
Search without parameters
Let's try making a call to this endpoint, first with no search parameters. Later we'll make a call with a few of the optional parameters, such as geoPoint
and radius
.
The code below makes a call to the venues endpoint, using none of the search parameters:
import jsonimport requestsapi_key = '{{API_KEY}}'response = requests.get('https://app.ticketmaster.com/discovery/v2/venues',params = {'apikey' : api_key}).json()print(json.dumps(response, indent=4))
This call returns several venues, sorted in descending order of relevance, with the most relevant venue at the top.
Search with optional parameters
Let's try searching for venues with the geoPoint
and radius
search parameters. A list of several venues and their
Venue | Geohash |
Madison Square Garden | dr5ru6krc |
SoFi Stadium | 9q5c5h88n |
United Center | dp3wkbjxc |
Dolby Live | 9qqj7hezw |
Ball Arena | 9xj647vbm |
Try replacing the value of the geo_hash
variable on line 5 with any geohash from the table above. You can also change the radius of the area where we want to search for venues by changing the value of the radius
variable on line 6.
import jsonimport requestsapi_key = '{{API_KEY}}'geo_hash = 'dr5ru6krc'radius = 5response = requests.get('https://app.ticketmaster.com/discovery/v2/venues',params = {'apikey' : api_key,'geoPoint' : geo_hash,'radius' : radius}).json()print(json.dumps(response, indent=4))
With the code above, we get a list of all venues within a 5-mile radius of the location defined by the geohash. You can also try experimenting with other parameters—feel free to play around!