ScreenshotNeo

BlogHow-to

GrabzIt Screenshot API Tutorial for Indian WordPress Bloggers

Use GrabzIt’s WordPress shortcode plugin or PHP library to capture webpages and HTML. Follow setup, credential, callback, and troubleshooting steps.

By the ScreenshotNeo team4 October 20268 min read

To capture a webpage on a WordPress site with GrabzIt, choose one of two routes: install its WordPress plugin and place a [grabzit] shortcode in a post, or use the GrabzIt PHP library for a custom server-side workflow. The plugin is the simpler option for embedding captures in posts. PHP gives you more control over when captures run, where files are saved, and how your application handles results.

GrabzIt is a hosted capture service. You need an account and application credentials for either route. Keep the application secret on the server, authorize the domain that will make requests, and consult GrabzIt’s current documentation for supported formats and exact options.

1. Choose the WordPress plugin or PHP library

Route Best for What you manage
WordPress plugin Adding a webpage or HTML capture to post content with a shortcode Plugin installation, application key settings, and domain authorization
PHP library Custom workflows, scheduled jobs, or processing captures in application code PHP code, credentials, output handling, and optionally a callback endpoint

These are separate implementations. The shortcode is interpreted by the plugin; it is not PHP code. Use the PHP library when a shortcode cannot express the workflow you need.

2. Create credentials and authorize your site

  1. Create or sign in to a GrabzIt account and obtain the application key and secret. See the GrabzIt API overview for account and credential information.
  2. In the account or plugin configuration, authorize the domain that will use the capture feature. The WordPress plugin requires domain authorization; verify the exact current settings in its vendor setup instructions.
  3. Store the secret in server-side configuration or an environment variable for custom PHP. Do not put it in a public post, browser JavaScript, a screenshot, or a public repository.

A domain mismatch, such as authorizing the production hostname but making requests from a staging hostname, can prevent captures from working. Check both the site URL and any www/non-www or subdomain variation you use.

3. Add a GrabzIt shortcode to a WordPress post

  1. Install and activate the GrabzIt Web Capture plugin from the WordPress plugin directory.
  2. Open the plugin settings and enter the application key as directed. Authorize your WordPress domain with GrabzIt.
  3. Add a shortcode in the post editor where the capture should appear. The plugin listing documents patterns such as these:
[grabzit]https://www.google.com[/grabzit]

[grabzit]<h1>Hello there</h1>[/grabzit]

[grabzit format="pdf" download="1"]https://www.google.com[/grabzit]

The first example captures a URL. The second supplies HTML. The third requests PDF output and a download behavior using attributes shown in the vendor example. Confirm accepted attributes, formats, and whether the download option suits your desired display in the current WordPress plugin documentation before using them in production.

Test the shortcode in a draft or private post first. Check the rendered page as a visitor, because editor previews may not execute shortcodes the same way as the public page.

4. Use the GrabzIt PHP library for a custom capture

For a custom integration, use GrabzIt’s PHP library rather than copying a shortcode into PHP. The general workflow is to create a client with the application key and secret, request a URL or HTML capture, then either save the result or retrieve it when processing completes. Consult the current PHP API documentation for the exact current method signatures and installation instructions.

The following is a configuration-shaped example, not a drop-in substitute for the current library documentation. Install the vendor library using its current instructions and adapt the client constructor and method calls to the installed version:

<?php
// Load the library using the installation method documented by GrabzIt.
require_once __DIR__ . '/vendor/autoload.php';

$applicationKey = getenv('GRABZIT_APPLICATION_KEY');
$applicationSecret = getenv('GRABZIT_APPLICATION_SECRET');

if (!$applicationKey || !$applicationSecret) {
    throw new RuntimeException('GrabzIt credentials are not configured.');
}

// Follow the current GrabzIt PHP documentation for the client class
// and constructor signature used by your installed library version.
$client = new \GrabzIt\GrabzItClient($applicationKey, $applicationSecret);

// Example method shape documented by the official repository.
$client->URLToImage('https://example.com');

// For asynchronous processing, provide a publicly reachable callback URL.
$client->Save('https://example.com/grabzit-callback.php');
?>

GrabzIt’s repository includes a callback pattern: the service calls your handler when the capture is ready, and the handler retrieves the result by capture ID and writes the bytes to a results directory. Use the current official PHP repository example for the matching retrieval code. The destination directory needs appropriate read and write access, and the callback endpoint must be publicly reachable by GrabzIt.

For a synchronous or application-controlled flow, the advanced PHP documentation describes checking capture status and handling processing, cached, and expired states. Download the resulting capture to your server before displaying it when you need control over storage and delivery. Direct response output is also possible when you set the correct MIME type and manage headers carefully. See GrabzIt’s advanced PHP documentation.

