📋 API Endpoints
PDF Conversion
POST /upload
Convert PDF to PNG images. Returns JSON with image URLs and metadata.
DELETE /cleanup/:uuid
Clean up PDF files for a specific UUID after analysis is complete.
Screenshot Capture
POST /screenshot
Capture screenshot of a URL. Returns JSON with screenshot URL and metadata.
DELETE /cleanup/screenshot/:urlHash
Clean up screenshot for a specific URL hash.
Maintenance
GET /cleanup
Clean up all old files (PDFs: 1 hour, Screenshots: 30 minutes).
GET /health
Health check endpoint for monitoring service status.
Screenshot Request Format
POST /screenshot
Content-Type: application/json
{
"url": "https://forms.google.com/d/xyz",
"options": {
"viewport": { "width": 1280, "height": 800 },
"waitTime": 4000,
"fullPage": true
}
}
Screenshot Response Format
{
"success": true,
"urlHash": "abc123def456",
"screenshot": {
"url": "https://your-service.railway.app/screenshots/abc123def456/screenshot.png",
"size": 245760,
"cached": false
},
"metadata": {
"finalUrl": "https://forms.google.com/d/xyz",
"pageTitle": "Contact Form",
"loadTime": 3245,
"viewport": { "width": 1280, "height": 800 }
},
"message": "Screenshot captured successfully"
}
Usage Notes
- PDF files are cleaned up after 1 hour automatically
- Screenshots are cached for 30 minutes and then cleaned up
- Each upload/screenshot gets a unique identifier to prevent conflicts
- Screenshots are optimized for form analysis with smart waiting and scrolling
- Both services support concurrent requests from multiple users
- Error responses include helpful suggestions for troubleshooting