Download the PHP package screenshotscout/sdk without Composer

On this page you can find all versions of the php package screenshotscout/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk

Screenshot Scout PHP SDK

The official PHP SDK for the Screenshot Scout screenshot API.

capture() sends a screenshot request and waits until the result is ready.

Requirements

Installation

Install the SDK with Composer:

Get your API credentials

Sign up for Screenshot Scout or sign in, then copy the access key and secret key from the API Keys page. The access key is required. The secret key is optional and enables signed requests.

Capture a screenshot

Pass the page URL and any capture settings to capture(). This example captures the full page and saves the returned image:

POST is used by default. capture() returns a BinaryCaptureResponse unless JSON is requested. Use bytes() to access the screenshot or PDF contents.

Request a JSON result

Set the response type to JSON when you want capture metadata instead of image or PDF bytes:

Use GET

Pass CaptureHttpMethod::GET as the third argument. POST remains the default.

Build a capture URL

buildCaptureUrl() creates a capture URL without sending a request. It accepts the same CaptureOptions as capture():

Generated capture URLs contain your access key, so treat them as sensitive. A configured secret key signs them automatically. Before sharing generated URLs, enable Require signed requests on the API Keys page.

Signed requests

Pass the API key's secret as the optional secretKey constructor argument. The client then signs generated capture URLs and GET requests automatically. The secret key is never transmitted. POST requests can't be signed, so capture with CaptureHttpMethod::GET, as in Use GET. See the signed requests guide.

Capture options

CaptureOptions is immutable: each with...() method returns a changed copy. Available options include:

Use CaptureFormat, CaptureResponseType, CaptureWaitUntil, CaptureMediaType, CaptureColorScheme, CaptureImageMode, CaptureImageAnchor, CapturePdfPaperFormat, and CaptureStorageMode for documented values. The corresponding methods also accept strings. See the Screenshot Scout option reference for allowed values and behavior.

HTTP timeouts and customization

withTimeout() controls how long Screenshot Scout may spend capturing the page. It does not set the PHP HTTP timeout. To configure the HTTP timeout, pass a custom PSR-18 client:

The default HTTP client has no total request timeout. Without PHP's cURL extension, it waits up to 300 seconds for a response. A custom client can also configure proxies, TLS, and other HTTP settings.

Raw responses and errors

Use rawResponse() to access the status, headers, content type, and response body. ApiException also provides the underlying response.

All SDK exceptions implement ScreenshotScout\Exception\ScreenshotScoutException, which can be caught to handle any SDK error. TransportException::getPrevious() returns the underlying HTTP client exception.

License

Licensed under the MIT License.


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^7.10
guzzlehttp/psr7 Version ^2.13
php Version >=8.3
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package screenshotscout/sdk contains the following files

Loading the files please wait ...