Paginate results

Use limit and offset to page through search results.


import { Etoile } from "@etoile-dev/client";

const etoile = new Etoile({
apiKey: process.env.ETOILE_PUBLIC_KEY,
});

// First page: 10 results
const page1 = await etoile.search({
query: "landscape painting",
collections: ["paintings"],
limit: 10,
offset: 0,
});

// Second page: next 10
const page2 = await etoile.search({
query: "landscape painting",
collections: ["paintings"],
limit: 10,
offset: 10,
});

Related