API Documentation

Complete guide to integrate SnapAPI into your application

Get Your Free API Key

Introduction

SnapAPI is a production-ready screenshot API that allows you to capture screenshots of any website programmatically. Our infrastructure is optimized for speed, reliability, and scale.

The API is RESTful, uses standard HTTP methods, and returns responses in binary image formats. All requests must be authenticated using your API key.

New to SnapAPI?

Get started with 1,000 free screenshots per month. No credit card required.

Authentication

All API requests require authentication via your API key. You can find your API key in your dashboard.

apiKey=YOUR_API_KEY_HERE

Keep Your API Key Secret

Never share your API key publicly or commit it to version control. Treat it like a password.

Quick Start

Here's a simple example to get you started. Replace YOUR_API_KEY with your actual API key:

curl "https://api.snapapi.live/screenshot?url=https://example.com&apiKey=YOUR_API_KEY" -o screenshot.png

This will capture a screenshot of example.com and save it as screenshot.png.

Screenshot Endpoint

GET https://api.snapapi.live/screenshot

Captures a screenshot of the specified URL and returns the image in binary format.

Parameters

Parameter Type Required Description
url string Yes The URL of the website to capture
apiKey string Yes Your API authentication key
width integer No Viewport width (default: 1280, max: 3840)
height integer No Viewport height (default: 720, max: 2160)
fullPage boolean No Capture full page scroll (default: false)
format string No Image format: png, jpeg (default: png)

Responses

Success (200 OK): Returns the screenshot image in binary format.

Content-Type: image/png or image/jpeg

Error Codes

Code Description
400 Bad Request - Missing or invalid parameters
401 Unauthorized - Invalid or missing API key
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Something went wrong on our end

Code Examples

cURL

# Basic screenshot curl "https://api.snapapi.live/screenshot?url=https://example.com&apiKey=YOUR_KEY" -o screenshot.png # Custom dimensions curl "https://api.snapapi.live/screenshot?url=https://example.com&apiKey=YOUR_KEY&width=1920&height=1080" -o screenshot.png # Full page screenshot curl "https://api.snapapi.live/screenshot?url=https://example.com&apiKey=YOUR_KEY&fullPage=true" -o screenshot.png

JavaScript (Fetch API)

const response = await fetch( 'https://api.snapapi.live/screenshot?url=https://example.com&apiKey=YOUR_KEY' ); const blob = await response.blob(); const imageUrl = URL.createObjectURL(blob); // Use the image document.getElementById('screenshot').src = imageUrl;

Python

import requests # Take screenshot response = requests.get( 'https://api.snapapi.live/screenshot', params={ 'url': 'https://example.com', 'apiKey': 'YOUR_KEY', 'width': 1920, 'height': 1080 } ) # Save to file with open('screenshot.png', 'wb') as f: f.write(response.content)

Node.js (Axios)

const axios = require('axios'); const fs = require('fs'); const response = await axios.get( 'https://api.snapapi.live/screenshot', { params: { url: 'https://example.com', apiKey: 'YOUR_KEY' }, responseType: 'arraybuffer' } ); fs.writeFileSync('screenshot.png', response.data);

Rate Limits

Rate limits vary by plan:

Plan Monthly Limit Rate Limit
Free 1,000 requests 10 requests/minute
Starter 5,000 requests 30 requests/minute
Growth 25,000 requests 100 requests/minute
Pro 100,000 requests 500 requests/minute

Best Practices

Secure Your API Key

Store your API key in environment variables, not in your code. Use backend requests to keep your key secret.

Handle Rate Limits

Implement exponential backoff when you receive 429 errors. Monitor your usage in the dashboard.

Cache Screenshots

Cache screenshots when possible to reduce API calls and improve response times for your users.

Need Help?

Can't find what you're looking for? Our support team is here to help.

Contact Support Go to Dashboard