POST
/
v1
/
ai
/
scrape
import { JigsawStack } from "jigsawstack";

const jigsawstack = JigsawStack({
  apiKey: "your-api-key",
});

// Basic usage - extract pricing information
const result = await jigsawstack.web.ai_scrape({
  url: "https://supabase.com/pricing",
  element_prompts: ["Plan title", "Plan price"],
});

// Advanced usage with additional settings
const advancedResult = await jigsawstack.web.ai_scrape({
  url: "https://supabase.com/pricing",
  element_prompts: ["Plan title", "Plan price", "Plan features"],
  root_element_selector: ".pricing-section",
  advance_config: {
    console: true,
    network: true,
  },
  wait_for: {
    mode: "selector",
    value: ".pricing-card",
  },
  is_mobile: false,
});
{
  "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"
    ]
  },
  "link": [
    {
      "href": "https://supabase.com/dashboard/new?plan=free",
      "text": "Start for Free",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=pro",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://supabase.com/pricing#addon-compute",
      "text": "Need more compute?",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=team",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://supabase.com/pricing#addon-compute",
      "text": "Need more compute?",
      "type": "a"
    },
    {
      "href": "https://forms.supabase.com/enterprise",
      "text": "Contact Us",
      "type": "a"
    },
    {
      "href": "https://supabase.com/#compare-plans",
      "text": " Compare Plans ",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/billing-on-supabase#organization-based-billing",
      "text": "Learn how billing works",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/compute-add-ons",
      "text": "Learn about Compute add-ons",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/manage-your-usage/compute",
      "text": "usage-based billing for compute",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/compute-add-ons",
      "text": "Compute Add-ons",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/compute-and-disk#disk",
      "text": "Learn about advanced disk config",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/cost-control#spend-cap",
      "text": "Learn about Cost Control",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/custom-domains",
      "text": "Flat fee $10/monthCustom DomainUse your own domain for your Supabase project to present a branded experience to your users.",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/backups",
      "text": "Starts from $100/monthPoint in Time RecoveryRoll back to any specific point in time, down to the second.",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=free",
      "text": "Start for Free",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=free",
      "text": "Start for Free",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=pro",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=team",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://forms.supabase.com/enterprise",
      "text": "Contact Us",
      "type": "a"
    },
    {
      "href": "https://supabase.help",
      "text": "Open a support ticket",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard",
      "text": "Start your project",
      "type": "a"
    },
    {
      "href": "https://supabase.com/contact/sales",
      "text": "Request a demo",
      "type": "a"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light-active.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light-active.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light-active.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-grid-light.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcustom-domain-on.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Custom Domain illustration",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcustom-domain-upgrade.svg&w=32&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fpitr-on.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Point in Time Recovery illustration",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fpitr-upgrade.svg&w=32&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute",
      "type": "img"
    }
  ],
  "data": [
    {
      "key": "Plan title",
      "selector": "h3.text-foreground.text-2xl.font-normal.uppercase.flex.items-center.gap-4.font-mono",
      "results": [
        {
          "html": "Free",
          "text": "Free",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Pro",
          "text": "Pro",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Team",
          "text": "Team",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Enterprise",
          "text": "Enterprise",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        }
      ]
    },
    {
      "key": "Plan price",
      "selector": "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",
      "results": [
        {
          "html": "$0",
          "text": "$0",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "key": "Plan price",
      "selector": "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",
      "results": [
        {
          "html": "$25",
          "text": "$25",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        },
        {
          "html": "$599",
          "text": "$599",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "key": "Plan price",
      "selector": "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",
      "results": [
        {
          "html": "Custom",
          "text": "Custom",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-4xl"
            }
          ]
        }
      ]
    }
  ],
  "success": true,
  "advance_config": {
    "console": [],
    "network": [],
    "cookies": []
  }
}

Request Parameters

Body

url
string

URL of the page to scrape. Either url or html is required, but not both.

html
string

HTML content to scrape. Either url or html is required, but not both.

element_prompts
array<string>
required

Items on the page to scrape (maximum 5). E.g. “Plan price”, “Plan title”

root_element_selector
string
default:"main"

CSS selector to limit the scope of scraping to a specific element and its children

page_position
number
default:"1"

For pagination, the current page number (minimum: 1)

advance_config
object

Advanced configurations

http_headers
object

Custom HTTP headers to send with requests (key-value pairs)

reject_request_pattern
array<string>

Array of patterns to intercept and block requests (e.g., [“jpg”, “png”])

goto_options
object

Custom page-load behavior settings

wait_for
object

Wait condition before scraping

cookies
array<object>

Cookies to set for the page request

size_preset
string

Predefined screen size preset (e.g., “HD”, “FHD”, “4K UHD”)

is_mobile
boolean
default:"false"

Whether to emulate a mobile device viewport

scale
number
default:"1"

Device scale factor (minimum: 1)

width
number
default:"1920"

Viewport width in pixels

height
number
default:"1080"

Viewport height in pixels

force_rotate_proxy
boolean

Whether to force proxy rotation for each request (incurs additional costs)

byo_proxy
object

Bring-your-own-proxy configuration

x-api-key
string
required

Your JigsawStack API key

Response Structure

success
boolean

Indicates whether the call was successful

page_position
number

The current page position when paginating through results

page_position_length
number

The total number of pages available

context
record<string, array<string>>

A map of element prompt keys to arrays of extracted text content from matched elements

selectors
record<string, array<string>>

A map of element prompt keys to arrays of CSS selectors that were used to find matching elements

data
array<object>

Detailed scrape data from the page

Links detected on the page

advance_config
object

Captured browser data if enabled in advance_config

import { JigsawStack } from "jigsawstack";

const jigsawstack = JigsawStack({
  apiKey: "your-api-key",
});

// Basic usage - extract pricing information
const result = await jigsawstack.web.ai_scrape({
  url: "https://supabase.com/pricing",
  element_prompts: ["Plan title", "Plan price"],
});

// Advanced usage with additional settings
const advancedResult = await jigsawstack.web.ai_scrape({
  url: "https://supabase.com/pricing",
  element_prompts: ["Plan title", "Plan price", "Plan features"],
  root_element_selector: ".pricing-section",
  advance_config: {
    console: true,
    network: true,
  },
  wait_for: {
    mode: "selector",
    value: ".pricing-card",
  },
  is_mobile: false,
});
{
  "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"
    ]
  },
  "link": [
    {
      "href": "https://supabase.com/dashboard/new?plan=free",
      "text": "Start for Free",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=pro",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://supabase.com/pricing#addon-compute",
      "text": "Need more compute?",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=team",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://supabase.com/pricing#addon-compute",
      "text": "Need more compute?",
      "type": "a"
    },
    {
      "href": "https://forms.supabase.com/enterprise",
      "text": "Contact Us",
      "type": "a"
    },
    {
      "href": "https://supabase.com/#compare-plans",
      "text": " Compare Plans ",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/billing-on-supabase#organization-based-billing",
      "text": "Learn how billing works",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/compute-add-ons",
      "text": "Learn about Compute add-ons",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/manage-your-usage/compute",
      "text": "usage-based billing for compute",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/compute-add-ons",
      "text": "Compute Add-ons",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/compute-and-disk#disk",
      "text": "Learn about advanced disk config",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/cost-control#spend-cap",
      "text": "Learn about Cost Control",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/custom-domains",
      "text": "Flat fee $10/monthCustom DomainUse your own domain for your Supabase project to present a branded experience to your users.",
      "type": "a"
    },
    {
      "href": "https://supabase.com/docs/guides/platform/backups",
      "text": "Starts from $100/monthPoint in Time RecoveryRoll back to any specific point in time, down to the second.",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=free",
      "text": "Start for Free",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=free",
      "text": "Start for Free",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=pro",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard/new?plan=team",
      "text": "Get Started",
      "type": "a"
    },
    {
      "href": "https://forms.supabase.com/enterprise",
      "text": "Contact Us",
      "type": "a"
    },
    {
      "href": "https://supabase.help",
      "text": "Open a support ticket",
      "type": "a"
    },
    {
      "href": "https://supabase.com/dashboard",
      "text": "Start your project",
      "type": "a"
    },
    {
      "href": "https://supabase.com/contact/sales",
      "text": "Request a demo",
      "type": "a"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light-active.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light-active.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light-active.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-cube-light.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcompute%2Fcompute-grid-light.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute addon grid",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcustom-domain-on.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Custom Domain illustration",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fcustom-domain-upgrade.svg&w=32&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fpitr-on.svg&w=3840&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Point in Time Recovery illustration",
      "type": "img"
    },
    {
      "href": "https://supabase.com/_next/image?url=%2Fimages%2Fpricing%2Fpitr-upgrade.svg&w=32&q=75&dpl=dpl_9pfm3Zop9qyq1VxvYDPz12j4Ed6W",
      "text": "Compute",
      "type": "img"
    }
  ],
  "data": [
    {
      "key": "Plan title",
      "selector": "h3.text-foreground.text-2xl.font-normal.uppercase.flex.items-center.gap-4.font-mono",
      "results": [
        {
          "html": "Free",
          "text": "Free",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Pro",
          "text": "Pro",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Team",
          "text": "Team",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Enterprise",
          "text": "Enterprise",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        }
      ]
    },
    {
      "key": "Plan price",
      "selector": "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",
      "results": [
        {
          "html": "$0",
          "text": "$0",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "key": "Plan price",
      "selector": "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",
      "results": [
        {
          "html": "$25",
          "text": "$25",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        },
        {
          "html": "$599",
          "text": "$599",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "key": "Plan price",
      "selector": "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",
      "results": [
        {
          "html": "Custom",
          "text": "Custom",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-4xl"
            }
          ]
        }
      ]
    }
  ],
  "success": true,
  "advance_config": {
    "console": [],
    "network": [],
    "cookies": []
  }
}