Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let nextUrl = 'https://api.wanikani.com/v2/subjects?types=kanji';
- let results = [];
- while (nextUrl) {
- const response = await fetch(nextUrl, {
- method: 'GET',
- headers: { Authorization: `Bearer ${API_TOKEN}` },
- });
- const body = await response.json();
- nextUrl = body.pages.next_url;
- results.push(...body.data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement