API Documentation
Prompt Engine
Store
- KV
- File
Scrape
The scrape API allows for retrieving contents from a web page. You can target specific content by specifying selectors you are interested in.
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
The URL of the page to retrieve the contents from.
The list of selectors you are interested in.
HTML selector you are interested in. e.g h1
, p
, span
, e.t.c
Advance configurations
Tracks console messages emitted when JavaScript within the page calls one
of console API methods. E.g console.log
Tracks network response information such as url
, method
, status
,
headers
and body
.
Tracks cookie information.
This parameter allows you set header properties. e.g Authentication header
Intercepting requests
- jpg
- png
Wait for.
Supported values:
timeout
selector
function
This parameter can accept one of three options:
- A number indicating the time in milliseconds to wait. Maximum timeout
40000
- A valid selector to wait for. e.g
h2
A function to be ran within the page’s context, inside of the browser. e.g
() => document.querySelector('h2')
Set cookie(s)
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
Sets whether the meta viewport tag is taken into account.
The device scale factor. The default value is 1.
The width of the viewport.
The height of the viewport
Header
Your JigsawStack API key
Response
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"
}
]
}
]
}
]
}
Was this page helpful?
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"
}
]
}
]
}
]
}