Installation

To install the ScreenshotRender Python SDK, use pip:
Python
It needs Python 3.9 or later.

Usage

  1. Get an API key from your dashboard. New accounts start with 100 free credits.
  2. Pass it to the client as api_key, or set it in the SCREENSHOTRENDER_API_KEY environment variable.
Each method returns the response’s 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
Capture the full page, at a window size you choose:
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
From a file: pass a path, bytes or an open file.
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, use start_crawl() and keep the id:
Python

Checking crawl status

Python

Cancelling a crawl

Python

Failed and blocked pages

Python

Error handling

Every failure is a ScreenshotRenderError 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