Skip to content

About

Official Java SDK for the Allscreenshots website screenshot API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

Allscreenshots Java SDK

Generated from the public API implemented by https://api.allscreenshots.com. Visit https://allscreenshots.com for an account and API key.

The package is at this repository root. The browser demo is in sample-app. Run python3 tools/verify.py --build --fixture to build and check quota, sync/async capture, binary downloads, replay safety, and error handling without spending credits.

Capture and download operations with mixed content types return raw bodies (java native bytes/blob/file/response). This avoids corrupting binary images through JSON decoding. For responseType URL or BASE64, decode the raw JSON into the generated ScreenshotJsonResponse model; the demo shows URL capture and a download through the same SDK. Other endpoints return generated typed models.

sdk-provenance.json records the canonical contract, generator, configuration, template, dependency, and toolchain hashes. Do not edit generated sources; update the backend contract or generation inputs in api.allscreenshots.com/sdk-generation.

API reference

allscreenshots-sdk

Allscreenshots public API

  • API version: 1.0.0
    • Generator version: 7.25.0

Capture websites, manage jobs, compose images, schedule captures, crawl sites, and read usage.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.allscreenshots.sdk</groupId>
  <artifactId>allscreenshots-sdk</artifactId>
  <version>2.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'allscreenshots-sdk' jar has been published to maven central.
    mavenLocal()       // Needed if the 'allscreenshots-sdk' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.allscreenshots.sdk:allscreenshots-sdk:2.0.0"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/allscreenshots-sdk-2.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

// Import classes:
import com.allscreenshots.sdk.ApiClient;
import com.allscreenshots.sdk.ApiException;
import com.allscreenshots.sdk.Configuration;
import com.allscreenshots.sdk.auth.*;
import com.allscreenshots.sdk.model.*;
import com.allscreenshots.sdk.api.BulkApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.allscreenshots.com");
    
    // Configure API key authorization: ApiKey
    ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
    ApiKey.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //ApiKey.setApiKeyPrefix("Token");

    BulkApi apiInstance = new BulkApi(defaultClient);
    String id = "id_example"; // String | 
    try {
      BulkJobSummary result = apiInstance.cancelBulkJob(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling BulkApi#cancelBulkJob");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://api.allscreenshots.com

Class Method HTTP request Description
BulkApi cancelBulkJob POST /v1/screenshots/bulk/{id}/cancel
BulkApi createBulkJob POST /v1/screenshots/bulk
BulkApi getBulkJobStatus GET /v1/screenshots/bulk/{id}
BulkApi listBulkJobs GET /v1/screenshots/bulk
ComposeApi compose POST /v1/screenshots/compose
ComposeApi getComposeJobStatus GET /v1/screenshots/compose/jobs/{jobId}
ComposeApi getLayoutPreview GET /v1/screenshots/compose/preview
ComposeApi listComposeJobs GET /v1/screenshots/compose/jobs
CrawlApi callList GET /v1/crawls
CrawlApi cancel POST /v1/crawls/{id}/cancel
CrawlApi create POST /v1/crawls
CrawlApi delete DELETE /v1/crawls/{id}
CrawlApi get GET /v1/crawls/{id}
CrawlApi output GET /v1/crawls/{id}/pages/{pageId}/outputs/{output}
CrawlApi pages GET /v1/crawls/{id}/pages
JobApi cancelJob POST /v1/screenshots/jobs/{id}/cancel
JobApi createAsyncJob POST /v1/screenshots/async
JobApi getJobOutputResult GET /v1/screenshots/jobs/{id}/result/{outputId}
JobApi getJobResult GET /v1/screenshots/jobs/{id}/result
JobApi getJobStatus GET /v1/screenshots/jobs/{id}
JobApi listJobs GET /v1/screenshots/jobs
ScheduleApi createSchedule POST /v1/schedules
ScheduleApi deleteSchedule DELETE /v1/schedules/{id}
ScheduleApi getExecutionHistory GET /v1/schedules/{id}/history
ScheduleApi getSchedule GET /v1/schedules/{id}
ScheduleApi listSchedules GET /v1/schedules
ScheduleApi pauseSchedule POST /v1/schedules/{id}/pause
ScheduleApi resumeSchedule POST /v1/schedules/{id}/resume
ScheduleApi triggerSchedule POST /v1/schedules/{id}/trigger
ScheduleApi updateSchedule PUT /v1/schedules/{id}
ScreenshotApi captureSync POST /v1/screenshots
ScreenshotApi getSyncCaptureOutputResult GET /v1/screenshots/captures/{id}/result/{outputId}
ScreenshotApi getSyncCaptureResult GET /v1/screenshots/captures/{id}/result
ScreenshotApi submissionStatus GET /v1/screenshots/submissions/{key}
UsageApi getActivity GET /v1/usage/activity
UsageApi getQuota GET /v1/usage/quota
UsageApi getUsage GET /v1/usage
UsageApi getUsageByKey GET /v1/usage/keys

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKey

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

About

Official Java SDK for the Allscreenshots website screenshot API

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages