Skip to main content

Pry Architecture 🟒

POST /v1/scrape ──▢ API Server (FastAPI)
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” miss β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Strategy │────────────▢│ Escalation chain β”‚
β”‚ Router β”‚ β”‚ 1. plain HTTP β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ 2. headless β”‚
β”‚ hit β”‚ 3. solver layer β”‚
β–Ό β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Result cache (Redis) β”‚
β”‚ β–Ό
β–Ό Extraction pipeline
Response (readability β†’ markdown/JSON)

Escalation chain​

Pry always tries the cheapest option first:

  1. Plain HTTP with tuned headers β€” fastest, works on most static sites.
  2. Headless Chromium (Playwright) β€” JS rendering, session handling.
  3. Solver layer β€” challenge bypass for protected sites.

Each level reports why it failed; the router records the winning strategy per domain so repeat scrapes skip straight to what works.

Storage​

  • Redis: result cache + per-domain strategy memory + rate limits.
  • Nothing is persisted by default β€” Pry is a proxy, not an archive. Enable the optional storage backend if you need scrape history.