Quickstart

This guide will get you all set up and ready to use the ScreenshotBuddy API. We'll cover how our API works, how to authenticate with it, and how to make your first API request.

Making your first API request

After obtaining your API key, you can make your first API request. Below, we'll show you how you can take a screenshot of a website using the API.

Endpoint: https://api.screenshotbuddy.io/v1/snap
Note: Replace {token} with your API key.

GET
/v1/snap
curl -G https://api.screenshotbuddy.io/v1/snap \
  -H "Authorization: Bearer {token}" \
  -d limit=10
const token = '{token}';
const url = 'https://api.screenshotbuddy.io/v1/snap' + '?url=https://www.javascript.com';

fetch(url, {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer ' + token,
        'Content-Type': 'application/json'
    }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
import requests

token = '{token}'
url = 'https://api.screenshotbuddy.io/v1/snap'
params = {
    'url': 'https://www.python.org'
}
headers = {
    'Authorization': 'Bearer ' + token,
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers, params=params)

if response.status_code == 200:
    print(response.json())
else:
    print('Error:', response.status_code, response.text)
<?php

$token = '{token}';
$url = 'https://api.screenshotbuddy.io/v1/snap?url=https://www.php.net';

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
]);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    echo $response;
}

curl_close($ch);
?>
Http::withToken({token})
    .get('https://api.screenshotbuddy.io/v1/snap', [{
        url: 'https://laravel.com'
    }]);