Metadata-Version: 2.4
Name: glint-render
Version: 1.0.0
Summary: Official Python SDK for Glint Render — screenshots, PDFs, OG images, page extraction, AI extraction, monitoring and evidence from one client.
Author: Moyu
License: MIT
Project-URL: Homepage, https://ottersnap.com
Project-URL: Documentation, https://ottersnap.com/docs
Project-URL: Source, https://github.com/zzzjy765/ottersnap
Keywords: glint,glint-render,screenshot,pdf,og-image,rendering,api,ai,markdown,llm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28

# ottersnap (Python SDK)

Official Python SDK for the [Glint Render](https://ottersnap.com) rendering API — screenshots, PDFs, OG images, page extraction, AI extraction and AI vision, from one client.

## Install

```bash
pip install glint-render
```

## Quick start

```python
import os
from glint_render import GlintRender

client = GlintRender(os.environ["GLINT_API_KEY"])

# Screenshot -> PNG bytes
png = client.screenshot("https://github.com", full_page=True, scale=2)
open("shot.png", "wb").write(png)

# Page -> clean Markdown (LLM/RAG ready)
data = client.extract("https://example.com/blog/post", format="markdown")
print(data)

# AI extraction: natural language -> structured JSON
res = client.ai_extract("https://example.com/store", "List every product name and price as JSON")
print(res["data"])

# AI vision: render the page and let a multimodal model analyze the screenshot
v = client.ai_vision("https://example.com", "Does this page have a pricing section?")
print(v["analysis"], v["screenshot_url"])

# PDF, OG cards, QR, crawl, batch, record...
client.pdf("https://example.com/invoice", paper="A4")
og = client.og(title="Shipping v2", theme="nocturne")
qr = client.qr("https://ottersnap.com")
crawl = client.crawl("https://mysite.com", limit=10)
rec = client.record("https://example.com", duration=15, scroll=True)
usage = client.usage()
```

Free tier: 100 renders/month -> [get a key](https://ottersnap.com/#getkey)

## Methods

| Method | Endpoint | Returns |
|---|---|---|
| `screenshot(url, **opts)` | POST /v1/screenshot | bytes (PNG/JPEG) |
| `pdf(url, paper)` | POST /v1/pdf | bytes (PDF) |
| `og(title, ...)` | POST /v1/og | bytes (PNG) |
| `extract(url, format, **opts)` | POST /v1/extract | dict or str (Markdown) |
| `ai_extract(url, prompt, **opts)` | POST /v1/ai/extract | dict |
| `ai_vision(url, prompt, **opts)` | POST /v1/ai/vision | dict |
| `crawl(url, limit, format, **opts)` | POST /v1/crawl | dict or str |
| `batch(requests, **opts)` | POST /v1/batch | dict |
| `record(url, duration, **opts)` | POST /v1/record | dict (hosted webm URL) |
| `meta(url)` | POST /v1/meta | dict |
| `qr(text, size, **opts)` | POST /v1/qr | bytes (PNG) |
| `code_image(code, **opts)` | POST /v1/code-image | bytes (PNG) |
| `usage()` | GET /v1/me | dict |

All opts map 1:1 to the REST parameters in the [docs](https://ottersnap.com/docs).

## License

MIT
