GrabzIt
Tools to Capture and Convert the Web

How do I change a filename of a screenshot with GrabzIt's API?

GrabzIt's API is very flexible and has multiple ways of interacting with your screenshots.

If you are using a server side API with a callback handler, you can change the handler file to specify the filename you want. So for PHP API you would change the line specified in the handler.php that saves your screenshot.

file_put_contents("results" . DIRECTORY_SEPARATOR . $filename, $result);

To include your custom filename, as shown below:

file_put_contents("results" . DIRECTORY_SEPARATOR . "my_screenshot.jpg", $result);

If you are using a server side API with the synchronous SaveTo method you can save the screenshot directly to a file with a name of your choice by doing something like the following.

$grabzIt->SaveTo("my_screenshot.jpg");

JavaScript works slightly differently, because with the JavaScript API you can only specify a filename if you are requesting that the screenshot be downloaded, as shown below.

GrabzIt("YOUR APPLICATION KEY").ConvertURL("http://www.google.com",
 {"download": 1,"filename":"my_screenshot.jpg"}).Create();
Back to SupportMore screenshot questions
Try all our premium features for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Screenshots
  • Bigger Everything
Start Free Trial