5. Capture HTML instead of a public URL

Use HTML input when the content is generated in your application and does not have a stable public URL. The plugin listing shows HTML inside the shortcode. The PHP library also supports HTML capture workflows; refer to the current API documentation for the method and options supported by your installed version.

  • Make sure the supplied HTML is valid and includes the styles and assets needed for the intended appearance.
  • Remote images, stylesheets, and fonts must be reachable to the capture service. Private network resources or assets requiring an unprovided session may not load.
  • Do not put secrets or private user data in HTML that is sent to a hosted capture service unless your data handling requirements permit it.

6. Troubleshoot common GrabzIt WordPress problems

Symptom Likely cause What to check
Shortcode appears as plain text Plugin is inactive, shortcode was altered, or content path does not process shortcodes Confirm activation, use the documented opening and closing shortcode syntax, and test in a standard post body.
Capture is rejected or missing Wrong key, domain not authorized, or hostname mismatch Recheck the key in plugin settings and authorize the exact domain making the request.
Capture remains unavailable Page load failure, processing delay, or callback flow not completing Inspect capture status and errors using the documented API methods. For callbacks, confirm the endpoint is publicly reachable and its server logs show the request.
Callback runs but no file appears Results directory is missing or not writable Check the configured path and the web server user’s permissions. The official repository example requires read/write access to its results directory.
Image or styling is absent Capture service cannot fetch an asset or the HTML omitted its styles Check asset URLs, access restrictions, and the HTML/CSS supplied to the capture request.
Works on staging but not production, or the reverse Different authorized hostnames, configuration, or filesystem permissions Compare site hostnames, credentials, plugin configuration, and destination directory access in each environment.
PDF or requested format is not produced Unsupported or misspelled shortcode attribute or format for the installed plugin version Verify exact attribute names and supported formats in the current plugin documentation; start with a minimal URL shortcode.

7. Compatibility and maintenance notes

Plugin compatibility and package releases change. The research snapshot checked on 2026-10-03 recorded the WordPress.org listing as version 1.0.9, last updated eight months earlier, tested through WordPress 6.9.0, and requiring WordPress 4.5.0+ and PHP 7.2.24+. Treat those as dated listing values, not a current compatibility promise. Check the live plugin listing and vendor support notes before installing or upgrading.

The Packagist record in the same snapshot listed grabzit/grabzit 3.5.8 dated 2026-06-18 and a package PHP requirement of at least 5.3.2. A package’s minimum metadata does not mean that version is appropriate for a new server. Verify currently supported PHP versions with GrabzIt and use a maintained PHP runtime.

8. Performance, reliability, and cost considerations

  • Performance: Captures depend on the target page and its assets loading, plus the hosted service processing the request. A callback avoids holding a web request open while asynchronous processing completes.
  • Reliability: Handle pending, failed, and expired results explicitly. Log capture IDs and status details, and make callback processing safe to retry so duplicate notifications do not create inconsistent files.
  • Storage: Saving captures locally requires a writable destination and a retention policy. Avoid exposing generated files if the source page or capture is private.
  • Cost: The sources reviewed confirm account and credential setup but do not establish current quotas, plan entitlements, or India-specific prices. Check GrabzIt’s current pricing and account terms before estimating recurring usage.

Or skip the browser setup

If you need a direct screenshot API call instead of configuring a WordPress plugin or maintaining a capture callback, ScreenshotNeo is a website screenshot API and MCP server. One GET request accepts a URL and returns PNG, JPEG, WebP, or PDF. See the ScreenshotNeo API documentation for parameters and response details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
with open("shot.webp", "wb") as f:
    f.write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);
  • Cookie banners are accepted and removed before capture; 60+ known consent platforms, newsletter popups, and chat widgets can be removed, and each step can be turned off.
  • Bot checks, blank pages, failed loads, timeouts, and cache hits cost nothing; response headers identify the page verdict and billing status.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents and MCP clients.
  • The free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; every feature is on every plan.

Sign up for ScreenshotNeo free: 1,000 screenshots a month, no card required.

FAQ

Can I use GrabzIt without writing PHP?

Yes. The WordPress plugin provides a shortcode workflow. You still need an account, configured application key, and domain authorization.

Can I capture a page that requires a logged-in WordPress session?

The cited shortcode examples do not establish authenticated-session support. Check the current API documentation for supported authentication or cookie options before relying on a private page capture.

Should I put the generated image directly in a post?

Use the plugin’s documented rendering behavior for shortcode output, or save and serve a PHP-generated capture according to your access and retention needs. For PHP, GrabzIt recommends downloading a capture to your web server before displaying it.