Prerequisites

To get the most out of this guide, you’ll need to:

You should have installed Node.js (version 18.10.0 or higher).

Installation

Set the API key as an environment variable

.env
JIGSAWSTACK_API_KEY='your-api-key'

Usage

Let’s use AI scrape to scrape an amazon product page.

import { JigsawStack } from "jigsawstack";

const jigsawstack = JigsawStack({
  apiKey: "your-api-key", // This is not required if API key is set as an environment variable.
});

const resp = await jigsawstack.web.ai_scrape({
  url: "https://www.amazon.com/Cadbury-Mini-Caramel-Eggs-Bulk/dp/B0CWM99G5W",
  element_prompts: ["prices"],
});

Kudos, You are set!