REST API Microservice & Docker Deployment
Deploy Playtrafi as a standalone microservice for non-Python applications (Node.js, Go, Rust, Ruby, C#).
🚀 Launching the Microservice
Via CLI
Via Docker
Via Docker Compose
version: "3.8"
services:
playtrafi:
image: marcuszou/playtrafi:latest
container_name: playtrafi-api
restart: unless-stopped
ports:
- "4013:4013"
environment:
- PYTHONUNBUFFERED=1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4013/health"]
interval: 30s
timeout: 5s
retries: 3
📡 API Endpoints
1. Health Check (GET /health)
Response:
2. Scrape Single URL (POST /scrape)
curl -X POST http://localhost:4013/scrape \
-H "Content-Type: application/json" \
-d '{
"url": "https://news.ycombinator.com",
"screenshot": true,
"wait_for": ".athing"
}'