Get a Free Trial

How to use GrabzIt’s API Securely?

Sometimes the information that is being sent to GrabzIt can be sensitive in nature. To help protect that data we provide the ability to use SSL this means all of the information being sent to GrabzIt’s API’s will be encrypted. To do this you just need to instruct GrabzIt to use SSL, as shown below.

//The client should be stored somewhere and reused!
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret", client);
grabzIt.UseSSL = true;
grabzIt.URLToImage("http://www.spacex.com");
await grabzIt.SaveToAsync("spacex.jpg");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
grabzIt.UseSSL(true);
grabzIt.URLToImage("http://www.spacex.com");
grabzIt.SaveTo("spacex.jpg");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.2/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").UseSSL().ConvertURL("http://www.spacex.com").Create();
</script>
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
client.use_ssl(true);
client.url_to_image("http://www.spacex.com");
client.save_to("spacex.jpg", function (error, id){
    if (error != null){
        throw error;
    }
});
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->UseSSL(1);
$grabzIt->URLToImage("http://www.spacex.com");
$grabzIt->SaveTo("spacex.jpg");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$grabzIt->UseSSL(true);
$grabzIt->URLToImage("http://www.spacex.com");
$grabzIt->SaveTo("spacex.jpg");
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.UseSSL(True)
grabzIt.URLToImage("http://www.spacex.com")
grabzIt.SaveTo("spacex.jpg")
https://api.grabz.it/services/convert?key=Sign in to view your Application Key&format=jpg&url=http%3A%2F%2Fwww.spacex.com
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
grabzIt.use_ssl(true)
grabzIt.url_to_image("http://www.spacex.com")
grabzIt.save_to("spacex.jpg")

Sometimes you want to use GrabzIt's API in the browser for instance with the JavaScript API or the Webpage to Icon API, while not completely fool proof you can restrict these requests to being made from certain domains by using the Authorized Domains feature.

The REST API is very convenient, however just requiring the application key does open it potential abuse if someone gets hold of your application key. You can stop this by restricting the use of the application key to only calls from IP addresses that you control.

If you want to protect the content of the capture to an even higher degree, you can also encrypt the capture as soon as it is created.