The external api I'm using will only return a max of 100 results at a time. I guess less of an issue and more of a question, but is the only way to get more results to make multiple calls? But how would I add continually add that to the state each time? Or is that not possible?
Post any code you think might be relevant (one fenced block per file)
const [netflixVids, setNetflixVids] = useState([])
useEffect(() => {
getNetflixVideos()
.then(videos => {
console.log('these are all the videos on US Netflix\n', videos.data)
setNetflixVids(videos.data.ITEMS)
})
.catch(err => console.error)
}, [])
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
N/A
What is your best guess as to the source of the problem?
The p= in the query represents the different page numbers so would I just have to use recursion increasing that number each time constantly making calls till the end results?
What things have you already tried to solve the problem?
Stack overflow is saying to use recursion but I only get 100 api calls a day and that would take about 50 calls to do...
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
MERN
What's the problem you're trying to solve?
The external api I'm using will only return a max of 100 results at a time. I guess less of an issue and more of a question, but is the only way to get more results to make multiple calls? But how would I add continually add that to the state each time? Or is that not possible?
Post any code you think might be relevant (one fenced block per file)
API Call
Setting results to state
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
N/A
What is your best guess as to the source of the problem?
The
p=
in the query represents the different page numbers so would I just have to use recursion increasing that number each time constantly making calls till the end results?What things have you already tried to solve the problem?
Stack overflow is saying to use recursion but I only get 100 api calls a day and that would take about 50 calls to do...