Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CacheSnap API

Cache-first web scraping API. Pay only for fresh scrapes — cache hits are always free.

Quick Start

npm install
node server.js

Server runs on http://0.0.0.0:3000 (or PORT env var).

Demo Key

Use X-API-Key: demo-key for all requests. Any non-empty key is accepted in demo mode.

Endpoints

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

Example

# 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": 0

Deploy on Replit

Import https://github.com/Gabangxa/cachesnap-api at replit.com/new and click Run. No configuration required — Replit installs dependencies automatically.

About

Cache-first web scraping API — pay only for new data, never for repeats.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages