Get Started With the SeatGeek API

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:

  1. Click the “Edit” button in the following widget.
  2. Paste the client ID in the CLIENT_ID field.
  3. Click the “Save” button.

As soon as you save the value, the platform will replace it in the widget below:

Press + to interact
# Define Client Key here
CLIENT_ID = "{{CLIENT_ID}}"
# Calling Client ID authentication function here
authenticate(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 basic auth tokenThe HTTP Basic Auth token is a token that an HTTP client can use to provide a user identifier and password when making an API request to authenticate themselves., which you pass in the API request. You can also pass the app secret along with the client ID. Here's a code example of how to do this when making an HTTP get request to the events endpoint in Python with basic authentication:

Press + to interact
from requests import get, auth
from pprint import pprint
# Define Client ID and app secret here
CLIENT_ID = "{{CLIENT_ID}}"
APP_SECRET = ""
# Define endpoint here
ENDPOINT = "events"
# Define endpoint url here
url = f"https://api.seatgeek.com/2/{ENDPOINT}"
# Creating a Basic Auth Token
auth = auth.HTTPBasicAuth(CLIENT_ID, APP_SECRET)
# Making GET request
res = get(url=url, auth=auth)
# Printing JSON response
pprint(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:

Press + to interact
from requests import get, auth
from pprint import pprint
# Define Client ID and app secret here
CLIENT_ID = "{{CLIENT_ID}}"
APP_SECRET = ""
# Define endpoint here
ENDPOINT = "events"
# Define endpoint url here
url = f"https://api.seatgeek.com/2/{ENDPOINT}"
# Define URL parameters here
params = {
'client_id': CLIENT_ID,
'client_secret': APP_SECRET,
}
# Making GET request
res = get(url=url, params=params)
# Printing JSON response
pprint(res.json())