Python
Introduction
Learn how to use the Python SDK to build AI powered applications.
Prerequisites
To get the most out of this guide, you’ll need to:
You should have installed Python (version 3.7 or higher).
Installation
Set the API key as an environment variable
.env
JIGSAWSTACK_API_KEY='your-api-key'
Usage
Let’s use AI scrape to scrape an amazon product page.
from jigsawstack import JigsawStack
jigsawstack = JigsawStack() # API key will be read from environment.
# jigsawstack = JigsawStack(api_key="your-api-key")
params = {
"url": "https://www.amazon.com/Cadbury-Mini-Caramel-Eggs-Bulk/dp/B0CWM99G5W",
"element_prompts": ["prices"]
}
result = jigsawstack.web.ai_scrape(params)
Kudos, You are set!