javascriptreactjseventbrite

Eventbrite in React


I'm using eventbrite/eventbrite-sdk-javascript for my project. Everything is working fine but the response is giving me back only 50 events

Object

events : (50) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] pagination : {object_count: 58205, page_number: 1, page_size: 50, page_count: 200, has_more_items: true}

How can I see all events?


Solution

  • The responses when fetching events using eventbrite's api are paginated, with a max of 50 results per page and a max of 200 pages. What you did was fetch the first (let's call it n) page. Now you have to call the api once more, and provide the page=n+1. This will give you the next 50 events. Hope this helps!