Cache-first web scraping API. Pay only for fresh scrapes — cache hits are always free.
npm install
node server.jsServer runs on http://0.0.0.0:3000 (or PORT env var).
Use X-API-Key: demo-key for all requests. Any non-empty key is accepted in demo mode.
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /scrape | Yes | Scrape a URL (cache-first) |
| GET | /cache/status | Yes | Check cache status for a URL |
| DELETE | /cache | Yes | Invalidate cache entry |
| GET | /usage | Yes | Usage stats for current key |
| GET | /health | No | Health check |
| GET | / | No | Landing page + playground |
| GET | /docs | No | API documentation |
# Scrape (fresh — costs 1 credit)
curl -X POST http://localhost:3000/scrape \
-H "X-API-Key: demo-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "ttl_seconds": 3600}'
# Scrape again (cache hit — free)
curl -X POST http://localhost:3000/scrape \
-H "X-API-Key: demo-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "ttl_seconds": 3600}'
# → "cached": true, "credits_used": 0Import https://github.com/Gabangxa/cachesnap-api at replit.com/new and click Run.
No configuration required — Replit installs dependencies automatically.