API Documentation

Complete reference for consuming the RocketUtils API.

# Authentication

All endpoints require an API Key passed in the custom header x-api-key.

Example header: x-api-key: rk_your_key_here

# Check Usage

Monitor your current monthly quota and limits programmatically.

GET

/v1/usage

curl -X GET https://rocketutils.dev/v1/usage \
  -H "x-api-key: YOUR_KEY"
POST

/v1/screenshot

Capture a high-quality screenshot of any public URL.

Request Body (JSON)

{
  "url": "https://google.com" // Required
}

Example

curl -X POST https://rocketutils.dev/v1/screenshot \
  --header "x-api-key: YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data '{"url": "https://example.com"}' \
  --output screenshot.png
POST

/v1/pdf

Generate PRint-ready PDFs from raw HTML string.

Request Body (JSON)

{
  "html": "<h1>Invoice</h1>" // Required
}

Example

curl -X POST https://rocketutils.dev/v1/pdf \
  --header "x-api-key: YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data '{"html": "

Hello

"}' \ --output doc.pdf
POST

/v1/optimize

Compress and convert images to high-performance WebP format. Ideal for reducing website load times.

Input Form-Data

  • image: File (JPG, PNG, WEBP)

Response

Binary WebP buffer with image/webp header.

Example (cURL)

curl -X POST https://rocketutils.dev/v1/optimize \
  -H "x-api-key: YOUR_KEY" \
  -F "image=@photo.jpg" \
  --output optimized.webp