Documentation

The Python-first web event layer for agents. Extract structured data, monitor meaningful field changes, and receive signed webhook events.

Quick Start: Extract to Webhook

1. Install the SDK

pip install flypython

2. Set your API key

export FLYPYTHON_API_KEY=fp_xxxxxxxx

3. Extract once

import flypython

result = flypython.extract(
    url="https://example.com/product",
    schema={"price": "number", "stock": "string"}
)
print(result.data)

4. 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"])

5. 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}

Webhook Event Shape

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

API Reference

POST/v1/extract

Extract

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

curl -X POST https://api.flypython.com/v1/extract \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "format": "json"}'
POST/v1/search

Search

Search the web and return LLM-ready results with markdown summaries.

curl -X POST https://api.flypython.com/v1/search \
  -H "Content-Type: application/json" \
  -d '{"query": "best LLM agents 2025", "limit": 5}'
POST/v1/crawl

Crawl

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

curl -X POST https://api.flypython.com/v1/crawl \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com", "max_pages": 10}'
POST/v1/tasks

Monitor

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

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 * * *"}'

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.

Authentication

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

Authorization: Bearer fp_your_api_key_here

Get your API key from the Settings page after signing in.

SDKs

🐍

Python SDK

pip install flypython

Full async & sync support, type hints, automatic retries, and streaming for large crawls.