Thumbnail Generator Documentation

Welcome to the official documentation for Robin's Website Thumbnail Generator. This guide covers everything you need to know to integrate our screenshot API into your projects.

Quick Start

Get started with the Thumbnail Generator in just a few minutes. Here's a simple example to capture your first screenshot:

HTTP
GET https://api.robinswebdesign.com/thumbnail?url=https://example.com&width=1280&height=720
💡 Tip

You can test the API directly in your browser by visiting the URL above with your desired parameters.

Authentication

All API requests require authentication using an API key. Include your key in the request header:

HTTP Header
Authorization: Bearer YOUR_API_KEY

To obtain an API key:

  1. Create an account or log in
  2. Navigate to your dashboard
  3. Generate a new API key in the "API Keys" section

API Endpoints

Screenshot Endpoint

The primary endpoint for generating website thumbnails:

Endpoint
GET /v1/thumbnail

Request Parameters

Parameter Type Required Description
url string Yes The URL of the website to capture
width integer No Screenshot width in pixels (default: 1280, max: 1920)
height integer No Screenshot height in pixels (default: 720, max: 1080)
format string No Output format: png, jpg, webp (default: png)
quality integer No Image quality 1-100 (default: 85, only for jpg/webp)
fullpage boolean No Capture full page scroll (default: false)
delay integer No Wait time in ms before capture (default: 0, max: 10000)

Response Format

Successful requests return the image directly with appropriate content-type headers. Error responses return JSON:

JSON Error Response
{
  "error": true,
  "code": "INVALID_URL",
  "message": "The provided URL is not valid or accessible",
  "status": 400
}

Code Examples

JavaScript / Node.js

JavaScript
const response = await fetch(
  'https://api.robinswebdesign.com/v1/thumbnail?' + 
  new URLSearchParams({
    url: 'https://example.com',
    width: '1280',
    height: '720',
    format: 'webp'
  }), 
  {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

const imageBlob = await response.blob();
const imageUrl = URL.createObjectURL(imageBlob);

Python

Python
import requests

response = requests.get(
    'https://api.robinswebdesign.com/v1/thumbnail',
    params={
        'url': 'https://example.com',
        'width': 1280,
        'height': 720,
        'format': 'png'
    },
    headers={
        'Authorization': 'Bearer YOUR_API_KEY'
    }
)

with open('screenshot.png', 'wb') as f:
    f.write(response.content)

cURL

Bash
curl -X GET "https://api.robinswebdesign.com/v1/thumbnail?url=https://example.com&width=1280" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output screenshot.png

Best Practices

📝 Note

Following these best practices will help you get the most out of the API while staying within rate limits.

  • Cache responses - Store generated thumbnails locally to reduce API calls
  • Use WebP format - Smaller file sizes with excellent quality
  • Set appropriate delays - For dynamic sites, use the delay parameter to ensure content loads
  • Handle errors gracefully - Implement retry logic with exponential backoff
  • Optimize dimensions - Request only the size you need to save bandwidth

Troubleshooting

Common Issues

⚠️ Blank Screenshots

If you're getting blank screenshots, try increasing the delay parameter to allow JavaScript content to load.

Error Codes

Code Description Solution
INVALID_URL URL format is incorrect Ensure URL includes protocol (https://)
TIMEOUT Page took too long to load Try a shorter delay or check if site is accessible
RATE_LIMITED Too many requests Wait before retrying, consider upgrading plan
UNAUTHORIZED Invalid API key Check your API key is correct and active

Need more help? Contact our support team or visit our main website.