Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

APIs

Eventbrite API - I can't get to sort by music category

I am able to sort by city and date, below is that I have so far:

var eventBriteRestUrl = "https://www.eventbriteapi.com/v3/events/search/?token=" + eventBriteApiKey + "&location.address=" + city + "&sort_by=date";

I don't get how to add the music category in my url. Please help!

1 Answer

Jerson Otzoy
Jerson Otzoy
1,532 Points

Hello,

Use this to get the categories

"https://www.eventbriteapi.com/v3/categories/?token=" + "Your token"

You will find Music is category id = 103, so use this

"https://www.eventbriteapi.com/v3/categories/103/?token=" + "Your token"

And you will get a response containing the subcategories for music, for example Rock has an id of 3017. So you can use these values with your search like this

"https://www.eventbriteapi.com/v3/events/search/?location.address=" + city + "&categories=103&subcategories=3017&sort_by=date&token="Your token"

Hope that helps.

WOW Jerson Otzoy thank you so much! It worked by adding &categories=103 to my URL.