Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Axios GET Request Scope with Pagination

so I've seen a few post about pagination with Axios, but what I've seen is primarily discussion around front-end. Effectively what I'm trying to do is use Axios to do a GET request, save my results and move on to the next pagingated request.

End goal is to take all requests and save them into a large .txt file.

Here is my problem so far. I have been able to make my first request and add the data result to a variable. However, the next call won't take the varaiable for the continuation parameter, because of the scope. I tried nesting it (see below) but it hasn't worked. I'm relatively new to Node.js and still don't fully understand promises but I'm willing to learn. If there is an answer to this somewhere already, please let me know. Otherwise, any help would be greatly appreciated.

Thank you

const axios = require('axios');
const eventBriteToken = '1234'
// Make a request for a user with a given ID
    axios.get('https://www.eventbriteapi.com/v3/organizations/12345/attendees', {
        params: {
            token: eventBriteToken,
        }
    })
    .then(function (response) {
      // handle success
      console.log(response.data.pagination.page_number)
      const continuationID = response.data.pagination.continuation 
      //console.log(response)
        axios.get('https://www.eventbriteapi.com/v3/organizations/12345/attendees', {
            params: {
                token: eventBriteToken,
                continuation: continuationID
            }
        })
        console.log(response.data.pagination.page_number)  
    })
    .catch(function (error) {
      // handle error
      //console.log(error);
    })
    .then(function () {
      // always executed
    });

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!