Home > youtubes.js > Pagination > next
Fetches the next page.
Signature:
next(): Promise<Result<Pagination<T>, YouTubesJsErrors> | null>;
Returns:
Promise<Result<Pagination<T>, YouTubesJsErrors> | null>
The next page. If there is no next page, returns null
.
- This method will use the same quotas as the original request. - Normally, GET requests use a quota of 1 unit, while other methods use 50 units. - However, some heavy methods use more than 50 units. - See more details on the YouTube Data API reference
import { ApiClient, StaticOAuthProvider } from "youtubes.js";
const oauth = new StaticOAuthProvider({
accessToken: "ACCESS_TOKEN",
});
const client = new ApiClient({ oauth });
const playlists = await client.playlists.getMine();
if (playlists.isErr()) return;
console.log(playlists.value); // The first page of playlists
const nextPage = await playlists.next();
if (nextPage?.isErr()) return;
console.log(nextPage?.value); // The second page of playlists or null if there is no next page