Package 'screenshotbase'

Title: Client for the 'Screenshotbase' API
Description: Minimal R client for the 'Screenshotbase' API to render website screenshots and query account status. Provides functions to set the API key, call the status endpoint, and take a screenshot as a raw image response.
Authors: Dominik Kukacka [aut, cre], EverAPI Team [cph]
Maintainer: Dominik Kukacka <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-05-09 07:32:55 UTC
Source: https://github.com/cran/screenshotbase

Help Index


Get Screenshotbase status

Description

Returns quota information for the authenticated account.

Usage

screenshotbase_status(apikey = NULL)

Arguments

apikey

Optional API key to override the session key.

Value

A named list with status fields.

Examples

## Not run: 
set_api_key("YOUR-API-KEY")
screenshotbase_status()

## End(Not run)

Take a website screenshot

Description

Renders a website and returns raw image bytes.

Usage

screenshotbase_take(
  url,
  format = NULL,
  quality = NULL,
  full_page = NULL,
  viewport_width = NULL,
  viewport_height = NULL,
  apikey = NULL
)

Arguments

url

URL of the website to render (required).

format

Image format: one of "png", "jpg", "jpeg", "gif".

quality

Integer quality for jpg/jpeg (defaults to 80 on server if not set).

full_page

Logical; capture full page.

viewport_width, viewport_height

Integers for viewport size in pixels.

apikey

Optional API key to override the session key.

Value

A raw vector of the image content.

Examples

## Not run: 
set_api_key("YOUR-API-KEY")
bytes <- screenshotbase_take("https://bbc.com", format = "png", full_page = TRUE)
writeBin(bytes, "screenshot.png")

## End(Not run)

Set Screenshotbase API key

Description

Stores the API key in the R session via options, used by subsequent requests.

Usage

set_api_key(key)

Arguments

key

Character scalar, your Screenshotbase API key.

Details

You can also set environment variable SCREENSHOTBASE_API_KEY for automatic discovery.

Value

Invisibly returns the key.