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

Body

url
string
required

The URL of the page to retrieve the contents from.

elements
array<object>

The list of selectors you are interested in.

advance_config
object

Advance configurations

http_headers
object

This parameter allows you set header properties. e.g Authentication header

reject_request_pattern
array<string>

Intercepting requests

  • jpg
  • png
goto_options
object

This parameter allows you to specify custom page-load behavior.

wait_for
object

Wait for.

cookies
array<object>

Set cookie(s)

size_preset
string

The screen size preset to use. Supported values are:

  • QVGA
  • VGA
  • SVGA
  • HD
  • HD+
  • SXGA
  • FHD
  • 2K
  • 2K QHD
  • 5K
  • 4K UHD

See the full list of screen size presets here

is_mobile
boolean

Sets whether the meta viewport tag is taken into account.

scale
number
default:
"1"

The device scale factor. The default value is 1.

width
number
default:
"1920"

The width of the viewport.

height
number
default:
"1080"

The height of the viewport

x-api-key
string
required

Your JigsawStack API key

Response

success
boolean

Indicates whether the call was successful.

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"
            }
          ]
        }
      ]
    }
  ]
}