Developer

API Documentation

Programmatic access to RoastMyPage analysis, batch workflows, history, and exports.

Last updated: 2026-01-09

Quickstart

  1. Create an account and choose a plan that includes API access (Pro or Enterprise).
  2. Generate an API key in Settings.
  3. Use the base URL https://roastmy.page.
  4. 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.

Authorization: Bearer rmp_your_api_key
Content-Type: application/json

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.

POST /api/analyze
{
"url": "https://example.com",
"targetAudience": "Founders and growth marketers",
"callToAction": "Book a demo",
"benefits": ["Faster load times", "Clearer value prop", "Higher conversions"]
}
GET /api/analyze/{analysisId}

Status values include PENDING, PROCESSING, COMPLETED, and FAILED.

Batch Analysis

Batch analysis processes multiple URLs with shared context. Limits depend on your plan.

POST /api/batch
{
"name": "Q1 Landing Pages",
"urls": ["https://a.com", "https://b.com"],
"targetAudience": "SMB owners",
"callToAction": "Start free trial",
"compareModels": true
}
GET /api/batch
GET /api/batch/{batchJobId}

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).