Installation
To install the ScreenshotRender Python SDK, use pip:Python
Usage
- Get an API key from your dashboard. New accounts start with 100 free credits.
- Pass it to the client as
api_key, or set it in theSCREENSHOTRENDER_API_KEYenvironment variable.
data. Results are dicts whose fields also read as attributes, under the API’s name or in snake_case: doc.metadata.source_url is doc["metadata"]["sourceURL"].
Taking a screenshot
Python
Python
Searching the web
Python
Scraping a URL
Python
Extracting structured data
The schema can be a Pydantic model:Python
Parsing documents
From a URL:Python
Python
Mapping a website
Python
Crawling a website
crawl() starts the crawl, waits for it and returns every page. on_progress is called after every status check.
Python
Start a crawl
To start a crawl without waiting, usestart_crawl() and keep the id:
Python
Checking crawl status
Python
Cancelling a crawl
Python
Failed and blocked pages
Python
Error handling
Every failure is aScreenshotRenderError with the HTTP status and the API’s error code. See Errors for every code.
Python
Async Class
AsyncScreenshotRender has the same methods, as coroutines. Use it to run requests at the same time:
Python