API Documentation
Programmatic access to RoastMyPage analysis, batch workflows, history, and exports.
Last updated: 2026-01-09
Quickstart
- Create an account and choose a plan that includes API access (Pro or Enterprise).
- Generate an API key in Settings.
- Use the base URL https://roastmy.page.
- Call POST /api/analyze and poll the status endpoint.
Authentication
Browser-based requests rely on your NextAuth session cookie automatically. For server-to-server calls, include your API key using the Authorization header.
API access is available on Pro and Enterprise plans. Credits are consumed per URL analyzed.
Analyze a Single URL
Submit a URL and optional context. The API responds immediately with an analysis ID you can poll.
Status values include PENDING, PROCESSING, COMPLETED, and FAILED.
Batch Analysis
Batch analysis processes multiple URLs with shared context. Limits depend on your plan.
History and Exports
- GET /api/history with filters for status, score, date ranges, and sorting.
- POST /api/history to fetch a single analysis by ID.
- GET /api/export for LLM-friendly text exports (type=analysis|batch|summary).
- POST /api/export to generate a PDF report.
Error Handling
Errors return JSON with an error message and a relevant HTTP status code. Common responses include 400 (validation), 401 (unauthorized), 402 (insufficient credits), and 500 (server error).