Getting started with JigsawStack Node.js SDK to build AI-powered applications
npm install jigsawstack
.env
JIGSAWSTACK_API_KEY=your-api-key
import { JigsawStack } from "jigsawstack"; const jigsawstack = JigsawStack({ apiKey: "your-api-key", });
import { JigsawStack } from "jigsawstack"; // Initialize the SDK (API key from environment variables) const jigsawstack = JigsawStack(); // Basic usage - extract pricing information const result = await jigsawstack.web.ai_scrape({ url: "https://supabase.com/pricing", element_prompts: ["Plan title", "Plan price"], });
{ "page_position": 1, "page_position_length": 3, "context": { "Plan title": ["Free", "Pro", "Team", "Enterprise"], "Plan price": ["$0", "$25", "$599", "Custom"] }, "selectors": { "Plan title": [ "h3.text-foreground.text-2xl.font-normal.uppercase.flex.items-center.gap-4.font-mono" ], "Plan price": [ "div.text-foreground.flex.items-baseline.text-5xl.font-normal.lg\\:text-4xl.xl\\:text-4xl.border-b.border-default.lg\\:min-h-\\[175px\\].py-8.lg\\:pb-0.lg\\:pt-10 p.mt-2.pb-1.font-mono.text-5xl", "div.text-foreground.flex.items-baseline.text-5xl.font-normal.lg\\:text-4xl.xl\\:text-4xl.border-b.border-default.lg\\:min-h-\\[175px\\].py-6.lg\\:pb-0.pt-6 p.mt-2.pb-1.font-mono.text-5xl", "div.text-foreground.flex.items-baseline.text-5xl.font-normal.lg\\:text-4xl.xl\\:text-4xl.border-b.border-default.lg\\:min-h-\\[175px\\].py-8.lg\\:pb-0.lg\\:pt-10 p.mt-2.pb-1.font-mono.text-4xl" ] }, ... }
Was this page helpful?