Developer documentation

Build with
web change events.

Install. Authenticate. Ship.

Installation

Python SDK

Python 3.9+ · type hints · async support

Install the SDK

pip install flypython
bash

For async support

pip install flypython[async]
bash

Set your API key

export FLYPYTHON_API_KEY=fp_xxxxxxxx
bash

Don’t have a key yet? Get one from Settings after signing in. You can also use the Playground to run live requests after signing in.

Authentication

All API requests require an API Key passed in the Authorization header:

Authorization: Bearer fp_your_api_key_here
bash

Get 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)
python

2. 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)
python

3. 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}
python

Webhook 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."
}
json

API Reference

POST/v1/extract

Extract

Extract a single URL and return agent-ready structured data.

ParameterTypeDescription
url*stringThe page URL to extract.
schemaobjectField map e.g. {"price": "number"}.
formatstringjson | markdown | html. Defaults to json.
js_renderbooleanRender JS via headless browser.
curl -X POST https://api.flypython.com/v1/extract \
  -H "Authorization: Bearer fp_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "json"}'
bash
POST/v1/crawl

Crawl

Bulk-extract multiple pages from a site with a single request.

ParameterTypeDescription
url*stringRoot URL to start crawling.
max_pagesnumberMax pages to crawl (default 10).
schemaobjectShared schema applied to each page.
curl -X POST https://api.flypython.com/v1/crawl \
  -H "Authorization: Bearer fp_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "max_pages": 10}'
bash
POST/v1/screenshot

Screenshot

Capture a full-page or viewport screenshot of any URL via Playwright.

ParameterTypeDescription
url*stringThe page URL to capture.
full_pagebooleanCapture full page (default) or viewport only.
js_renderbooleanWait for JS to render before capture.
curl -X POST https://api.flypython.com/v1/screenshot \
  -H "Authorization: Bearer fp_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "full_page": true}'
bash
POST/v1/interact

Interact

Run browser interaction steps (click, type, scroll) for agent workflows.

ParameterTypeDescription
url*stringThe page URL to interact with.
steps*arrayOrdered steps: {action, selector, value?}.
js_renderbooleanRender JS before running steps.
curl -X POST https://api.flypython.com/v1/interact \
  -H "Authorization: Bearer fp_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "steps": [{"action": "click", "selector": "#load-more"}]}'
bash
POST/v1/tasks

Monitor

Create a scheduled monitor that sends webhooks when meaningful fields change.

ParameterTypeDescription
target_url*stringThe URL to monitor.
selectorsobjectField schema to track for changes.
schedule_cronstringCron expression e.g. "0 */6 * * *".
destinationsarrayWebhook/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 * * *"}'
bash

Output 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.