Get Started With the SeatGeek API
Learn about the SeatGeek API and how to get started with it.
Introduction to the SeatGeek API
SeatGeek is an online ticket-booking platform for live events, mainly in the United States and Canada. The SeatGeek API facilitates this booking process by providing a powerful tool for filtering and fetching the vast data for live events from SeatGeek. The API, however, doesn’t support the process of booking or buying tickets through SeatGeek.
The primary purpose of the SeatGeek API is to allow developers to build on top of it to help their users search and find events and, if required, direct those users to the SeatGeek booking page. These developers can also join the partner program for SeatGeek and receive a payment if any user referred by them buys a ticket through SeatGeek.
Note: The SeatGeek API follows the RESTful API protocol and supports responses in JSON, JSONP, and XML.
API authentication
You first need authorized access when making an API call to use the services of the SeatGeek API. SeatGeek provides a client ID, which allows you to get authorized access to its API.
Generate a client ID
You can get your client ID from SeatGeek's own developer platform. Follow the steps listed below to generate a client ID:
Note: Although we only require your client ID to execute codes in this course, it’s recommended that you save both your client ID and secret key for later use in your own application.
Save the Client ID
Here’s how to save the client ID that you generate throughout the course:
- Click the “Edit” button in the following widget.
- Paste the client ID in the
CLIENT_ID
field. - Click the “Save” button.
As soon as you save the value, the platform will replace it in the widget below:
# Define Client Key hereCLIENT_ID = "{{CLIENT_ID}}"# Calling Client ID authentication function hereauthenticate(CLIENT_ID)
Use the client ID
You must provide the client ID in every HTTP request you make to the API. There are two ways to insert a client ID inside the HTTP request. Let’s look at both of these methods.
HTTP basic authentication
One way to provide the client ID for access authorization is passing the client ID in the get
request to the events endpoint in Python with basic authentication:
from requests import get, authfrom pprint import pprint# Define Client ID and app secret hereCLIENT_ID = "{{CLIENT_ID}}"APP_SECRET = ""# Define endpoint hereENDPOINT = "events"# Define endpoint url hereurl = f"https://api.seatgeek.com/2/{ENDPOINT}"# Creating a Basic Auth Tokenauth = auth.HTTPBasicAuth(CLIENT_ID, APP_SECRET)# Making GET requestres = get(url=url, auth=auth)# Printing JSON responsepprint(res.json())
As a query parameter
Another way to provide a client ID for access authorization is passing the client ID as a string to additional query parameters called client_id
. We can also pass the app secret in the client_secret
query parameter along with client_id
for access authorization.
Here's a code example of how to do this when making an HTTP get
request to the events endpoint in Python using a query parameter:
from requests import get, authfrom pprint import pprint# Define Client ID and app secret hereCLIENT_ID = "{{CLIENT_ID}}"APP_SECRET = ""# Define endpoint hereENDPOINT = "events"# Define endpoint url hereurl = f"https://api.seatgeek.com/2/{ENDPOINT}"# Define URL parameters hereparams = {'client_id': CLIENT_ID,'client_secret': APP_SECRET,}# Making GET requestres = get(url=url, params=params)# Printing JSON responsepprint(res.json())