Official Python SDK for RenderKit — screenshots, PDFs, and LLM-ready markdown from one API.
Project description
renderkit (Python)
Official Python SDK for RenderKit — screenshots, PDFs, and LLM-ready markdown from one API. Standard library only, Python 3.9+.
pip install renderkit
import os
from renderkit import RenderKit
rk = RenderKit(os.environ["RK_KEY"]) # or set RENDERKIT_API_KEY
# Screenshot → hosted PNG
shot = rk.screenshot(url="https://stripe.com", full_page=True, block_ads=True)
print(shot["url"])
# PDF → hosted PDF
pdf = rk.pdf(url="https://example.com", page_format="A4")
# Extract → markdown inline
doc = rk.extract(url="https://paulgraham.com/greatwork.html", format="markdown", chunk=True)
print(doc["content"])
Auth
Pass your key to RenderKit(key) or set RENDERKIT_API_KEY. Keys look like
rk_live_… / rk_sandbox_… and are sent as the x-api-key header.
Methods
| Method | Endpoint | Returns |
|---|---|---|
rk.screenshot(**opts) |
POST /v1/screenshot |
render dict with hosted url |
rk.pdf(**opts) |
POST /v1/pdf |
render dict with hosted url |
rk.extract(**opts) |
POST /v1/extract |
render dict with inline content |
rk.get_job(id) |
GET /v1/jobs/:id |
render dict |
rk.render(type, **opts) |
submits async + polls to completion |
finished render dict |
Options mirror the API reference. Methods return
the data object as a plain dict.
Save a screenshot
import urllib.request
shot = rk.screenshot(url="https://stripe.com", full_page=True)
urllib.request.urlretrieve(shot["url"], "stripe.png")
Errors
Failures raise RenderKitError with .code, .status, and .request_id:
from renderkit import RenderKitError
try:
rk.screenshot(url="https://x.com")
except RenderKitError as e:
if e.code == "QUOTA_EXCEEDED":
... # top up
print(e.status, e.code, e.request_id)
Config
RenderKit(key, base_url="https://api.renderkit.tech", timeout=120.0)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file renderkit_sdk-1.0.0.tar.gz.
File metadata
- Download URL: renderkit_sdk-1.0.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91fdf63a28705580803648a16ec856cb09006b0ebfdf0a95f8865e2148bdb6a6
|
|
| MD5 |
80c781df85c7c1280093aae143ab2eac
|
|
| BLAKE2b-256 |
6a92e0dd1b709bda755d675510b02847bf9797a8f30f11e807f5298c1abc48a5
|
File details
Details for the file renderkit_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: renderkit_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72e5ab6f2f0b5cda09191bc2c2ad203bfed6e02ca581dc6b309f9b26a415f3c0
|
|
| MD5 |
7fad9ab17853799fd91d648df4e9d81d
|
|
| BLAKE2b-256 |
7cadbc0bc83093b23b034129055411d7e17bacfe3223c8cf2dd9fef75628c877
|