Quick Start

Get your first screenshot in under 2 minutes. This guide will walk you through the basics.

1. Get your API Key

First, sign up for a free account and grab your API key from the dashboard. New accounts start with 100 free credits.

Your API key will look like this:

rs_live_xxxxxxxxxxxxx

2. Make your first request

curl

curl -X POST https://api.renderscreenshot.com/v1/screenshot \
  -H "Authorization: Bearer rs_live_xxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "preset": "og_card"
  }' \
  --output screenshot.png

Java

import com.renderscreenshot.sdk.Client;
import com.renderscreenshot.sdk.TakeOptions;
import java.nio.file.Files;
import java.nio.file.Path;

Client client = new Client("rs_live_xxxxx");

byte[] image = client.take(
    TakeOptions.url("https://example.com").preset("og_card")
);

Files.write(Path.of("screenshot.png"), image);

Node.js

import { Client, TakeOptions } from 'renderscreenshot';
import { writeFile } from 'fs/promises';

const client = new Client('rs_live_xxxxx');

const image = await client.take(
  TakeOptions.url('https://example.com').preset('og_card')
);

await writeFile('screenshot.png', image);

PHP

use RenderScreenshot\Client;
use RenderScreenshot\TakeOptions;

$client = new Client('rs_live_xxxxx');

$image = $client->take(
    TakeOptions::url('https://example.com')->preset('og_card')
);

file_put_contents('screenshot.png', $image);

Python

from renderscreenshot import Client, TakeOptions

client = Client('rs_live_xxxxx')

image = client.take(
    TakeOptions.url('https://example.com').preset('og_card')
)

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

Ruby

require 'renderscreenshot'

client = RenderScreenshot.client('rs_live_xxxxx')

image = client.take(
  RenderScreenshot::TakeOptions
    .url('https://example.com')
    .preset('og_card')
)

File.binwrite('screenshot.png', image)

Go

package main

import (
    "context"
    "os"

    rs "github.com/Render-Screenshot/rs-go"
)

func main() {
    client, _ := rs.New("rs_live_xxxxx")

    image, _ := client.Take(context.Background(),
        rs.URL("https://example.com").Preset("og_card"),
    )

    os.WriteFile("screenshot.png", image, 0644)
}

3. Use presets for common sizes

We offer presets for common use cases:

Preset Dimensions Use Case
og_card 1200×630 Open Graph social cards
twitter_card 1200×600 Twitter cards
full_page 1280×full Full page screenshot

4. Add to your HTML

Use the screenshot URL directly in your meta tags:

<meta property="og:image"
      content="https://api.renderscreenshot.com/v1/screenshot?url=https://yoursite.com&preset=og_card&api_key=rs_live_xxxxx" />

Next Steps

Was this page helpful?