const extraction = await client
.extract({
urls: ["https://sandbox.kadoa.com/ecommerce/pagination"],
name: "Paginated Extraction",
navigationMode: "paginated-page",
extraction: (builder) =>
builder
.entity("Product")
.field("title", "Product name", "STRING", {
example: "Sennheiser HD 6XX",
})
.field("price", "Product price", "MONEY"),
})
.create();
const result = await extraction.run({ limit: 10 });
// Fetch a single page with pagination info
const page = await result.fetchData({ page: 1, limit: 5 });
console.log("Page data:", page.data);
console.log("Pagination:", page.pagination);
// Or get all data at once
const allData = await result.fetchAllData({});
console.log("All data:", allData);