Search for Venues

Let's learn to search for and filter venues using Ticketmaster's Discovery API.

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

id

string

optional

If provided, the search results are filtered by the venue ID.

keyword

string

optional

A keyword on which the search is performed.

radius

string

optional

The radius of the area in which we want to search for venues.

unit

enum['miles', 'km']

optional

The unit of the radius. The default value is miles.

size

number

optional

The number of results to be returned per page. The default value is 20.

page

number

optional

The page number to be returned. The default value is 0.

sort

string

optional

The sorting order of the search results. Allowable values are, name,asc, name,desc, date,asc, date,desc, relevance,asc, relevance,desc, distance,asc, name,date,asc, name,date,desc, date,name,asc, date,name,desc, distance,date,asc, onSaleStartDate,asc, id,asc, venueName,asc, venueName,desc, random. The default value is relevance,desc.

countryCode

string

optional

If provided, the search results are filtered based on the country.

geoPoint

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

_embedded

object

This contains a single property, venues, that holds the search results in the form of an array of objects, with each object representing one venue.

_links

object

This contains links to the first, next, and last pages in the search results, as well as the link to the current page.

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:

Press + to interact
import json
import requests
api_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 geohashesGeohash is a public domain geocode system which encodes a geographic location into a short string of letters and digits. is given below:

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.

Press + to interact
import json
import requests
api_key = '{{API_KEY}}'
geo_hash = 'dr5ru6krc'
radius = 5
response = 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!