A Java SDK for the ScreenshotOne.com API to take screenshots of any URL

Overview

jsdk

Build

An official Screenshot API client for Java.

It takes minutes to start taking screenshots. Just sign up to get access and secret keys, import the client, and you are ready to go.

The SDK client is synchronized with the latest screenshot API options.

Installation

Add the library as a dependency to your Maven project:

<dependencies>
    <dependency>
        <groupId>com.screenshotone.jsdk</groupId>
        <artifactId>screenshotone-api-jsdk</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>    

Or Gradle:

dependencies {
    compile 'com.screenshotone.jsdk:screenshotone-api-jsdk:1.0.0'
}

Usage

Generate a screenshot URL without executing request:

import com.screenshotone.jsdk.Client;
import com.screenshotone.jsdk.TakeOptions;

public class App {
    public static void main(String[] args) throws Exception {
        final Client client = Client.withKeys("IVmt2ghj9TG_jQ", "Sxt94yAj9aQSgg");
        TakeOptions takeOptions = TakeOptions.url("https://scalabledeveloper.com")
                .fullPage(true)
                .deviceScaleFactor(1)
                .viewportHeight(1200)
                .viewportWidth(1200)
                .format("png")
                .omitBackground(true);
        final String url = client.generateTakeUrl(takeOptions);

        System.out.println(url);
        // Output: https://api.screenshotone.com/take?access_key=IVmt2ghj9TG_jQ&device_scale_factor=1&format=png&full_page=true&omit_background=true&url=https%3A%2F%2Fscalabledeveloper.com&viewport_height=1200&viewport_width=1200&signature=3c0c5543599067322e8c84470702330e3687c6a08eef6b7311b71c32d04e1bd5
    }
}

Take a screenshot and save the image in the file:

import com.screenshotone.jsdk.Client;
import com.screenshotone.jsdk.TakeOptions;

import java.io.File;
import java.nio.file.Files;

public class App {
    public static void main(String[] args) throws Exception {
        final Client client = Client.withKeys("IVmt2ghj9TG_jQ", "Sxt94yAj9aQSgg");
        TakeOptions takeOptions = TakeOptions.url("https://scalabledeveloper.com")
                .fullPage(true)
                .deviceScaleFactor(1)
                .viewportHeight(1200)
                .viewportWidth(1200)
                .format("png")
                .omitBackground(true);
        final byte[] image = client.take();

        Files.write(new File("./example.png").toPath(), image);
    }
}

Tests

To run tests, just execute:

./gradlew test

License

screenshotone/jsdk is released under the MIT license.

You might also like...

SDK java permettant de valider et qualifier un numéro de téléphone calédonien.

❔ phonenumber-validator SDK Java permettant de valider, qualifier un numéro de téléphone calédonien. ⬇️ Import de la dépendance publique Cette dépenda

Oct 22, 2022

Java wrapper for Agones client SDK.

