);
}
```
## Best practices
Store screenshot URLs in your database, not the actual images. AllScreenshots handles storage and CDN delivery.
### Retention strategy
* High-frequency monitors: Keep 7-30 days
* Daily monitors: Keep 90 days
* Compliance monitors: Keep as required (up to 365 days)
### Alert fatigue prevention
* Set appropriate change thresholds (1-5%)
* Group similar changes
* Implement snooze functionality
* Use digest emails for low-priority monitors
### Cost optimization
* Use appropriate capture frequencies
* Don't monitor pages that rarely change
* Use viewport sizes appropriate for your needs
* Consider thumbnail sizes for dashboard previews
# .NET SDK (/docs/sdks/csharp)
import { Callout } from 'fumadocs-ui/components/callout';
# .NET SDK
The official .NET SDK for the AllScreenshots API. Requires .NET 8.0 or later.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-dotnet) | **Package:** [AllScreenshots.Sdk](https://www.nuget.org/packages/AllScreenshots.Sdk)
## Installation
```bash
dotnet add package AllScreenshots.Sdk
```
Or via Package Manager Console:
```powershell
Install-Package AllScreenshots.Sdk
```
## Quick start
```csharp
using AllScreenshots.Sdk;
using AllScreenshots.Sdk.Models;
// Create client (reads API key from ALLSCREENSHOTS_API_KEY environment variable)
using var client = new AllScreenshotsClient();
// Take a screenshot
var imageBytes = await client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = "https://github.com",
Device = "Desktop HD"
});
// Save to file
File.WriteAllBytes("screenshot.png", imageBytes);
```
## Configuration
### Direct configuration
```csharp
using var client = new AllScreenshotsClient(new AllScreenshotsOptions
{
ApiKey = "your-api-key",
BaseUrl = "https://api.allscreenshots.com",
Timeout = TimeSpan.FromSeconds(60),
MaxRetries = 3
});
```
### Environment variables
Set `ALLSCREENSHOTS_API_KEY` to automatically configure authentication:
```csharp
// Client will read API key from environment
using var client = new AllScreenshotsClient();
```
## Capture screenshots
### Basic capture
```csharp
var imageBytes = await client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = "https://example.com"
});
File.WriteAllBytes("screenshot.png", imageBytes);
```
### With options
```csharp
var imageBytes = await client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = "https://example.com",
Device = "Desktop HD",
Format = "png",
FullPage = true,
DarkMode = true,
BlockAds = true,
BlockCookieBanners = true,
Delay = 1000
});
```
### Device presets
```csharp
// Desktop
var desktop = await client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = "https://example.com",
Device = "Desktop HD"
});
// Mobile
var mobile = await client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = "https://example.com",
Device = "iPhone 15"
});
// Tablet
var tablet = await client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = "https://example.com",
Device = "iPad Pro 11"
});
```
## Async jobs
For long-running captures:
```csharp
// Create async job
var job = await client.Screenshots.CaptureAsyncJobAsync(new ScreenshotRequest
{
Url = "https://example.com",
FullPage = true
});
Console.WriteLine($"Job ID: {job.JobId}");
// Poll for completion
var status = await client.Jobs.GetAsync(job.JobId);
if (status.Status == "completed")
{
var imageBytes = await client.Jobs.GetResultAsync(job.JobId);
File.WriteAllBytes("screenshot.png", imageBytes);
}
```
## Bulk capture
Process multiple URLs efficiently:
```csharp
var bulkJob = await client.Bulk.CreateAsync(new BulkRequest
{
Urls = new[]
{
new BulkUrl { Url = "https://example1.com" },
new BulkUrl { Url = "https://example2.com" },
new BulkUrl { Url = "https://example3.com" }
},
Defaults = new BulkDefaults
{
Device = "Desktop HD",
Format = "png"
}
});
// Check status
var status = await client.Bulk.GetAsync(bulkJob.BulkJobId);
```
## Composition
Combine multiple screenshots into a single image:
```csharp
var composed = await client.Screenshots.ComposeAsync(new ComposeRequest
{
Url = "https://example.com",
Variants = new[]
{
new Variant { Device = "Desktop HD", Label = "Desktop" },
new Variant { Device = "iPhone 15", Label = "Mobile" }
},
Output = new OutputOptions
{
Layout = "horizontal",
Spacing = 20
}
});
```
## Schedules
Create recurring screenshot captures:
```csharp
// Create a schedule
var schedule = await client.Schedules.CreateAsync(new CreateScheduleRequest
{
Name = "Daily Homepage",
Url = "https://example.com",
Schedule = "0 9 * * *",
Timezone = "America/New_York"
});
// List schedules
var schedules = await client.Schedules.ListAsync();
// Get captures
var captures = await client.Schedules.GetCapturesAsync(schedule.ScheduleId);
```
## Usage tracking
Monitor your API usage:
```csharp
var usage = await client.Usage.GetAsync();
Console.WriteLine($"Screenshots: {usage.ScreenshotCount}/{usage.Quota}");
```
## ASP.NET Core integration
```csharp
// Program.cs
builder.Services.AddAllScreenshots(options =>
{
options.ApiKey = builder.Configuration["AllScreenshots:ApiKey"];
});
// In your controller
public class ScreenshotController : ControllerBase
{
private readonly IAllScreenshotsClient _client;
public ScreenshotController(IAllScreenshotsClient client)
{
_client = client;
}
[HttpPost]
public async Task Capture([FromBody] CaptureRequest request)
{
var imageBytes = await _client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = request.Url
});
return File(imageBytes, "image/png");
}
}
```
## Error handling
```csharp
using AllScreenshots.Sdk.Exceptions;
try
{
var imageBytes = await client.Screenshots.CaptureAsync(request);
}
catch (RateLimitException ex)
{
Console.WriteLine($"Rate limited. Retry after {ex.RetryAfter}s");
}
catch (AuthenticationException)
{
Console.WriteLine("Invalid API key");
}
catch (ValidationException ex)
{
Console.WriteLine($"Validation error: {ex.Message}");
}
catch (AllScreenshotsException ex)
{
Console.WriteLine($"API error: {ex.Message}");
}
```
## Requirements
* .NET 8.0 or later
## License
Apache License 2.0
# Go SDK (/docs/sdks/go)
import { Callout } from 'fumadocs-ui/components/callout';
# Go SDK
The official Go SDK for the AllScreenshots API with idiomatic Go patterns and context support.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-go) | **Package:** `github.com/allscreenshots/allscreenshots-sdk-go`
## Installation
```bash
go get github.com/allscreenshots/allscreenshots-sdk-go
```
## Quick start
```go
package main
import (
"context"
"log"
"os"
"github.com/allscreenshots/allscreenshots-sdk-go/pkg/allscreenshots"
)
func main() {
client := allscreenshots.NewClient()
imageData, err := client.Screenshot(context.Background(),
&allscreenshots.ScreenshotRequest{
URL: "https://github.com",
Device: "Desktop HD",
})
if err != nil {
log.Fatal(err)
}
os.WriteFile("screenshot.png", imageData, 0644)
}
```
## Configuration
### Functional options
```go
client := allscreenshots.NewClient(
allscreenshots.WithAPIKey("your-api-key"),
allscreenshots.WithBaseURL("https://api.allscreenshots.com"),
allscreenshots.WithTimeout(60*time.Second),
allscreenshots.WithMaxRetries(3),
allscreenshots.WithHTTPClient(customHTTPClient),
)
```
### Environment variables
Set `ALLSCREENSHOTS_API_KEY` to automatically configure authentication:
```go
// Client will read API key from environment
client := allscreenshots.NewClient()
```
## Capture screenshots
### Basic capture
```go
imageData, err := client.Screenshot(ctx, &allscreenshots.ScreenshotRequest{
URL: "https://example.com",
})
if err != nil {
log.Fatal(err)
}
os.WriteFile("screenshot.png", imageData, 0644)
```
### With options
```go
imageData, err := client.Screenshot(ctx, &allscreenshots.ScreenshotRequest{
URL: "https://example.com",
Device: "Desktop HD",
Format: "png",
FullPage: true,
DarkMode: true,
BlockAds: true,
BlockCookieBanners: true,
Delay: 1000,
})
```
### Device presets
```go
// Desktop
desktop, _ := client.Screenshot(ctx, &allscreenshots.ScreenshotRequest{
URL: "https://example.com",
Device: "Desktop HD",
})
// Mobile
mobile, _ := client.Screenshot(ctx, &allscreenshots.ScreenshotRequest{
URL: "https://example.com",
Device: "iPhone 15",
})
// Tablet
tablet, _ := client.Screenshot(ctx, &allscreenshots.ScreenshotRequest{
URL: "https://example.com",
Device: "iPad Pro 11",
})
```
## Async jobs
For long-running captures:
```go
// Create async job
job, err := client.ScreenshotAsync(ctx, &allscreenshots.ScreenshotRequest{
URL: "https://example.com",
FullPage: true,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Job ID: %s\n", job.JobID)
// Poll for completion
result, err := client.GetJob(ctx, job.JobID)
if err != nil {
log.Fatal(err)
}
if result.Status == "completed" {
imageData, _ := client.GetJobResult(ctx, job.JobID)
os.WriteFile("screenshot.png", imageData, 0644)
}
```
## Bulk capture
Process multiple URLs efficiently:
```go
bulkJob, err := client.Bulk(ctx, &allscreenshots.BulkRequest{
URLs: []allscreenshots.BulkURL{
{URL: "https://example1.com"},
{URL: "https://example2.com"},
{URL: "https://example3.com"},
},
Defaults: &allscreenshots.BulkDefaults{
Device: "Desktop HD",
Format: "png",
},
})
// Check status
status, _ := client.GetBulkJob(ctx, bulkJob.BulkJobID)
```
## Composition
Combine multiple screenshots into a single image:
```go
composed, err := client.Compose(ctx, &allscreenshots.ComposeRequest{
URL: "https://example.com",
Variants: []allscreenshots.Variant{
{Device: "Desktop HD", Label: "Desktop"},
{Device: "iPhone 15", Label: "Mobile"},
},
Output: &allscreenshots.OutputOptions{
Layout: "horizontal",
Spacing: 20,
},
})
```
## Schedules
Create recurring screenshot captures:
```go
// Create a schedule
schedule, err := client.Schedules.Create(ctx, &allscreenshots.CreateScheduleRequest{
Name: "Daily Homepage",
URL: "https://example.com",
Schedule: "0 9 * * *",
Timezone: "America/New_York",
})
// List schedules
schedules, _ := client.Schedules.List(ctx)
// Get captures
captures, _ := client.Schedules.GetCaptures(ctx, schedule.ScheduleID)
```
## Usage tracking
Monitor your API usage:
```go
usage, err := client.Usage.Get(ctx)
fmt.Printf("Screenshots: %d/%d\n", usage.ScreenshotCount, usage.Quota)
```
## Error handling
The SDK provides typed errors with helper functions:
```go
imageData, err := client.Screenshot(ctx, request)
if err != nil {
if allscreenshots.IsRateLimited(err) {
var rateLimitErr *allscreenshots.RateLimitError
errors.As(err, &rateLimitErr)
fmt.Printf("Rate limited. Retry after %d seconds\n", rateLimitErr.RetryAfter)
return
}
if allscreenshots.IsUnauthorized(err) {
fmt.Println("Invalid API key")
return
}
if allscreenshots.IsValidationError(err) {
fmt.Printf("Validation error: %s\n", err.Error())
return
}
if allscreenshots.IsServerError(err) {
fmt.Printf("Server error: %s\n", err.Error())
return
}
log.Fatal(err)
}
```
## License
Apache License 2.0
# SDKs overview (/docs/sdks)
import { Cards, Card } from 'fumadocs-ui/components/card';
# SDKs
Official client libraries make it easy to integrate AllScreenshots into your applications. Each SDK provides type-safe methods, automatic retries, and idiomatic patterns for your language.
## Available SDKs
## Quick comparison
| Language | Package | Source |
| ---------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------- |
| TypeScript | [`allscreenshots`](https://www.npmjs.com/package/allscreenshots) | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-typescript) |
| JavaScript | [`allscreenshots`](https://www.npmjs.com/package/allscreenshots) | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-typescript) |
| Python | [`allscreenshots`](https://pypi.org/project/allscreenshots/) | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-python) |
| Go | `github.com/allscreenshots/allscreenshots-sdk-go` | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-go) |
| Java | `com.allscreenshots:allscreenshots-sdk` | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-java) |
| Kotlin | Uses Java SDK | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-java) |
| PHP | `allscreenshots/allscreenshots-sdk` | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-php) |
| .NET | `AllScreenshots` | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-dotnet) |
| Rust | `allscreenshots` | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-rust) |
| Swift | `allscreenshots-sdk-swift` | [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-swift) |
## Common features
All SDKs provide:
* **Type-safe requests** - Compile-time validation of parameters
* **Automatic retries** - Handles transient failures with exponential backoff
* **Rate limit handling** - Automatically waits and retries on 429 responses
* **Streaming downloads** - Efficient handling of large screenshots
* **Webhook verification** - Built-in signature validation helpers
* **Async support** - Non-blocking operations where applicable
## Request an SDK
Need an SDK for a language not listed? [Let us know](mailto:support@allscreenshots.com) and we'll prioritize based on demand.
# Java SDK (/docs/sdks/java)
import { Callout } from 'fumadocs-ui/components/callout';
# Java SDK
The official Java SDK for the AllScreenshots API. Requires Java 17 or higher.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-java) | **Maven:** `com.allscreenshots.sdk:allscreenshots-sdk`
## Installation
### Maven
```xml
com.allscreenshots.sdkallscreenshots-sdk1.0.0
```
### Gradle (Kotlin DSL)
```kotlin
dependencies {
implementation("com.allscreenshots.sdk:allscreenshots-sdk:1.0.0")
}
```
### Gradle (Groovy)
```groovy
dependencies {
implementation 'com.allscreenshots.sdk:allscreenshots-sdk:1.0.0'
}
```
## Quick start
```java
import com.allscreenshots.sdk.AllscreenshotsClient;
import com.allscreenshots.sdk.models.ScreenshotRequest;
import java.nio.file.Files;
import java.nio.file.Path;
public class Example {
public static void main(String[] args) throws Exception {
AllscreenshotsClient client = AllscreenshotsClient.builder().build();
byte[] image = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.device("Desktop HD")
.fullPage(true)
.build()
);
Files.write(Path.of("screenshot.png"), image);
}
}
```
## Configuration
### Builder pattern
```java
AllscreenshotsClient client = AllscreenshotsClient.builder()
.apiKey("your-api-key")
.baseUrl("https://api.allscreenshots.com")
.timeout(Duration.ofSeconds(60))
.maxRetries(3)
.build();
```
### Environment variables
Set `ALLSCREENSHOTS_API_KEY` to automatically configure authentication:
```java
// Client will read API key from environment
AllscreenshotsClient client = AllscreenshotsClient.builder().build();
```
## Capture screenshots
### Basic capture
```java
byte[] image = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.build()
);
Files.write(Path.of("screenshot.png"), image);
```
### With options
```java
byte[] image = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.device("Desktop HD")
.format("png")
.fullPage(true)
.darkMode(true)
.blockAds(true)
.blockCookieBanners(true)
.delay(1000)
.build()
);
```
### Device presets
```java
// Desktop
byte[] desktop = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.device("Desktop HD")
.build()
);
// Mobile
byte[] mobile = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.device("iPhone 15")
.build()
);
// Tablet
byte[] tablet = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.device("iPad Pro 11")
.build()
);
```
## Async jobs
For long-running captures:
```java
// Create async job
Job job = client.screenshots().captureAsync(
ScreenshotRequest.builder()
.url("https://example.com")
.fullPage(true)
.build()
);
System.out.println("Job ID: " + job.getJobId());
// Poll for completion
JobStatus status = client.jobs().get(job.getJobId());
if ("completed".equals(status.getStatus())) {
byte[] imageData = client.jobs().getResult(job.getJobId());
Files.write(Path.of("screenshot.png"), imageData);
}
```
## Bulk capture
Process multiple URLs efficiently:
```java
BulkJob bulkJob = client.bulk().create(
BulkRequest.builder()
.urls(List.of(
BulkUrl.of("https://example1.com"),
BulkUrl.of("https://example2.com"),
BulkUrl.of("https://example3.com")
))
.defaults(BulkDefaults.builder()
.device("Desktop HD")
.format("png")
.build())
.build()
);
// Check status
BulkJobStatus status = client.bulk().get(bulkJob.getBulkJobId());
```
## Composition
Combine multiple screenshots into a single image:
```java
byte[] composed = client.screenshots().compose(
ComposeRequest.builder()
.url("https://example.com")
.variants(List.of(
Variant.builder().device("Desktop HD").label("Desktop").build(),
Variant.builder().device("iPhone 15").label("Mobile").build()
))
.output(OutputOptions.builder()
.layout("horizontal")
.spacing(20)
.build())
.build()
);
```
## Schedules
Create recurring screenshot captures:
```java
// Create a schedule
Schedule schedule = client.schedules().create(
CreateScheduleRequest.builder()
.name("Daily Homepage")
.url("https://example.com")
.schedule("0 9 * * *")
.timezone("America/New_York")
.build()
);
// List schedules
List schedules = client.schedules().list();
// Get captures
List captures = client.schedules().getCaptures(schedule.getScheduleId());
```
## Usage tracking
Monitor your API usage:
```java
Usage usage = client.usage().get();
System.out.printf("Screenshots: %d/%d%n", usage.getScreenshotCount(), usage.getQuota());
```
## Error handling
```java
import com.allscreenshots.sdk.exceptions.*;
try {
byte[] image = client.screenshots().capture(request);
} catch (RateLimitException e) {
System.out.println("Rate limited. Retry after " + e.getRetryAfter() + "s");
} catch (AuthenticationException e) {
System.out.println("Invalid API key");
} catch (ValidationException e) {
System.out.println("Validation error: " + e.getMessage());
} catch (AllscreenshotsException e) {
System.out.println("API error: " + e.getMessage());
}
```
## Requirements
* Java 17 or higher
## License
Apache License 2.0
# JavaScript SDK (/docs/sdks/javascript)
import { Callout } from 'fumadocs-ui/components/callout';
# JavaScript SDK
The JavaScript SDK uses the same package as the [TypeScript SDK](/docs/sdks/typescript). For complete documentation, installation instructions, and examples, see the **[TypeScript SDK documentation](/docs/sdks/typescript)**.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-typescript) | **Package:** [@allscreenshots/sdk](https://www.npmjs.com/package/@allscreenshots/sdk)
## Installation
```bash
npm install @allscreenshots/sdk
```
## Quick start
```javascript
import { AllscreenshotsClient } from '@allscreenshots/sdk';
import fs from 'fs';
const client = new AllscreenshotsClient();
const imageBuffer = await client.screenshot({
url: 'https://github.com',
device: 'Desktop HD',
fullPage: true
});
fs.writeFileSync('screenshot.png', imageBuffer);
```
## Full documentation
For complete API documentation, configuration options, and advanced examples, see the [TypeScript SDK documentation](/docs/sdks/typescript).
The SDK works identically in JavaScript and TypeScript projects - TypeScript users benefit from full type definitions and IntelliSense support.
# Kotlin SDK (/docs/sdks/kotlin)
import { Callout } from 'fumadocs-ui/components/callout';
# Kotlin SDK
For Kotlin projects, use the [Java SDK](/docs/sdks/java). The Java SDK works seamlessly with Kotlin and provides full compatibility with Kotlin's language features.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-java) | **Maven:** `com.allscreenshots.sdk:allscreenshots-sdk`
## Installation
### Gradle (Kotlin DSL)
```kotlin
dependencies {
implementation("com.allscreenshots.sdk:allscreenshots-sdk:1.0.0")
}
```
### Gradle (Groovy)
```groovy
dependencies {
implementation 'com.allscreenshots.sdk:allscreenshots-sdk:1.0.0'
}
```
## Quick start
```kotlin
import com.allscreenshots.sdk.AllscreenshotsClient
import com.allscreenshots.sdk.models.ScreenshotRequest
import java.io.File
fun main() {
val client = AllscreenshotsClient.builder().build()
val image = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.device("Desktop HD")
.fullPage(true)
.build()
)
File("screenshot.png").writeBytes(image)
}
```
## Configuration
```kotlin
val client = AllscreenshotsClient.builder()
.apiKey("your-api-key")
.baseUrl("https://api.allscreenshots.com")
.timeout(Duration.ofSeconds(60))
.maxRetries(3)
.build()
```
## Capture with options
```kotlin
val image = client.screenshots().capture(
ScreenshotRequest.builder()
.url("https://example.com")
.device("Desktop HD")
.format("png")
.fullPage(true)
.darkMode(true)
.blockAds(true)
.build()
)
```
## Coroutines support
For async operations with Kotlin coroutines, you can wrap the SDK calls:
```kotlin
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
suspend fun captureScreenshot(url: String): ByteArray = withContext(Dispatchers.IO) {
client.screenshots().capture(
ScreenshotRequest.builder()
.url(url)
.build()
)
}
```
## Full documentation
For complete API documentation, configuration options, and advanced examples, see the [Java SDK documentation](/docs/sdks/java).
# PHP SDK (/docs/sdks/php)
import { Callout } from 'fumadocs-ui/components/callout';
# PHP SDK
The official PHP SDK for the AllScreenshots API with PSR-compatible HTTP client support.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-php) | **Package:** [allscreenshots/sdk](https://packagist.org/packages/allscreenshots/sdk)
## Installation
```bash
composer require allscreenshots/sdk
```
## Quick start
```php
build();
$request = new ScreenshotRequest('https://github.com');
$imageData = $client->screenshot($request);
file_put_contents('screenshot.png', $imageData);
```
## Configuration
### Builder pattern
```php
$client = AllscreenshotsClient::builder()
->apiKey('your-api-key')
->baseUrl('https://api.allscreenshots.com')
->timeout(60)
->maxRetries(3)
->build();
```
### Environment variables
Set `ALLSCREENSHOTS_API_KEY` to automatically configure authentication:
```php
// Client will read API key from environment
$client = AllscreenshotsClient::builder()->build();
```
## Capture screenshots
### Basic capture
```php
$request = new ScreenshotRequest('https://example.com');
$imageData = $client->screenshot($request);
file_put_contents('screenshot.png', $imageData);
```
### With options
```php
$request = new ScreenshotRequest('https://example.com');
$request->setDevice('Desktop HD');
$request->setFormat('png');
$request->setFullPage(true);
$request->setDarkMode(true);
$request->setBlockAds(true);
$request->setBlockCookieBanners(true);
$request->setDelay(1000);
$imageData = $client->screenshot($request);
```
### Device presets
```php
// Desktop
$request = new ScreenshotRequest('https://example.com');
$request->setDevice('Desktop HD');
$desktop = $client->screenshot($request);
// Mobile
$request = new ScreenshotRequest('https://example.com');
$request->setDevice('iPhone 15');
$mobile = $client->screenshot($request);
// Tablet
$request = new ScreenshotRequest('https://example.com');
$request->setDevice('iPad Pro 11');
$tablet = $client->screenshot($request);
```
## Async jobs
For long-running captures:
```php
// Create async job
$request = new ScreenshotRequest('https://example.com');
$request->setFullPage(true);
$job = $client->screenshotAsync($request);
echo "Job ID: " . $job->jobId . "\n";
// Poll for completion
$status = $client->jobs()->get($job->jobId);
if ($status->status === 'completed') {
$imageData = $client->jobs()->getResult($job->jobId);
file_put_contents('screenshot.png', $imageData);
}
```
## Bulk capture
Process multiple URLs efficiently:
```php
$bulkJob = $client->bulk()->create([
'urls' => [
['url' => 'https://example1.com'],
['url' => 'https://example2.com'],
['url' => 'https://example3.com'],
],
'defaults' => [
'device' => 'Desktop HD',
'format' => 'png',
],
]);
// Check status
$status = $client->bulk()->get($bulkJob->bulkJobId);
```
## Composition
Combine multiple screenshots into a single image:
```php
$composed = $client->compose([
'url' => 'https://example.com',
'variants' => [
['device' => 'Desktop HD', 'label' => 'Desktop'],
['device' => 'iPhone 15', 'label' => 'Mobile'],
],
'output' => [
'layout' => 'grid',
'spacing' => 20,
],
]);
```
## Schedules
Create recurring screenshot captures:
```php
// Create a schedule
$schedule = $client->schedules()->create([
'name' => 'Daily Homepage',
'url' => 'https://example.com',
'schedule' => '0 9 * * *',
'timezone' => 'America/New_York',
]);
// List schedules
$schedules = $client->schedules()->list();
// Get captures
$captures = $client->schedules()->getCaptures($schedule->scheduleId);
```
## Usage tracking
Monitor your API usage:
```php
$usage = $client->usage()->get();
echo "Screenshots: {$usage->screenshotCount}/{$usage->quota}\n";
```
## Laravel integration
```php
// config/services.php
'allscreenshots' => [
'api_key' => env('ALLSCREENSHOTS_API_KEY'),
],
// app/Providers/AppServiceProvider.php
use Allscreenshots\Sdk\Client\AllscreenshotsClient;
public function register()
{
$this->app->singleton(AllscreenshotsClient::class, function () {
return AllscreenshotsClient::builder()
->apiKey(config('services.allscreenshots.api_key'))
->build();
});
}
// In your controller
public function capture(Request $request, AllscreenshotsClient $client)
{
$screenshotRequest = new ScreenshotRequest($request->url);
$imageData = $client->screenshot($screenshotRequest);
return response($imageData)->header('Content-Type', 'image/png');
}
```
## Error handling
```php
use Allscreenshots\Sdk\Exceptions\AuthenticationException;
use Allscreenshots\Sdk\Exceptions\ValidationException;
use Allscreenshots\Sdk\Exceptions\RateLimitException;
use Allscreenshots\Sdk\Exceptions\NotFoundException;
use Allscreenshots\Sdk\Exceptions\ServerException;
use Allscreenshots\Sdk\Exceptions\NetworkException;
try {
$imageData = $client->screenshot($request);
} catch (RateLimitException $e) {
echo "Rate limited. Retry after {$e->getRetryAfter()}s\n";
} catch (AuthenticationException $e) {
echo "Invalid API key\n";
} catch (ValidationException $e) {
echo "Validation error: {$e->getMessage()}\n";
} catch (ServerException $e) {
echo "Server error: {$e->getMessage()}\n";
}
```
## License
Apache License 2.0
# Python SDK (/docs/sdks/python)
import { Callout } from 'fumadocs-ui/components/callout';
# Python SDK
The official Python SDK for the AllScreenshots API with synchronous and asynchronous client support.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-python) | **Package:** [allscreenshots-sdk](https://pypi.org/project/allscreenshots-sdk/)
## Installation
```bash
pip install allscreenshots-sdk
# or
uv add allscreenshots-sdk
```
## Quick start
```python
from allscreenshots_sdk import AllscreenshotsClient
client = AllscreenshotsClient.builder().build()
image_bytes = client.screenshots.capture("https://example.com")
with open("screenshot.png", "wb") as f:
f.write(image_bytes)
client.close()
```
## Configuration
### Builder pattern
```python
client = (
AllscreenshotsClient.builder()
.with_api_key("your-api-key")
.with_base_url("https://api.allscreenshots.com")
.with_timeout(60)
.with_max_retries(3)
.build()
)
```
### Environment variables
Set `ALLSCREENSHOTS_API_KEY` to automatically configure authentication:
```python
# Client will read API key from environment
client = AllscreenshotsClient.builder().build()
```
### Context manager
```python
with AllscreenshotsClient.builder().with_api_key("your-api-key").build() as client:
image = client.screenshots.capture("https://example.com", device="Desktop HD")
with open("screenshot.png", "wb") as f:
f.write(image)
```
## Async client
```python
import asyncio
from allscreenshots_sdk import AllscreenshotsClient
async def main():
async with AllscreenshotsClient.builder().with_api_key("your-api-key").build_async() as client:
image = await client.screenshots.capture("https://example.com")
with open("screenshot.png", "wb") as f:
f.write(image)
asyncio.run(main())
```
## Capture screenshots
### Basic capture
```python
image_bytes = client.screenshots.capture("https://example.com")
with open("screenshot.png", "wb") as f:
f.write(image_bytes)
```
### With options
```python
image = client.screenshots.capture(
"https://example.com",
device="Desktop HD",
format="png",
full_page=True,
dark_mode=True,
block_ads=True,
block_cookie_banners=True,
delay=1000,
)
```
### Device presets
```python
# Desktop
desktop = client.screenshots.capture("https://example.com", device="Desktop HD")
# Mobile
mobile = client.screenshots.capture("https://example.com", device="iPhone 15")
# Tablet
tablet = client.screenshots.capture("https://example.com", device="iPad Pro 11")
```
## Async jobs
For long-running captures:
```python
# Create async job
job = client.screenshots.capture_async("https://example.com", full_page=True)
print(f"Job ID: {job.job_id}")
# Poll for completion
result = client.jobs.get(job.job_id)
if result.status == "completed":
image_data = client.jobs.get_result(job.job_id)
with open("screenshot.png", "wb") as f:
f.write(image_data)
```
## Bulk capture
Process multiple URLs efficiently:
```python
bulk_job = client.bulk.create(
urls=[
{"url": "https://example1.com"},
{"url": "https://example2.com"},
{"url": "https://example3.com"},
],
defaults={
"device": "Desktop HD",
"format": "png",
},
)
# Check status
status = client.bulk.get(bulk_job.bulk_job_id)
```
## Composition
Combine multiple screenshots into a single image:
```python
composed = client.screenshots.compose(
url="https://example.com",
variants=[
{"device": "Desktop HD", "label": "Desktop"},
{"device": "iPhone 15", "label": "Mobile"},
],
output={
"layout": "HORIZONTAL",
"spacing": 20,
},
)
```
Available layouts: `GRID`, `HORIZONTAL`, `VERTICAL`, `MASONRY`, `MONDRIAN`
## Schedules
Create recurring screenshot captures:
```python
# Create a schedule
schedule = client.schedules.create(
name="Daily Homepage",
url="https://example.com",
schedule="0 9 * * *",
timezone="America/New_York",
)
# List schedules
schedules = client.schedules.list()
# Get captures
captures = client.schedules.get_captures(schedule.schedule_id)
```
## Usage tracking
Monitor your API usage:
```python
usage = client.usage.get()
print(f"Screenshots: {usage.screenshot_count}/{usage.quota}")
```
## Error handling
```python
from allscreenshots_sdk import (
AllscreenshotsError,
AuthenticationError,
ValidationError,
RateLimitError,
NotFoundException,
ServerError,
)
try:
screenshot = client.screenshots.capture("https://example.com")
except RateLimitError as e:
print(f"Rate limited. Retry after {e.retry_after}s")
except AuthenticationError:
print("Invalid API key")
except ValidationError as e:
print(f"Validation error: {e.message}")
except AllscreenshotsError as e:
print(f"API error: {e.message}")
```
## License
Apache License 2.0
# Ruby SDK (/docs/sdks/ruby)
import { Callout } from 'fumadocs-ui/components/callout';
# Ruby SDK
The Ruby SDK is coming soon. Sign up for updates at [allscreenshots.com](https://allscreenshots.com).
## Installation
```ruby
# Gemfile
gem 'allscreenshots'
```
```bash
bundle install
```
Or install directly:
```bash
gem install allscreenshots
```
## Quick start
```ruby
require 'allscreenshots'
client = AllScreenshots::Client.new(api_key: ENV['ALLSCREENSHOTS_API_KEY'])
# Capture a screenshot
screenshot = client.screenshots.capture(url: 'https://example.com')
# Save to file
File.binwrite('screenshot.png', screenshot)
```
## Capture options
```ruby
screenshot = client.screenshots.capture(
url: 'https://example.com',
viewport: { width: 1920, height: 1080 },
full_page: true,
dark_mode: true,
block_ads: true,
block_cookie_banners: true
)
# JSON response
result = client.screenshots.capture(
url: 'https://example.com',
response_type: :json
)
puts result.url
```
## Device presets
```ruby
screenshot = client.screenshots.capture(
url: 'https://example.com',
device: :iphone_15
)
```
## Bulk capture
```ruby
bulk_job = client.screenshots.bulk(
urls: [
{ url: 'https://example1.com' },
{ url: 'https://example2.com' },
{ url: 'https://example3.com' }
],
defaults: {
format: :png,
viewport: { width: 1280, height: 720 }
}
)
results = client.bulk.wait_for(bulk_job.bulk_job_id)
```
## Composition
```ruby
composed = client.screenshots.compose(
url: 'https://example.com',
variants: [
{ device: :desktop_hd, label: 'Desktop' },
{ device: :iphone_15, label: 'Mobile' }
],
output: {
layout: :horizontal,
spacing: 20
}
)
```
## Rails integration
```ruby
# config/initializers/allscreenshots.rb
AllScreenshots.configure do |config|
config.api_key = Rails.application.credentials.allscreenshots_api_key
end
# In your controller or service
class ScreenshotService
def capture(url)
AllScreenshots.client.screenshots.capture(url: url)
end
end
```
## Webhook verification
```ruby
# app/controllers/webhooks_controller.rb
class WebhooksController < ApplicationController
skip_before_action :verify_authenticity_token
def allscreenshots
signature = request.headers['X-Allscreenshots-Signature']
payload = request.raw_post
unless AllScreenshots::Webhook.verify(payload, signature, webhook_secret)
head :unauthorized
return
end
event = JSON.parse(payload)
# Process webhook...
head :ok
end
private
def webhook_secret
Rails.application.credentials.allscreenshots_webhook_secret
end
end
```
## Error handling
```ruby
begin
screenshot = client.screenshots.capture(url: 'https://example.com')
rescue AllScreenshots::RateLimitError => e
puts "Rate limited. Retry after #{e.retry_after}s"
rescue AllScreenshots::APIError => e
puts "API error: #{e.message}"
end
```
## Configuration
```ruby
client = AllScreenshots::Client.new(
api_key: 'your-api-key',
base_url: 'https://api.allscreenshots.com',
timeout: 60,
max_retries: 3
)
```
# Rust SDK (/docs/sdks/rust)
import { Callout } from 'fumadocs-ui/components/callout';
# Rust SDK
The official Rust SDK for the AllScreenshots API with async-first design using the tokio runtime.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-rust) | **Crate:** [allscreenshots-sdk](https://crates.io/crates/allscreenshots-sdk)
## Installation
Add to your `Cargo.toml`:
```toml
[dependencies]
allscreenshots-sdk = "0.1"
tokio = { version = "1", features = ["full"] }
```
## Quick start
```rust
use allscreenshots_sdk::{AllscreenshotsClient, ScreenshotRequest};
#[tokio::main]
async fn main() -> Result<(), Box> {
let client = AllscreenshotsClient::from_env()?;
let request = ScreenshotRequest::builder()
.url("https://github.com")
.device("Desktop HD")
.build()?;
let image_bytes = client.screenshot(&request).await?;
std::fs::write("screenshot.png", &image_bytes)?;
println!("Screenshot saved to screenshot.png");
Ok(())
}
```
## Configuration
### From environment
```rust
// Reads API key from ALLSCREENSHOTS_API_KEY environment variable
let client = AllscreenshotsClient::from_env()?;
```
### Builder pattern
```rust
use std::time::Duration;
let client = AllscreenshotsClient::builder()
.api_key("your-api-key")
.base_url("https://api.allscreenshots.com")
.timeout(Duration::from_secs(60))
.max_retries(3)
.build()?;
```
## Capture screenshots
### Basic capture
```rust
let request = ScreenshotRequest::builder()
.url("https://example.com")
.build()?;
let image_bytes = client.screenshot(&request).await?;
std::fs::write("screenshot.png", &image_bytes)?;
```
### With options
```rust
let request = ScreenshotRequest::builder()
.url("https://example.com")
.device("Desktop HD")
.format("png")
.full_page(true)
.dark_mode(true)
.block_ads(true)
.block_cookie_banners(true)
.delay(1000)
.build()?;
let image_bytes = client.screenshot(&request).await?;
```
### Device presets
```rust
// Desktop
let desktop = client.screenshot(
&ScreenshotRequest::builder()
.url("https://example.com")
.device("Desktop HD")
.build()?
).await?;
// Mobile
let mobile = client.screenshot(
&ScreenshotRequest::builder()
.url("https://example.com")
.device("iPhone 15")
.build()?
).await?;
// Tablet
let tablet = client.screenshot(
&ScreenshotRequest::builder()
.url("https://example.com")
.device("iPad Pro 11")
.build()?
).await?;
```
## Async jobs
For long-running captures:
```rust
// Create async job
let job = client.screenshot_async(
&ScreenshotRequest::builder()
.url("https://example.com")
.full_page(true)
.build()?
).await?;
println!("Job ID: {}", job.job_id);
// Poll for completion
let status = client.get_job(&job.job_id).await?;
if status.status == "completed" {
let image_bytes = client.get_job_result(&job.job_id).await?;
std::fs::write("screenshot.png", &image_bytes)?;
}
```
## Bulk capture
Process multiple URLs efficiently:
```rust
use allscreenshots_sdk::{BulkRequest, BulkUrl, BulkDefaults};
let bulk_job = client.bulk(&BulkRequest {
urls: vec![
BulkUrl { url: "https://example1.com".to_string(), ..Default::default() },
BulkUrl { url: "https://example2.com".to_string(), ..Default::default() },
BulkUrl { url: "https://example3.com".to_string(), ..Default::default() },
],
defaults: Some(BulkDefaults {
device: Some("Desktop HD".to_string()),
format: Some("png".to_string()),
..Default::default()
}),
}).await?;
// Check status
let status = client.get_bulk_job(&bulk_job.bulk_job_id).await?;
```
## Composition
Combine multiple screenshots into a single image:
```rust
use allscreenshots_sdk::{ComposeRequest, Variant, OutputOptions};
let composed = client.compose(&ComposeRequest {
url: "https://example.com".to_string(),
variants: vec![
Variant { device: "Desktop HD".to_string(), label: Some("Desktop".to_string()) },
Variant { device: "iPhone 15".to_string(), label: Some("Mobile".to_string()) },
],
output: Some(OutputOptions {
layout: Some("horizontal".to_string()),
spacing: Some(20),
..Default::default()
}),
}).await?;
```
## Schedules
Create recurring screenshot captures:
```rust
use allscreenshots_sdk::CreateScheduleRequest;
// Create a schedule
let schedule = client.schedules().create(&CreateScheduleRequest {
name: "Daily Homepage".to_string(),
url: "https://example.com".to_string(),
schedule: "0 9 * * *".to_string(),
timezone: Some("America/New_York".to_string()),
..Default::default()
}).await?;
// List schedules
let schedules = client.schedules().list().await?;
// Get captures
let captures = client.schedules().get_captures(&schedule.schedule_id).await?;
```
## Usage tracking
Monitor your API usage:
```rust
let usage = client.usage().get().await?;
println!("Screenshots: {}/{}", usage.screenshot_count, usage.quota);
```
## Error handling
The SDK provides typed errors for different scenarios:
```rust
use allscreenshots_sdk::Error;
match client.screenshot(&request).await {
Ok(image_bytes) => {
std::fs::write("screenshot.png", &image_bytes)?;
}
Err(Error::RateLimit { retry_after }) => {
println!("Rate limited. Retry after {}s", retry_after);
}
Err(Error::Authentication(_)) => {
println!("Invalid API key");
}
Err(Error::Validation(msg)) => {
println!("Validation error: {}", msg);
}
Err(Error::Timeout) => {
println!("Request timed out");
}
Err(e) => {
println!("Error: {}", e);
}
}
```
## Concurrent requests
```rust
use futures::future::join_all;
let urls = vec![
"https://example1.com",
"https://example2.com",
"https://example3.com",
];
let futures: Vec<_> = urls.iter().map(|url| {
let client = client.clone();
async move {
let request = ScreenshotRequest::builder()
.url(*url)
.build()
.unwrap();
client.screenshot(&request).await
}
}).collect();
let results = join_all(futures).await;
```
## License
Apache License 2.0
# Swift SDK (/docs/sdks/swift)
import { Callout } from 'fumadocs-ui/components/callout';
# Swift SDK
The official Swift SDK for the AllScreenshots API with native async/await support.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-swift) | **Package:** `allscreenshots-sdk-swift`
## Requirements
* Swift 5.9 or higher
* iOS 15.0+ / macOS 12.0+ / tvOS 15.0+ / watchOS 8.0+
## Installation
Add to your `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/allscreenshots/allscreenshots-sdk-swift.git", from: "1.0.0")
]
```
Then add the dependency to your target:
```swift
targets: [
.target(
name: "YourTarget",
dependencies: ["AllScreenshotsSDK"]
)
]
```
## Quick start
```swift
import AllScreenshotsSDK
let client = try AllScreenshotsClient()
let request = ScreenshotRequest(
url: "https://example.com",
device: "Desktop HD"
)
let imageData = try await client.takeScreenshot(request)
try imageData.write(to: URL(fileURLWithPath: "screenshot.png"))
```
## Configuration
### From environment
```swift
// Reads API key from ALLSCREENSHOTS_API_KEY environment variable
let client = try AllScreenshotsClient()
```
### Direct configuration
```swift
let client = try AllScreenshotsClient(
apiKey: "your-api-key",
baseUrl: "https://api.allscreenshots.com",
timeout: 60
)
```
## Capture screenshots
### Basic capture
```swift
let request = ScreenshotRequest(url: "https://example.com")
let imageData = try await client.takeScreenshot(request)
```
### With options
```swift
let request = ScreenshotRequest(
url: "https://example.com",
device: "Desktop HD",
format: .png,
fullPage: true,
darkMode: true,
blockAds: true,
blockCookieBanners: true,
delay: 1000
)
let imageData = try await client.takeScreenshot(request)
```
### Device presets
```swift
// Desktop
let desktop = try await client.takeScreenshot(
ScreenshotRequest(url: "https://example.com", device: "Desktop HD")
)
// Mobile
let mobile = try await client.takeScreenshot(
ScreenshotRequest(url: "https://example.com", device: "iPhone 15")
)
// Tablet
let tablet = try await client.takeScreenshot(
ScreenshotRequest(url: "https://example.com", device: "iPad Pro 11")
)
```
## Async jobs
For long-running captures:
```swift
// Create async job
let job = try await client.takeScreenshotAsync(
ScreenshotRequest(url: "https://example.com", fullPage: true)
)
print("Job ID: \(job.id)")
// Poll for completion
while true {
let status = try await client.getJob(job.id)
if status.status == .completed {
let imageData = try await client.getJobResult(job.id)
try imageData.write(to: URL(fileURLWithPath: "screenshot.png"))
break
}
try await Task.sleep(nanoseconds: 1_000_000_000) // 1 second
}
```
## Bulk capture
Process multiple URLs efficiently:
```swift
let bulkJob = try await client.createBulkJob(
urls: [
BulkUrl(url: "https://example1.com"),
BulkUrl(url: "https://example2.com"),
BulkUrl(url: "https://example3.com")
],
defaults: BulkDefaults(
device: "Desktop HD",
format: .png
)
)
// Check status
let status = try await client.getBulkJob(bulkJob.bulkJobId)
```
## Composition
Combine multiple screenshots into a single image:
```swift
let composed = try await client.compose(
url: "https://example.com",
variants: [
Variant(device: "Desktop HD", label: "Desktop"),
Variant(device: "iPhone 15", label: "Mobile")
],
output: OutputOptions(layout: .horizontal, spacing: 20)
)
```
## Schedules
Create recurring screenshot captures:
```swift
// Create a schedule
let schedule = try await client.createSchedule(
name: "Daily Homepage",
url: "https://example.com",
schedule: "0 9 * * *",
timezone: "America/New_York"
)
// List schedules
let schedules = try await client.listSchedules()
// Get captures
let captures = try await client.getScheduleCaptures(schedule.scheduleId)
```
## Usage tracking
Monitor your API usage:
```swift
let usage = try await client.getUsage()
print("Screenshots: \(usage.screenshotCount)/\(usage.quota)")
```
## SwiftUI integration
```swift
import SwiftUI
import AllScreenshotsSDK
struct ScreenshotView: View {
@State private var image: UIImage?
@State private var isLoading = false
let client = try! AllScreenshotsClient()
var body: some View {
VStack {
if let image = image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fit)
} else if isLoading {
ProgressView()
}
Button("Take Screenshot") {
Task {
await captureScreenshot()
}
}
}
}
func captureScreenshot() async {
isLoading = true
defer { isLoading = false }
do {
let request = ScreenshotRequest(
url: "https://example.com",
device: "iPhone 15"
)
let data = try await client.takeScreenshot(request)
image = UIImage(data: data)
} catch {
print("Error: \(error)")
}
}
}
```
## Error handling
```swift
do {
let imageData = try await client.takeScreenshot(request)
} catch AllScreenshotsError.rateLimited(let retryAfter) {
print("Rate limited. Retry after \(retryAfter)s")
} catch AllScreenshotsError.authentication {
print("Invalid API key")
} catch AllScreenshotsError.validation(let message) {
print("Validation error: \(message)")
} catch AllScreenshotsError.timeout {
print("Request timed out")
} catch {
print("Error: \(error)")
}
```
## Concurrent requests
```swift
let urls = [
"https://example1.com",
"https://example2.com",
"https://example3.com"
]
let screenshots = try await withThrowingTaskGroup(of: (String, Data).self) { group in
for url in urls {
group.addTask {
let request = ScreenshotRequest(url: url)
let data = try await client.takeScreenshot(request)
return (url, data)
}
}
var results: [(String, Data)] = []
for try await result in group {
results.append(result)
}
return results
}
```
## License
Apache License 2.0
# TypeScript SDK (/docs/sdks/typescript)
import { Callout } from 'fumadocs-ui/components/callout';
# TypeScript SDK
The official TypeScript SDK for the AllScreenshots API with full type definitions and IntelliSense support.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-sdk-typescript) | **Package:** [@allscreenshots/sdk](https://www.npmjs.com/package/@allscreenshots/sdk)
## Requirements
* Node.js 18.0.0 or higher
* TypeScript 5.0+ (for TypeScript projects)
## Installation
```bash
npm install @allscreenshots/sdk
# or
pnpm add @allscreenshots/sdk
# or
yarn add @allscreenshots/sdk
```
## Quick start
```typescript
import { AllscreenshotsClient } from '@allscreenshots/sdk';
import fs from 'fs';
const client = new AllscreenshotsClient();
const imageBuffer = await client.screenshot({
url: 'https://github.com',
device: 'Desktop HD',
fullPage: true
});
fs.writeFileSync('screenshot.png', imageBuffer);
```
## Configuration
The client can be configured using the builder pattern, direct configuration, or environment variables.
### Builder pattern
```typescript
import { AllscreenshotsClient } from '@allscreenshots/sdk';
const client = AllscreenshotsClient.builder()
.apiKey(process.env.ALLSCREENSHOTS_API_KEY!)
.baseUrl('https://api.allscreenshots.com')
.timeout(60000)
.maxRetries(3)
.build();
```
### Direct configuration
```typescript
const client = new AllscreenshotsClient({
apiKey: process.env.ALLSCREENSHOTS_API_KEY!,
baseUrl: 'https://api.allscreenshots.com',
timeout: 60000,
autoRetry: true,
maxRetries: 3,
});
```
### Environment variables
Set `ALLSCREENSHOTS_API_KEY` to automatically configure authentication:
```typescript
// Client will read API key from environment
const client = new AllscreenshotsClient();
```
## Capture screenshots
### Basic capture
```typescript
const screenshot = await client.screenshot({
url: 'https://example.com',
});
fs.writeFileSync('screenshot.png', screenshot);
```
### With options
```typescript
const screenshot = await client.screenshot({
url: 'https://example.com',
device: 'Desktop HD',
format: 'png',
quality: 90,
fullPage: true,
darkMode: true,
blockAds: true,
blockCookieBanners: true,
delay: 1000,
});
```
### Device presets
```typescript
// Desktop
const desktop = await client.screenshot({
url: 'https://example.com',
device: 'Desktop HD',
});
// Mobile
const mobile = await client.screenshot({
url: 'https://example.com',
device: 'iPhone 15',
});
// Tablet
const tablet = await client.screenshot({
url: 'https://example.com',
device: 'iPad Pro 11',
});
```
## Async jobs
For long-running captures, use async jobs:
```typescript
// Create async job
const job = await client.screenshotAsync({
url: 'https://example.com',
fullPage: true,
});
console.log(`Job ID: ${job.jobId}`);
// Poll for completion
const result = await client.getJob(job.jobId);
if (result.status === 'completed') {
const imageData = await client.getJobResult(job.jobId);
fs.writeFileSync('screenshot.png', imageData);
}
```
## Bulk capture
Process multiple URLs efficiently:
```typescript
const bulkJob = await client.bulk({
urls: [
{ url: 'https://example1.com' },
{ url: 'https://example2.com' },
{ url: 'https://example3.com' },
],
defaults: {
device: 'Desktop HD',
format: 'png',
},
});
// Check status
const status = await client.getBulkJob(bulkJob.bulkJobId);
```
## Composition
Combine multiple screenshots into a single image:
```typescript
const composed = await client.compose({
url: 'https://example.com',
variants: [
{ device: 'Desktop HD', label: 'Desktop' },
{ device: 'iPhone 15', label: 'Mobile' },
],
output: {
layout: 'horizontal',
spacing: 20,
},
});
```
## Schedules
Create recurring screenshot captures:
```typescript
// Create a schedule
const schedule = await client.schedules.create({
name: 'Daily Homepage',
url: 'https://example.com',
schedule: '0 9 * * *',
timezone: 'America/New_York',
});
// List schedules
const schedules = await client.schedules.list();
// Get captures
const captures = await client.schedules.getCaptures(schedule.scheduleId);
```
## Usage tracking
Monitor your API usage:
```typescript
const usage = await client.usage.get();
console.log(`Screenshots: ${usage.screenshotCount}/${usage.quota}`);
```
## Error handling
The SDK provides typed error classes for granular exception handling:
```typescript
import {
AllscreenshotsError,
AuthenticationError,
ValidationError,
RateLimitError,
QuotaExceededError,
ServerError,
NetworkError,
TimeoutError
} from '@allscreenshots/sdk';
try {
const screenshot = await client.screenshot({
url: 'https://example.com',
});
} catch (error) {
if (error instanceof RateLimitError) {
console.log(`Rate limited. Retry after ${error.retryAfter}s`);
} else if (error instanceof QuotaExceededError) {
console.log('Quota exceeded for this billing period');
} else if (error instanceof AuthenticationError) {
console.log('Invalid API key');
} else if (error instanceof ValidationError) {
console.log(`Validation error: ${error.message}`);
} else if (error instanceof AllscreenshotsError) {
console.log(`API error: ${error.message}`);
}
}
```
## Type definitions
### ScreenshotOptions
```typescript
interface ScreenshotOptions {
url: string;
viewport?: {
width?: number; // 100-4096, default: 1920
height?: number; // 100-4096, default: 1080
deviceScaleFactor?: number; // 1-3, default: 1
};
device?: DevicePreset;
format?: 'png' | 'jpeg' | 'webp' | 'pdf';
quality?: number; // 1-100
fullPage?: boolean;
selector?: string;
delay?: number; // 0-30000
waitFor?: string;
waitUntil?: 'load' | 'domcontentloaded' | 'networkidle';
timeout?: number; // 1000-60000
darkMode?: boolean;
customCss?: string;
hideSelectors?: string[];
blockAds?: boolean;
blockCookieBanners?: boolean;
}
```
### DevicePreset
```typescript
type DevicePreset =
// Desktop
| 'Desktop HD'
| 'Desktop Large'
| 'Laptop'
// iPhone
| 'iPhone SE'
| 'iPhone 12'
| 'iPhone 14'
| 'iPhone 15'
| 'iPhone 15 Pro Max'
// iPad
| 'iPad'
| 'iPad Mini'
| 'iPad Pro 11'
| 'iPad Pro 12.9'
// Android
| 'Pixel 7'
| 'Samsung Galaxy S23'
// Social
| 'Facebook OG'
| 'Twitter Card'
| 'LinkedIn Post';
```
## License
Apache License 2.0
# CLI (/docs/tools/cli)
import { Callout } from 'fumadocs-ui/components/callout';
import { Steps, Step } from 'fumadocs-ui/components/steps';
import { Tabs, Tab } from 'fumadocs-ui/components/tabs';
# Command line interface
Capture website screenshots directly from your terminal. Perfect for automation, shell scripts, and quick captures.
**Source code:** [GitHub](https://github.com/allscreenshots/allscreenshots-cli) | **Homebrew:** `brew install allscreenshots/allscreenshots/allscreenshots`
## Installation
```bash
brew tap allscreenshots/allscreenshots
brew install allscreenshots
```
```bash
cargo install allscreenshots-cli
```
```bash
git clone https://github.com/allscreenshots/allscreenshots-cli
cd allscreenshots-cli
cargo build --release
```
## Quick start
### Set up authentication
Get your API key from the [dashboard](https://dashboard.allscreenshots.com/api-keys), then store it for future use:
```bash
allscreenshots config add-authtoken YOUR_API_KEY
```
Or set it as an environment variable:
```bash
export ALLSCREENSHOTS_API_KEY=YOUR_API_KEY
```
### Capture your first screenshot
```bash
allscreenshots https://github.com
```
This captures the URL and displays the screenshot directly in your terminal (if your terminal supports images).
### Save to a file
```bash
allscreenshots https://github.com -o github.png
```
## Basic usage
### Quick capture (displays in terminal)
```bash
allscreenshots https://example.com
```
### Save to file
```bash
allscreenshots https://example.com -o screenshot.png
```
### Mobile screenshot
```bash
allscreenshots https://example.com --device "iPhone 14"
```
### Full page capture
```bash
allscreenshots https://example.com --full-page -o fullpage.png
```
## Commands
### capture
Take a synchronous screenshot (default command):
```bash
allscreenshots capture https://example.com [OPTIONS]
```
Options:
* `-o, --output ` - Save to file
* `-d, --device ` - Device preset (e.g., "Desktop HD", "iPhone 14")
* `--full-page` - Capture full scrollable page
* `--format ` - Output format: png, jpeg, webp, pdf
* `--display` - Show in terminal
* `--no-display` - Don't show in terminal
### async
Async capture with job tracking:
```bash
allscreenshots async https://example.com --wait
```
Options:
* `--wait` - Wait for completion and download result
* `--poll-interval ` - Polling interval (default: 2)
### batch
Capture multiple URLs:
```bash
# From arguments
allscreenshots batch https://site1.com https://site2.com -o ./screenshots/
# From file
allscreenshots batch -f urls.txt -o ./screenshots/
```
Options:
* `-f, --file ` - Read URLs from file (one per line)
* `-o, --output-dir ` - Output directory (default: ./screenshots)
* `--device ` - Device preset for all captures
* `--format ` - Output format
### compose
Combine multiple screenshots into one image:
```bash
allscreenshots compose https://example.com \
--devices "Desktop HD" "iPhone 14" "iPad Pro" \
--layout horizontal \
-o comparison.png
```
Options:
* `--devices ` - Device presets to capture
* `--layout ` - Layout: horizontal, vertical, grid
* `--spacing ` - Spacing between images
* `--labels` - Add device labels
### gallery
Browse screenshots with thumbnails:
```bash
# Show recent API jobs
allscreenshots gallery
# Show local directory
allscreenshots gallery --dir ./screenshots/
```
Options:
* `--dir ` - Local directory to browse
* `--limit ` - Max images to show (default: 10)
* `--size ` - Thumbnail size: small, medium
### usage
Show API usage and quota:
```bash
allscreenshots usage
```
Displays a visual graph of your current usage against your plan limits.
### schedule
Manage scheduled screenshots:
```bash
# List schedules
allscreenshots schedule list
# Create a schedule
allscreenshots schedule create \
--name "Daily homepage" \
--url https://example.com \
--cron "0 9 * * *" \
--timezone "America/New_York"
# View history
allscreenshots schedule history
```
Subcommands: `list`, `create`, `get`, `update`, `delete`, `pause`, `resume`, `trigger`, `history`
### jobs
Manage screenshot jobs:
```bash
# List recent jobs
allscreenshots jobs list
# Get job status
allscreenshots jobs get
# Download result
allscreenshots jobs result -o screenshot.png
```
### config
Manage authentication and settings:
```bash
# Store API key
allscreenshots config add-authtoken YOUR_API_KEY
# Show config
allscreenshots config show
# Show config file path
allscreenshots config path
# Remove stored key
allscreenshots config remove-authtoken
```
### devices
Show available device presets:
```bash
allscreenshots devices
```
### completions
Generate shell completions:
```bash
# Bash
allscreenshots completions bash > ~/.local/share/bash-completion/completions/allscreenshots
# Zsh
allscreenshots completions zsh > ~/.zfunc/_allscreenshots
# Fish
allscreenshots completions fish > ~/.config/fish/completions/allscreenshots.fish
```
## Global options
These options work with any command:
| Option | Description |
| ----------------------- | ---------------------------------- |
| `-k, --api-key ` | API key (overrides env and config) |
| `-o, --output ` | Output file path |
| `-d, --device ` | Device preset |
| `--full-page` | Capture full page |
| `--display` | Show in terminal |
| `--no-display` | Don't show in terminal |
| `--json` | Output as JSON |
| `-v, --verbose` | Verbose output |
| `--no-color` | Disable colors |
## Device presets
Common device presets:
**Desktop:**
* `Desktop HD` (1920x1080)
* `Desktop 4K` (3840x2160)
* `Laptop` (1366x768)
**Mobile:**
* `iPhone 14` (390x844)
* `iPhone 14 Pro Max` (430x932)
* `iPhone SE` (375x667)
* `Android` (360x800)
**Tablet:**
* `iPad Pro 12.9` (1024x1366)
* `iPad Pro 11` (834x1194)
* `iPad Air` (820x1180)
Run `allscreenshots devices` for the complete list.
## Examples
### CI/CD integration
Capture screenshots as part of your build:
```bash
#!/bin/bash
allscreenshots batch \
-f ./test-urls.txt \
-o ./screenshots/ \
--device "Desktop HD" \
--format png
```
### Watch mode for development
Re-capture at intervals:
```bash
allscreenshots watch http://localhost:3000 --interval 5
```
### Batch with different devices
```bash
for device in "Desktop HD" "iPhone 14" "iPad Pro"; do
allscreenshots https://example.com \
--device "$device" \
-o "screenshot-${device// /-}.png"
done
```
### Combine with other tools
```bash
# Capture and upload to S3
allscreenshots https://example.com -o - | aws s3 cp - s3://bucket/screenshot.png
# Capture and optimize
allscreenshots https://example.com -o screenshot.png && optipng screenshot.png
```
## Terminal image support
The CLI can display screenshots directly in your terminal if it supports:
* **Kitty graphics protocol** - Kitty, WezTerm
* **iTerm2 inline images** - iTerm2, Hyper
* **Sixel graphics** - xterm, mlterm, foot
For unsupported terminals, the image is rendered using Unicode block characters.
## Configuration file
The CLI stores settings in:
* **macOS:** `~/Library/Application Support/com.allscreenshots.cli/config.toml`
* **Linux:** `~/.config/allscreenshots/config.toml`
Example config:
```toml
[auth]
api_key = "as_live_xxxx"
[defaults]
device = "Desktop HD"
format = "png"
output_dir = "./screenshots"
```
# Figma Plugin (/docs/tools/figma)
import { Callout } from 'fumadocs-ui/components/callout';
import { Steps, Step } from 'fumadocs-ui/components/steps';
# Figma plugin
Capture website screenshots directly into your Figma designs. Perfect for creating mockups, responsive design presentations, and visual documentation without leaving Figma.
**Install:** [Figma Community](https://www.figma.com/community/plugin/1588979915457270548/allscreenshots)
## Installation
### Open Figma
Open any Figma design file where you want to use the plugin.
### Install from Figma Community
Go to **Resources** (Shift+I) → **Plugins** → Search for "AllScreenshots" → Click **Run** or **Save** to install.
Alternatively, visit the [Figma Community page](https://www.figma.com/community/plugin/1588979915457270548/allscreenshots) and click **Open in Figma**.
### Run the plugin
Right-click on the canvas → **Plugins** → **AllScreenshots**, or use the Resources panel to run it.
## Quick start
### Set up your API key
Get your API key from the [dashboard](https://dashboard.allscreenshots.com/api-keys). Click the settings icon (gear) in the plugin and paste your API key.
The free tier includes 100 screenshots per month. Your API key is stored securely in Figma's local storage.
### Enter a URL
Type or paste any website URL in the input field. Press Enter or click the Capture button.
### Screenshot inserted
The screenshot is automatically inserted onto your canvas as an image fill. The viewport centers on the new image and selects it for immediate use.
## Features
### Device presets
Choose from 50+ device presets across desktop, mobile, and tablet categories. Select a category tab, then pick a specific device from the dropdown.
### Main options
| Option | Description |
| ---------------- | --------------------------------------------------------------- |
| **Block Ads** | Remove advertisements from the captured page |
| **Hide Cookies** | Remove cookie consent banners and GDPR popups |
| **Full Page** | Capture the entire scrollable page instead of just the viewport |
| **Dark Mode** | Render the website in dark color scheme (if supported) |
### Custom dimensions
Select the **Custom** tab to specify exact pixel dimensions. Width and height can range from 100 to 4096 pixels.
## Device presets
### Desktop
| Device | Resolution |
| ------------- | ----------- |
| Desktop HD | 1920 x 1080 |
| Desktop Large | 2560 x 1440 |
| Laptop | 1440 x 900 |
| Laptop Small | 1280 x 800 |
### Mobile
| Device | Resolution |
| ------------------ | ---------- |
| iPhone 15 Pro Max | 430 x 932 |
| iPhone 15 Pro | 393 x 852 |
| iPhone 15 | 393 x 852 |
| iPhone 14 Pro Max | 430 x 932 |
| iPhone 14 | 390 x 844 |
| iPhone SE | 375 x 667 |
| Pixel 7 Pro | 412 x 892 |
| Pixel 7 | 412 x 732 |
| Samsung Galaxy S23 | 360 x 780 |
| Samsung Galaxy S21 | 360 x 800 |
### Tablet
| Device | Resolution |
| -------------- | ----------- |
| iPad Pro 12.9" | 1024 x 1366 |
| iPad Pro 11" | 834 x 1194 |
| iPad Air | 820 x 1180 |
| iPad | 810 x 1080 |
| iPad Mini | 768 x 1024 |
| Surface Pro 7 | 912 x 1368 |
| Galaxy Tab S7 | 800 x 1280 |
## Advanced options
Click **Advanced options** to expand additional settings:
| Option | Description |
| ------------------ | --------------------------------------------------------------------------------------------------------- |
| **Format** | Output format: PNG (default), JPEG, or WebP |
| **Quality** | Quality level for JPEG/WebP (1-100%). Higher values produce larger files with better quality. |
| **Delay** | Wait time in seconds (0-30) before capturing. Useful for pages with animations or lazy-loaded content. |
| **Selector** | CSS selector to capture a specific element instead of the full viewport (e.g., `#hero`, `.product-card`). |
| **Custom CSS** | Inject custom CSS before capture. Useful for hiding elements or adjusting styles. |
| **Hide selectors** | Comma-separated CSS selectors for elements to hide (e.g., `.popup, #banner, .chat-widget`). |
### Examples
**Capture after animations complete:**
* Set **Delay** to 2-3 seconds
**Capture specific element:**
* Set **Selector** to `.hero-section` or `#main-content`
**Hide distracting elements:**
* Set **Hide selectors** to `.newsletter-popup, .chat-widget, #sticky-footer`
**Custom styling:**
```css
/* Hide navigation and increase contrast */
nav { display: none !important; }
body { background: #fff !important; }
```
## Large image handling
Figma has a maximum image dimension of 4096 x 4096 pixels. When capturing full-page screenshots that exceed this limit, the plugin automatically:
1. Detects oversized images
2. Splits them into a grid of smaller chunks
3. Creates separate image rectangles for each chunk
4. Groups all chunks together for easy manipulation
This allows you to capture extremely long pages while maintaining full resolution. The chunks are precisely positioned so the complete image appears seamless.
## Settings and usage
Click the **settings icon** (gear) in the top-right corner to:
* Enter or update your API key
* View your current usage and remaining quota
* See your plan tier (FREE, PRO, etc.)
* Check when your monthly quota resets
## Use cases
### Design mockups
Quickly insert real website screenshots into your design mockups. Capture competitor sites, reference designs, or your own staging environment.
### Responsive design documentation
Use different device presets to capture the same URL across desktop, tablet, and mobile. Compare layouts side-by-side in your Figma file.
### Client presentations
Create presentation decks with actual website captures. Use full-page captures to show entire landing pages or specific sections.
### Visual QA
Capture staging or production sites to document bugs, review implementations, or create before/after comparisons.
### Content placeholders
Replace placeholder images with real website captures during the design process. Update them as the actual site evolves.
## Troubleshooting
### Invalid API key
Ensure your API key is correct and active. Get a new key from the [dashboard](https://dashboard.allscreenshots.com/api-keys).
### Quota exceeded
Your monthly screenshot limit has been reached. Upgrade your plan or wait for the next billing period.
### Screenshot timeout
Some complex pages may take longer to render. Try increasing the **Delay** setting or capturing a specific element with **Selector**.
### Image not appearing
Check that you have an active Figma file open with edit permissions. The screenshot is inserted at the center of your current viewport.
# MkDocs plugin (/docs/tools/mkdocs)
import { Callout } from 'fumadocs-ui/components/callout';
import { Steps, Step } from 'fumadocs-ui/components/steps';
# MkDocs plugin
Automatically generate dynamic OpenGraph images for every page in your MkDocs documentation. When someone shares a link to your docs, they see a live screenshot of that page.
**Install:** `pip install mkdocs-allscreenshots-og-screenshot`
## Installation
### Install the plugin
```bash
pip install mkdocs-allscreenshots-og-screenshot
```
Requires Python 3.8 or higher.
### Add to mkdocs.yml
```yaml
site_url: https://yourdomain.com
plugins:
- search
- allscreenshots-og-screenshot
```
### Verify your domain
Go to the [Social images page](/dashboard/domains) in your dashboard and verify your documentation domain.
That's it. Every page in your documentation now has a unique OG image.
## How it works
The plugin adds an `og:image` meta tag to each page:
```html
```
When someone shares a link on social media:
1. The platform requests the OG image URL
2. Allscreenshots captures a screenshot of that page
3. The screenshot is cached for fast subsequent requests
4. Cache hits are free and don't count toward your quota
## Configuration
| Option | Default | Description |
| --------------------- | ------------------------------- | ------------------------------------------- |
| `screenshot_base_url` | `https://og.allscreenshots.com` | Screenshot API endpoint |
| `site_url` | MkDocs `site_url` | Override the site URL used in OG image URLs |
### Custom configuration
```yaml
plugins:
- allscreenshots-og-screenshot:
screenshot_base_url: https://og.allscreenshots.com
site_url: https://docs.example.com
```
## Requirements
* Python 3.8+
* MkDocs
* A verified domain in your [Allscreenshots dashboard](/dashboard/domains)
## Example
Given this MkDocs structure:
```
docs/
├── index.md
├── getting-started.md
└── api/
└── reference.md
```
The plugin generates these OG images:
| Page | OG Image URL |
| ------------------- | --------------------------------------------------------------------------- |
| `/` | `https://og.allscreenshots.com?url=https://yourdomain.com/` |
| `/getting-started/` | `https://og.allscreenshots.com?url=https://yourdomain.com/getting-started/` |
| `/api/reference/` | `https://og.allscreenshots.com?url=https://yourdomain.com/api/reference/` |
## Troubleshooting
### Images not generating
Ensure your domain is verified in the [dashboard](/dashboard/domains). Unverified domains will receive an error response.
### Wrong site URL
If your OG images point to the wrong URL, set the `site_url` option explicitly:
```yaml
plugins:
- allscreenshots-og-screenshot:
site_url: https://docs.example.com
```
### Local development
OG images only work for publicly accessible URLs. During local development, the images will show an error. This is expected—the images will work once deployed.
## Source code
The plugin is open source and available on [PyPI](https://pypi.org/project/mkdocs-allscreenshots-og-screenshot/).
```bash
# Install for development
pip install -e .
```
MIT License.
# CI/CD workflows (/docs/use-cases/ci-cd-workflows)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Integrate automated screenshot capture into your continuous integration and deployment pipelines for visual testing, documentation, and quality assurance.
## The problem
Manual screenshot capture doesn't scale. Every time you deploy, someone needs to manually verify that pages render correctly. This leads to:
* Inconsistent testing coverage
* Delayed releases waiting for manual QA
* Visual bugs slipping through to production
* No historical record of how pages looked at each release
## How Allscreenshots helps
Add screenshot capture to any CI/CD pipeline with a simple API call. Capture screenshots on every commit, pull request, or deployment without managing browser infrastructure.
* **Zero infrastructure** — No need to install browsers or manage Playwright/Puppeteer
* **Parallel execution** — Capture hundreds of pages simultaneously
* **Consistent results** — Same rendering environment every time
* **Async processing** — Don't block your pipeline waiting for screenshots
Use async jobs for large batches to avoid blocking your CI pipeline. Poll for completion or use webhooks to get notified.
## Quick example
Add screenshot capture to a GitHub Actions workflow:
```yaml
# .github/workflows/screenshots.yml
name: Capture Screenshots
on:
pull_request:
branches: [main]
jobs:
screenshots:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start app
run: npm ci && npm run build && npm start &
- name: Wait for app
run: npx wait-on http://localhost:3000
- name: Capture screenshots
run: |
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer ${{ secrets.ALLSCREENSHOTS_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"url": "http://localhost:3000", "fullPage": true}' \
-o screenshot.png
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: screenshots
path: screenshot.png
```
## Key features for this use case
## Next steps
* [CI/CD integration guide](/docs/guides/cicd-integration) — Detailed examples for GitHub Actions, GitLab CI, Jenkins, and more
* [Visual regression testing](/docs/use-cases/visual-regression-testing) — Compare screenshots to catch visual bugs
* [Async jobs API](/docs/api-reference/async-jobs) — Non-blocking screenshot capture
# Compliance and auditing (/docs/use-cases/compliance-auditing)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Capture verifiable, time-stamped screenshots of web content for compliance documentation, regulatory audits, and organizational records.
## The problem
Many industries require proof of what was displayed on websites at specific points in time:
* **Financial services** — Document disclosures, terms, and pricing as shown to customers
* **Healthcare** — Archive patient-facing content for HIPAA compliance
* **E-commerce** — Preserve records of pricing, promotions, and product descriptions
* **Legal** — Capture terms of service, privacy policies, and consent forms
Manual screenshots aren't reliable. They lack timestamps, can be edited, and don't scale across hundreds of pages.
## How Allscreenshots helps
Automatically capture time-stamped screenshots that serve as reliable evidence of web content at specific moments in time.
* **Metadata capture** — Timestamps, URLs, and capture parameters recorded
* **Scheduled archiving** — Automate compliance captures on a regular basis
* **Full page capture** — Document entire pages including below-the-fold content
* **Bulk processing** — Archive hundreds of pages in a single operation
Store screenshots in your own S3-compatible storage for complete control over retention and chain of custody.
## Quick example
Capture a terms of service page with full metadata:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yoursite.com/terms-of-service",
"fullPage": true,
"format": "png",
"waitUntil": "networkidle",
"metadata": {
"purpose": "compliance-archive",
"documentType": "terms-of-service",
"version": "2.1"
}
}'
```
The response includes capture timestamp and all parameters used:
```json
{
"url": "https://yoursite.com/terms-of-service",
"capturedAt": "2024-01-15T14:30:00Z",
"imageUrl": "https://...",
"metadata": {
"purpose": "compliance-archive",
"documentType": "terms-of-service",
"version": "2.1"
}
}
```
## Key features for this use case
## Next steps
* [PDF generation](/docs/guides/pdf-generation) — Create PDF archives of web content
* [Schedules API](/docs/api-reference/schedules) — Set up automated compliance captures
* [Content archiving](/docs/use-cases/content-archiving) — Long-term web content preservation
# Content archiving (/docs/use-cases/content-archiving)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Archive web content by capturing screenshots for long-term preservation, research, or organizational record-keeping.
## The problem
Web content is ephemeral. Pages get updated, redesigned, or taken offline entirely. For researchers, historians, and organizations, losing access to web content can mean:
* Lost research data and citations
* Missing historical records
* Broken references in documentation
* No proof of what was published
The Internet Archive helps, but it doesn't capture everything, and you can't control the timing or coverage.
## How Allscreenshots helps
Build your own web archive by capturing screenshots on demand or on a schedule. Preserve exactly the content you need, when you need it.
* **Full page capture** — Archive entire pages including all scrollable content
* **PDF generation** — Create document-format archives
* **Scheduled archiving** — Automatically capture pages at regular intervals
* **Bulk capture** — Archive hundreds of pages in a single operation
For comprehensive archiving, combine full page screenshots with PDF generation to preserve both visual appearance and text content.
## Quick example
Archive a web page as both a screenshot and PDF:
```bash
# Capture as full page screenshot
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/important-article",
"fullPage": true,
"format": "png",
"waitUntil": "networkidle"
}'
# Capture as PDF
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/important-article",
"format": "pdf",
"pdfOptions": {
"printBackground": true,
"format": "A4"
}
}'
```
Set up weekly archiving:
```bash
curl -X POST https://api.allscreenshots.com/v1/schedules \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Weekly archive",
"url": "https://example.com/important-page",
"schedule": "0 0 * * 0",
"fullPage": true
}'
```
## Key features for this use case
## Next steps
* [PDF generation guide](/docs/guides/pdf-generation) — Create PDF archives
* [Full page capture](/docs/features/full-page-capture) — Capture entire pages
* [Compliance and auditing](/docs/use-cases/compliance-auditing) — Archiving for regulatory requirements
# Customer onboarding (/docs/use-cases/customer-onboarding)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Automatically generate up-to-date screenshots for product documentation, help centers, and onboarding tutorials.
## The problem
Product documentation needs screenshots, but keeping them current is painful:
* UI changes constantly, making screenshots outdated
* Manual capture is tedious and inconsistent
* Different screen sizes and locales multiply the work
* Dark mode and themes require separate screenshots
Teams often let documentation screenshots fall out of date, hurting the customer experience.
## How Allscreenshots helps
Automate screenshot capture from your live product. Keep documentation always current by regenerating screenshots as part of your build or deployment process.
* **Always current** — Screenshots update when your UI changes
* **Consistent styling** — Same viewport, zoom, and wait conditions every time
* **Multi-locale support** — Capture different language versions
* **Theme variants** — Generate light and dark mode screenshots
Use element selectors to capture specific UI components rather than full pages for cleaner documentation images.
## Quick example
Capture a specific UI component for your docs:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://app.yourproduct.com/settings",
"selector": "#billing-section",
"viewport": {"width": 1200, "height": 800},
"waitUntil": "networkidle"
}'
```
Capture the same component in dark mode:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://app.yourproduct.com/settings",
"selector": "#billing-section",
"darkMode": true,
"viewport": {"width": 1200, "height": 800}
}'
```
## Key features for this use case
## Next steps
* [Screenshots API reference](/docs/api-reference/screenshots) — Selector and viewport options
* [Viewport and devices](/docs/features/viewport-and-devices) — Mobile and tablet emulation
* [CI/CD workflows](/docs/use-cases/ci-cd-workflows) — Automate screenshot updates on deploy
# E-commerce monitoring (/docs/use-cases/ecommerce-monitoring)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Monitor competitor e-commerce sites to track pricing changes, inventory status, promotional campaigns, and product page updates.
## The problem
E-commerce is fiercely competitive. Pricing and promotions change constantly, and staying informed requires continuous monitoring:
* Competitors adjust prices daily or even hourly
* Flash sales and promotions appear without warning
* Product availability affects your competitive positioning
* Manual monitoring doesn't scale across hundreds of SKUs
## How Allscreenshots helps
Schedule automatic captures of competitor product and pricing pages. Build a visual history of changes and integrate with your pricing intelligence systems.
* **Scheduled captures** — Monitor pages hourly, daily, or at custom intervals
* **Visual history** — Track how pricing and promotions evolve
* **Bulk monitoring** — Watch hundreds of product pages simultaneously
* **Clean captures** — Block ads and popups for consistent results
Use the bulk API to monitor multiple competitor product pages in a single request, then process the results with your pricing intelligence tools.
## Quick example
Set up hourly monitoring of a competitor's pricing page:
```bash
curl -X POST https://api.allscreenshots.com/v1/schedules \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Competitor product monitor",
"url": "https://competitor.com/products/widget-pro",
"schedule": "0 * * * *",
"viewport": {"width": 1920, "height": 1080},
"fullPage": true,
"blockLevel": "basic",
"webhookUrl": "https://yoursite.com/webhooks/price-monitor"
}'
```
Monitor multiple products at once:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots/bulk \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"urls": [
"https://competitor.com/products/widget-pro",
"https://competitor.com/products/widget-basic",
"https://competitor.com/products/widget-enterprise"
],
"options": {
"fullPage": true,
"blockLevel": "basic"
},
"webhookUrl": "https://yoursite.com/webhooks/bulk-complete"
}'
```
## Key features for this use case
## Next steps
* [Schedules API reference](/docs/api-reference/schedules) — Set up automated monitoring
* [Bulk API reference](/docs/api-reference/bulk) — Monitor multiple URLs efficiently
* [Website monitoring](/docs/use-cases/website-monitoring) — General website change detection
# Use cases (/docs/use-cases)
import { Cards, Card } from 'fumadocs-ui/components/card';
Allscreenshots powers a wide range of workflows across development, marketing, legal, and operations teams. Explore how you can use our screenshot API to solve your specific challenges.
## Not sure where to start?
If you're new to Allscreenshots, check out our [quickstart guide](/docs/getting-started/quickstart) to capture your first screenshot in under a minute. Then explore these use cases to see how you can integrate screenshots into your workflows.
# Legal evidence (/docs/use-cases/legal-evidence)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Capture web content with timestamps and metadata to create verifiable evidence for legal proceedings, intellectual property disputes, and litigation.
## The problem
Web content is constantly changing, and proving what was displayed at a specific time is critical in legal contexts:
* **Intellectual property** — Document infringement or prior art
* **Defamation** — Capture harmful content before it's deleted
* **Contract disputes** — Prove what terms were displayed
* **Trademark violations** — Document unauthorized use
* **Fraud investigation** — Preserve evidence of misleading claims
Manual screenshots lack credibility. They have no chain of custody, timestamps can be faked, and metadata is missing.
## How Allscreenshots helps
Capture web content through a third-party service that provides verifiable timestamps, complete metadata, and a clear chain of custody.
* **Third-party verification** — Screenshots captured by an independent service
* **Complete metadata** — URL, timestamp, capture parameters all recorded
* **Full page capture** — Document entire pages including all content
* **Immediate capture** — Preserve evidence before it disappears
For use in legal proceedings, consult with your legal counsel about evidence requirements in your jurisdiction. Consider combining API captures with additional verification methods.
## Quick example
Capture a web page with full metadata for evidence:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/page-to-document",
"fullPage": true,
"format": "png",
"waitUntil": "networkidle",
"metadata": {
"caseNumber": "2024-CV-12345",
"purpose": "evidence-preservation",
"capturedBy": "legal-department"
}
}'
```
The response includes verifiable details:
```json
{
"url": "https://example.com/page-to-document",
"capturedAt": "2024-01-15T14:30:00.000Z",
"imageUrl": "https://...",
"metadata": {
"caseNumber": "2024-CV-12345",
"purpose": "evidence-preservation",
"capturedBy": "legal-department"
}
}
```
## Key features for this use case
## Next steps
* [PDF generation guide](/docs/guides/pdf-generation) — Create PDF evidence documents
* [Screenshots API reference](/docs/api-reference/screenshots) — Metadata and capture options
* [Compliance and auditing](/docs/use-cases/compliance-auditing) — Regulatory documentation
# Automated report generation (/docs/use-cases/report-generation)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Automate the creation of visual reports by capturing screenshots of dashboards, analytics, and data visualizations.
## The problem
Creating visual reports is time-consuming and error-prone:
* Manually capturing dashboard screenshots is tedious
* Reports need to be generated at specific times (end of day, week, month)
* Multiple stakeholders need different views
* Screenshots become outdated by the time reports are delivered
## How Allscreenshots helps
Automate report generation by capturing screenshots of your dashboards and data visualizations on a schedule. Combine multiple captures into comprehensive reports.
* **Scheduled captures** — Generate reports at end of day, week, or month
* **Multiple viewports** — Capture different dashboard views
* **Composition** — Combine multiple screenshots into a single report
* **Bulk capture** — Grab all dashboard sections in one request
Use the compose API to combine multiple dashboard screenshots into a single report image with grid or custom layouts.
## Quick example
Capture a dashboard and wait for data to load:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://analytics.yourcompany.com/dashboard",
"viewport": {"width": 1920, "height": 1080},
"fullPage": true,
"waitUntil": "networkidle",
"delay": 2000
}'
```
Schedule a daily report at end of business:
```bash
curl -X POST https://api.allscreenshots.com/v1/schedules \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Daily sales dashboard",
"url": "https://analytics.yourcompany.com/sales",
"schedule": "0 18 * * 1-5",
"fullPage": true,
"webhookUrl": "https://yoursite.com/webhooks/daily-report"
}'
```
Combine multiple dashboards into one report:
```bash
curl -X POST https://api.allscreenshots.com/v1/compose \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"screenshots": [
{"url": "https://analytics.yourcompany.com/sales"},
{"url": "https://analytics.yourcompany.com/marketing"},
{"url": "https://analytics.yourcompany.com/support"}
],
"layout": "grid",
"columns": 1
}'
```
## Key features for this use case
## Next steps
* [Compose API reference](/docs/api-reference/compose) — Combine screenshots into reports
* [Schedules API reference](/docs/api-reference/schedules) — Set up automated captures
* [CI/CD workflows](/docs/use-cases/ci-cd-workflows) — Integrate with your build pipeline
# Social media OG images (/docs/use-cases/social-media-og-images)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Automatically generate branded Open Graph images and Twitter cards for blog posts, product pages, user profiles, and any dynamic content.
## The problem
Social media previews matter. When someone shares your link, a compelling preview image dramatically increases click-through rates. But creating custom OG images for every page is tedious:
* Design tools don't scale to thousands of pages
* Static images get outdated when content changes
* Dynamic content (user profiles, product pages) needs unique images
* Managing image assets becomes a maintenance burden
## How Allscreenshots helps
Create a template page with your branding, then generate unique OG images by capturing screenshots with dynamic data. Every share gets a fresh, accurate preview.
* **Dynamic generation** — Pass parameters to customize each image
* **Consistent branding** — Use your own HTML/CSS templates
* **Always current** — Images reflect the latest content
* **Scale infinitely** — Generate thousands of images on demand
Use a fixed viewport size like 1200x630 (Facebook/LinkedIn) or 1200x600 (Twitter) for optimal social media display.
## Quick example
Capture a branded OG image from your template page:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yoursite.com/og-template?title=How%20to%20Build%20a%20SaaS&author=Jane%20Doe",
"viewport": {"width": 1200, "height": 630},
"format": "png",
"selector": "#og-card"
}'
```
Or generate from raw HTML:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "
My Blog Post Title
",
"viewport": {"width": 1200, "height": 630}
}'
```
## Key features for this use case
## Next steps
* [Social media previews guide](/docs/guides/social-media-previews) — Build a complete OG image generation system
* [Screenshots API reference](/docs/api-reference/screenshots) — HTML and selector options
* [Bulk API](/docs/api-reference/bulk) — Generate images at scale
# Visual regression testing (/docs/use-cases/visual-regression-testing)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Automatically detect unintended visual changes in your UI by comparing screenshots captured at different points in time.
## The problem
CSS changes can break UI in unexpected ways. A tweak to one component might cascade into layout issues elsewhere. Manual testing doesn't scale, and customers often discover visual bugs before your team does.
Without automated visual testing, you're relying on:
* Manual QA that misses edge cases
* User reports after bugs reach production
* Expensive rollbacks and hotfixes
## How Allscreenshots helps
Capture consistent, high-fidelity screenshots in your CI/CD pipeline. Compare new screenshots against baselines and get immediate alerts when visual differences exceed your threshold.
* **Consistent rendering** — Same browser, viewport, and wait conditions every time
* **Pixel-perfect comparisons** — Detect even subtle visual regressions
* **CI/CD integration** — Fail builds automatically when visual bugs are detected
Use `hideSelectors` to exclude dynamic content like timestamps, avatars, or ads from comparisons.
## Quick example
Capture a screenshot of your staging environment for comparison:
```bash
curl -X POST https://api.allscreenshots.com/v1/screenshots \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://staging.example.com/checkout",
"viewport": {"width": 1920, "height": 1080},
"format": "png",
"waitUntil": "networkidle",
"hideSelectors": [".timestamp", ".random-avatar"]
}'
```
Then use a comparison library like `pixelmatch` or `looks-same` to diff against your baseline.
## Key features for this use case
## Next steps
* [Visual regression testing guide](/docs/guides/visual-regression-testing) — Full implementation walkthrough with code examples
* [CI/CD integration guide](/docs/guides/cicd-integration) — GitHub Actions, GitLab CI, and Jenkins examples
* [Screenshots API reference](/docs/api-reference/screenshots) — Complete parameter documentation
# Website monitoring (/docs/use-cases/website-monitoring)
import { Cards, Card } from 'fumadocs-ui/components/card';
import { Callout } from 'fumadocs-ui/components/callout';
Monitor websites for visual changes by capturing screenshots on a schedule and comparing them over time.
## The problem
Websites change constantly. Competitors update pricing, content gets modified, and your own site might change unexpectedly. Without monitoring:
* You miss competitor pricing changes and promotions
* Content drift goes unnoticed until customers complain
* Third-party embeds break without warning
* Unauthorized changes slip through
## How Allscreenshots helps
Schedule automatic screenshot captures and build a visual history of any website. Compare captures over time to detect changes, or simply archive a visual record.
* **Scheduled captures** — Hourly, daily, weekly, or custom intervals
* **Visual history** — Track how pages evolve over time
* **Change detection** — Compare screenshots to spot differences
* **Competitor intelligence** — Monitor pricing and feature pages
Combine scheduled captures with webhooks to get notified immediately when new screenshots are available for comparison.
## Quick example
Set up a daily capture of a competitor's pricing page:
```bash
curl -X POST https://api.allscreenshots.com/v1/schedules \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Competitor pricing monitor",
"url": "https://competitor.com/pricing",
"schedule": "0 9 * * *",
"viewport": {"width": 1920, "height": 1080},
"fullPage": true,
"webhookUrl": "https://yoursite.com/webhooks/screenshot"
}'
```
This captures the page every day at 9 AM and sends the result to your webhook.
## Key features for this use case
## Next steps
* [Website monitoring guide](/docs/guides/website-monitoring) — Build a complete monitoring system
* [Schedules API reference](/docs/api-reference/schedules) — Cron expressions and interval options
* [Visual regression testing](/docs/use-cases/visual-regression-testing) — Compare screenshots to detect changes