Getting 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 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. Developers who are part of the SeatGeek partner program mainly use this API because they receive a payment if any of the directed users buy 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 and secret, which allows you to get authorized access to its API.
Generate client credentials
You can get your client credentials from SeatGeek's developer platform. Follow the steps listed below to generate a client credentials:
Save credentials
Here’s how to save the client credentials that you generate throughout the course:
Click the “Edit” button in the following widget.
Paste the client ID in the
CLIENT_IDfield.Paste the app secret in the
CLIENT_SECRETfield.Click the “Save” button.
As soon as you save the value, the platform will replace it in the widget below:
Use the client credentials
You must provide the client credentials in every HTTP request you make to the API. However, you can still be authenticated if you only pass the client ID and an empty string as the client secret. There are two ways to insert client credentials inside the HTTP request. Let’s look at both of these methods.
HTTP basic authentication
One way to provide the client credentials for access authorization is by passing them in the
Take a look at the following explanation of the code above:
Lines 4–5: We declare the
clientIdandclientSecretvariables here.Line 8: We encrypt the client credentials with the
base64encoding and save them in thebasicAuthTokenvariable.Line 12: We pass the
basicAuthTokenvariable with encoded client credentials to theauthorizationheader. If the client credentials are valid, SeatGeek will authenticate our request and respond with the requested data.
As a query parameter
Another way to provide the client credentials for access authorization is passing them as a string to additional query parameters called client_id and client_secret. Here's a code example of how to do this when making an HTTP GET request to the events endpoint in JavaScript using a query parameter:
Take a look at the following explanation of the code above:
Lines 4–5: We declare the
clientIdandclientSecretvariables here.Lines 14–15: We pass the
clientIdandclientSecretvariables to theclient_idandclient_secretquery parameters, respectively. If the client credentials are valid, SeatGeek will authenticate our request and respond with the requested data.