Getting Started with the Eventbrite API

Let's see what Eventbrite is and how to set up credentials in order to get a private token for Eventbrite.

Eventbrite is an online ticketing and event management application. This platform can be used to search and create events.

We can create an event using Eventbrite’s online tool as an organizer. The events can be exhibitions, musical concerts, job fairs, etc. We can add the event’s description, cover art, Google map location, date and time, and much more. Eventbrite charges fees for services to the organizers if the event has paid tickets and will not charge fees if the event is free.

Press + to interact

Eventbrite account and private token

Before diving deep into the course, let’s first create an Eventbrite account that will enable us to test the Eventbrite API’s endpoints. To create an Eventbrite account, follow these steps:

  1. Go to the Eventbrite Sign-up page, enter the required email, and click “Continue.”

  2. Enter the required information (confirm email, first name, last name, and password) and click “Create account.”

  3. Click “Agree” after reviewing the “Terms and conditions” of Eventbrite.

  4. Click “Next” after selecting your interests from different categories.

  5. Enter the location or select a location from the drop-down list and click “Next.”

  6. Follow the organizers that you’re interested in and click “Finish.” It will take you to the Eventbrite homepage.

  7. To retrieve the private token, open this link and click “Get a Free API Key.”

  8. Finally, the private token is in the text box “Your private token.”

Setting up the private token

Copy the private token you obtained by following the steps above. Now, click the “Edit” button below. Paste the private token to the PRIVATE_TOKEN field and click the “Save” button. The PRIVATE_TOKEN we have entered will reflect in the code widget in place of {{PRIVATE_TOKEN}}.

We’ll use the following endpoint to retrieve account information:

https://www.eventbriteapi.com/v3/users/me/

Click the “Run” button in the code widget below to see the output.

Press + to interact
const endpointUrl = new URL('https://www.eventbriteapi.com/v3/users/me/');
const headerParameters = {
'Authorization': 'Bearer {{PRIVATE_TOKEN}}',
'Content-Type': 'application/json'
};
const options = {
method: 'GET',
headers: headerParameters,
};
async function fetchUserDetails() {
try {
const response = await fetch(endpointUrl, options);
// Custom function for printing the API response
printResponse(response);
} catch (error) {
// Custom function for printing the error message
printError(error);
}
}
// Calling function to make API call
fetchUserDetails();