Installation
Python SDK
Python 3.9+ · type hints · async support
Install the SDK
pip install flypythonbashFor async support
pip install flypython[async]bashSet your API key
export FLYPYTHON_API_KEY=fp_xxxxxxxxbashDon’t have a key yet? Get one from Settings after signing in. You can also use the Playground to try the API without a key.
Authentication
All API requests require an API Key passed in the Authorization header:
Authorization: Bearer fp_your_api_key_herebashGet your API key from the Settings page after signing in.
Quick Start
1. Extract once
import flypython
result = flypython.extract(
url="https://example.com/product",
schema={"price": "number", "stock": "string"}
)
print(result.data)python2. Watch the same fields continuously
task = flypython.monitor(
url="https://example.com/product",
schema={"price": "number", "stock": "string"},
webhook="https://your-app.com/webhooks/flypython",
webhook_secret="whsec_your_shared_secret",
schedule="0 */6 * * *",
)
print(task.id)python3. Receive the change event
from fastapi import FastAPI, Request, HTTPException
import flypython
app = FastAPI()
WEBHOOK_SECRET = "whsec_your_shared_secret"
@app.post("/webhooks/flypython")
async def flypython_webhook(request: Request):
payload = await request.body()
signature = request.headers.get("X-FlyPython-Signature", "")
if not flypython.verify_webhook(payload, signature, WEBHOOK_SECRET):
raise HTTPException(status_code=401, detail="Invalid signature")
event = await request.json()
print(event["change_type"], event["summary"])
return {"ok": True}pythonWebhook Event
FlyPython sends an event only when the fields you care about change. Your agent receives the business diff, not raw page noise.
{
"event": "page.changed",
"url": "https://example.com/product",
"change_type": "price_drop",
"confidence": 0.97,
"diff": {
"price": { "before": 129.00, "after": 99.00 },
"stock": { "before": "in_stock", "after": "in_stock" }
},
"summary": "Price dropped 23%. Stock unchanged."
}jsonAPI Reference
/v1/extractExtract
Extract a single URL and return agent-ready structured data.
| Parameter | Type | Description |
|---|---|---|
url* | string | The page URL to extract. |
schema | object | Field map e.g. {"price": "number"}. |
format | string | json | markdown | html. Defaults to json. |
js_render | boolean | Render JS via headless browser. |
curl -X POST https://api.flypython.com/v1/extract \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "format": "json"}'bash/v1/searchSearch
Search the web and return LLM-ready results with markdown summaries.
| Parameter | Type | Description |
|---|---|---|
query* | string | The search query. |
limit | number | Max results (default 5, max 20). |
curl -X POST https://api.flypython.com/v1/search \
-H "Content-Type: application/json" \
-d '{"query": "best LLM agents 2025", "limit": 5}'bash/v1/crawlCrawl
Bulk-extract multiple pages from a site with a single request.
| Parameter | Type | Description |
|---|---|---|
url* | string | Root URL to start crawling. |
max_pages | number | Max pages to crawl (default 10). |
schema | object | Shared schema applied to each page. |
curl -X POST https://api.flypython.com/v1/crawl \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "max_pages": 10}'bash/v1/screenshotScreenshot
Capture a full-page or viewport screenshot of any URL via Playwright.
| Parameter | Type | Description |
|---|---|---|
url* | string | The page URL to capture. |
full_page | boolean | Capture full page (default) or viewport only. |
js_render | boolean | Wait for JS to render before capture. |
curl -X POST https://api.flypython.com/v1/screenshot \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "full_page": true}'bash/v1/interactInteract
Run browser interaction steps (click, type, scroll) for agent workflows.
| Parameter | Type | Description |
|---|---|---|
url* | string | The page URL to interact with. |
steps* | array | Ordered steps: {action, selector, value?}. |
js_render | boolean | Render JS before running steps. |
curl -X POST https://api.flypython.com/v1/interact \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "steps": [{"action": "click", "selector": "#load-more"}]}'bash/v1/tasksMonitor
Create a scheduled monitor that sends webhooks when meaningful fields change.
| Parameter | Type | Description |
|---|---|---|
target_url* | string | The URL to monitor. |
selectors | object | Field schema to track for changes. |
schedule_cron | string | Cron expression e.g. "0 */6 * * *". |
destinations | array | Webhook/slack/email notification configs. |
curl -X POST https://api.flypython.com/v1/tasks \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"name": "Price Monitor", "target_url": "https://example.com/product", "selectors": {"price": "number", "stock": "string"}, "schedule_cron": "0 */6 * * *"}'bashOutput Formats
JSON
Structured key-value data. Default for /extract and /crawl.
Markdown
LLM-ready text. Clean, semantic, perfect for RAG pipelines.
HTML
Raw page HTML. Useful when you need the full markup.
Run a live request.
No setup required.