agones4j How to Use (Developers) Code final class Server { public static void main( final String[] args ) { final var sdk = new tr.com.in

Dec 15, 2022

Kryptokrona Java SDK for building decentralized private communication and payment systems.

Kryptokrona Java SDK for building decentralized private communication and payment systems.

Kryptokrona Java SDK Kryptokrona is a decentralized blockchain from the Nordic based on CryptoNote, which forms the basis for Monero, among others. Cr

Oct 31, 2022

AndroidHiddenApiBypass - Bypass restrictions on non-SDK interfaces

AndroidHiddenApiBypass Bypass restrictions on non-SDK interfaces. Why AndroidHiddenApiBypass? Pure Java: no native code used. Reliable: does not rely

Jan 6, 2023

React native wrapper for Jitsi Meet SDK Library that rely on the native view (Activity / ViewController)

react-native-jitsi-meet-sdk React native wrapper for Jitsi Meet SDK Library. This Library implements the Jitsi SDK with a native activity on the Andro

May 2, 2022

This is the official theme SDK for the FairPlayer Music Player for Android.

This is the official theme SDK for the FairPlayer Music Player for Android.

FairPlayer - Themes SDK This is the official theme SDK for the FairPlayer Music Player for Android. You can download the most recent version of FairPl

Jan 31, 2022

The world's top-level live sdk...

目录结构说明 本目录包含 Android 版 移动直播 SDK 的Demo 源代码,主要演示接口如何调用以及最基本的功能。 ├─ MLVB-API-Example // MLVB API Example,包括直播推流,直播播放,互动直播 | ├─ App //

Jan 5, 2023

A demo of Rongcloud uniapp sdk integration for compiling debug-apk in Android Studio

Rongcloud-uniapp-sdk-demo A demo of Rongcloud uniapp sdk integration for compiling debug-apk in Android Studio 这是一个为了给uniapp在Android平台打出debug-apk的demo

Oct 13, 2021

The VAST ad sample code provided by HUAWEI Ads Kit describes how to display linear ads by integrating the HUAWEI VAST SDK into your app.

The VAST ad sample code provided by HUAWEI Ads Kit describes how to display linear ads by integrating the HUAWEI VAST SDK into your app.

HMS Ads Demo for VAST English | 中文 Table of Contents Introduction Installation Configuration Supported Environments Sample Code Result License Introdu

Jul 16, 2022
Owner
ScreenshotOne.com
Fast and reliable screenshot API built to handle millions of screenshots a month. Get started for free.
ScreenshotOne.com
☁ Tencent Cloud IM Server SDK in Java | 腾讯云 IM 服务端 SDK Java 版

Tencent Cloud IM Server SDK in Java The Tencent Cloud IM Server SDK for Java enables Java developers to easily work with Tencent Cloud IM. Requirement

Doocs 64 Dec 23, 2022
NeverScapeAlone! Instantly match with other players and take the hassle out of finding partners for bosses, minigames, skills, pking, and more!

NeverScapeAlone An Old School RuneScape Matchmaking Plugin on RuneLite! Tired of having to scour friend's chats, discords, and forums to find friends

null 14 Sep 2, 2022
Prevent Screenshots in your React Native app when needed. 🦄

React Native Prevent Screenshots Prevent Screenshots in your React Native app when needed. ?? Installation First, you need to install the package usin

Ahmed Mahmoud 64 Oct 19, 2022
FolksDev URL Shortener Project

Url Shortener Project This is a simple url shortener project which is using in-memory db. Spring Boot Exception Handling Validation H2 Database Deploy

Grkn 2 Jul 28, 2022
A simple and efficient short URL conversion service based on SpringBoot.

A simple and efficient short URL conversion service based on SpringBoot What is GeniusShortUrl? GeniusShortUrl is an open source reactive service that

null 2 Apr 8, 2022
QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands.

QuickShop is a shop plugin that allows players to easily sell/buy any items from a chest without any commands. In fact, none of the commands that QuickShop provides are ever needed by a player.

Ghost_chu 24 Dec 30, 2022
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

OpenAPI Generator Master (5.4.x): 6.0.x (6.0.x): ⭐ ⭐ ⭐ If you would like to contribute, please refer to guidelines and a list of open tasks. ⭐ ⭐ ⭐ ‼️

OpenAPI Tools 14.8k Dec 30, 2022
Alibaba Cloud Dedicated KMS Transfer SDK for Java can help Java developers to migrate from the KMS keys to the Dedicated KMS keys.

Alibaba Cloud Dedicated KMS Transfer SDK for Java Alibaba Cloud Dedicated KMS Transfer SDK for Java can help Java developers to migrate from the KMS k

Alibaba Cloud 3 May 12, 2022
React Native wrapper around Indy SDK Java and Objective-C wrappers.

React Native Indy SDK React Native Indy SDK wrapper. Installation with npm: $ npm install indy-sdk-react-native --save with Yarn: $ yarn add indy-sdk-

Hyperledger 21 Dec 5, 2022
A Sentry SDK for Java, Android and other JVM languages.

Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoy

Sentry 912 Dec 28, 2022