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

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

const result = await jigsawstack.web.scrape({
  url: "https://jigsawstack.com",
});
{
  "success": true,
  "data": [
    {
      "selector": "h3:contains('Free')",
      "results": [
        {
          "html": "Free",
          "text": "Free",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Free",
          "text": "Free",
          "attributes": [
            {
              "name": "class",
              "value": "text-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "h3:contains('Pro')",
      "results": [
        {
          "html": "Pro",
          "text": "Pro",
          "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-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "h3:contains('Team')",
      "results": [
        {
          "html": "Team",
          "text": "Team",
          "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-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "h3:contains('Enterprise')",
      "results": [
        {
          "html": "Enterprise",
          "text": "Enterprise",
          "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-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('$0')",
      "results": [
        {
          "html": "$0",
          "text": "$0",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('$25')",
      "results": [
        {
          "html": "$25",
          "text": "$25",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('$599')",
      "results": [
        {
          "html": "$599",
          "text": "$599",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('Custom')",
      "results": [
        {
          "html": "Custom",
          "text": "Custom",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-4xl"
            }
          ]
        }
      ]
    }
  ]
}

If the elements parameter is not set, we default to:

"elements":[ {"selector": "*"} ]

For more information on selectors click here

Request Parameters

Body

url
string

The URL of the page to retrieve the contents from. Either url or html is required, but not both.

html
string

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

elements
array<object>
default:"[{\"selector\": \"*\"}]"

The list of selectors you are interested in.

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. See the full list of screen size presets here

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

data
array<object>

Array of scraped elements

import { JigsawStack } from "jigsawstack";

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

const result = await jigsawstack.web.scrape({
  url: "https://jigsawstack.com",
});
{
  "success": true,
  "data": [
    {
      "selector": "h3:contains('Free')",
      "results": [
        {
          "html": "Free",
          "text": "Free",
          "attributes": [
            {
              "name": "class",
              "value": "text-foreground text-2xl font-normal uppercase flex items-center gap-4 font-mono"
            }
          ]
        },
        {
          "html": "Free",
          "text": "Free",
          "attributes": [
            {
              "name": "class",
              "value": "text-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "h3:contains('Pro')",
      "results": [
        {
          "html": "Pro",
          "text": "Pro",
          "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-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "h3:contains('Team')",
      "results": [
        {
          "html": "Team",
          "text": "Team",
          "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-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "h3:contains('Enterprise')",
      "results": [
        {
          "html": "Enterprise",
          "text": "Enterprise",
          "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-lg xl:text-xl 2xl:text-2xl leading-5 uppercase font-mono font-normal flex items-center"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('$0')",
      "results": [
        {
          "html": "$0",
          "text": "$0",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('$25')",
      "results": [
        {
          "html": "$25",
          "text": "$25",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('$599')",
      "results": [
        {
          "html": "$599",
          "text": "$599",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-5xl"
            }
          ]
        }
      ]
    },
    {
      "selector": "p.font-mono:contains('Custom')",
      "results": [
        {
          "html": "Custom",
          "text": "Custom",
          "attributes": [
            {
              "name": "class",
              "value": "mt-2 pb-1 font-mono text-4xl"
            }
          ]
        }
      ]
    }
  ]
}