ScreenshotNeo

BlogHow-to

ShrinkTheWeb API Integration with PHP for Indian Developers

Learn the documented ShrinkTheWeb PHP and Drupal integration pattern, what its old examples do, and what Indian developers should verify before relying on it today.

By the ScreenshotNeo team4 October 20267 min read

ShrinkTheWeb is described as a service that captures website screenshots and provides thumbnail images. The available PHP instructions are historical Drupal 8 documentation last updated in 2019; the service homepage currently says “Relaunching Soon!”, so current API availability, credentials, endpoint, pricing, and account terms cannot be confirmed from the reviewed sources. Treat the code below as a description of that old Drupal integration pattern, not as a verified standalone PHP client or current API recipe. [ShrinkTheWeb homepage] [Drupal 8 setup guide]

For Indian developers, the same caution applies: the reviewed sources establish no India-specific pricing, billing, data location, or support terms. Check current official documentation and account terms before committing to the integration.

1. What the historical PHP integration does

The documented PHP example belongs to a Drupal module. Drupal render arrays pass a target URL and a theme key, shrinktheweb_image, to the module, which renders the screenshot image. The module’s basic use and field formatter rely on global settings; an advanced render array can supply per-image overrides. This is Drupal-specific code, not a generic HTTP request that can be copied into any PHP application. [Drupal 8 setup guide]

The guide describes an account setup flow in which users obtain access and secret keys from a profile, configure them in Drupal administration, select a thumbnail cache directory, and optionally choose how many days cached images remain unchanged. Those instructions date to 2019 and do not verify that registration, keys, or these settings remain available.

2. Check whether ShrinkTheWeb is usable now

  1. Visit the official site and look for a current relaunch notice, service-status statement, and link to current API documentation.
  2. Confirm that the documentation names the supported endpoint, authentication method, request parameters, response format, and error behavior.
  3. Check account creation, quotas, current pricing, PHP requirements, and any India-specific billing or support terms directly with the provider.
  4. For a Drupal site, check module maintenance and compatibility before installing. Drupal.org currently labels the module unsupported and obsolete and lists no supported stable releases. [Drupal.org project status]

The homepage’s relaunch notice does not prove that every existing account or API request is offline. It does mean the public evidence reviewed here is insufficient to confirm present-day availability. [ShrinkTheWeb homepage]

3. Historical Drupal 8 setup pattern

The 2019 guide describes this sequence:

  1. Register for a ShrinkTheWeb account and retrieve the access and secret keys from the account profile, if that flow is still offered.
  2. Install and enable the Drupal module using the process documented for the Drupal version in use. The module is currently marked obsolete, so this is a historical outline, not a recommendation to add an unsupported dependency.
  3. Enter the credentials in the module’s administration settings.
  4. Choose a directory for cached thumbnails and, optionally, the number of days a cached image remains unchanged.
  5. Render an image for a page URL using the module’s theme key or configure its field formatter for consistent site-wide settings.

Do not put secret credentials into templates, browser JavaScript, or public source control. If an old integration is still running, keep its credentials server-side and follow the provider’s current security guidance if available.

4. Historical PHP render-array examples

The guide’s basic example passes a URL to Drupal’s theme system:

$build['screenshot'] = [
  '#theme' => 'shrinktheweb_image',
  '#url' => 'https://example.com/',
];

The advanced pattern adds capture parameters to that individual render array. The guide lists these names and meanings; they are historical module options and are not verified current service parameters:

$build['screenshot'] = [
  '#theme' => 'shrinktheweb_image',
  '#url' => 'https://example.com/',
  '#options' => [
    'custom_width' => 600,
    'full_length' => true,
    'max_height' => 1200,
    'native_resolution' => true,
    'widescreen_resolution_y' => 768,
    'delay' => 5,
    'quality' => 80,
  ],
];

Use the exact array structure required by the installed historical module version; the source does not establish that this is valid for a current Drupal release. In the guide, global module configuration and field formatters apply shared settings, while the advanced array permits per-image overrides. [Drupal 8 setup guide]

Options described in the old guide

Option Documented purpose What to verify
custom_width Set a custom thumbnail width. Accepted range, units, and current support.
full_length Request a full-length page capture. Current availability and any height limits.
max_height Set a maximum crop height. How it interacts with full-length capture.
native_resolution Request native resolution. Exact output dimensions and account eligibility.
widescreen_resolution_y Set a widescreen viewport height. Supported viewport dimensions.
delay Wait before capture. Units, maximum, and whether it affects request limits.
quality Set image quality. Valid values and applicable image formats.

The guide says page-specific capture may depend on an “Inside Pages” upgrade. This is a historical entitlement statement; check current account documentation before relying on it. [Drupal 8 setup guide]

5. Why this is not a standalone PHP API recipe

The documented examples invoke a Drupal theme hook. They do not provide enough evidence to construct a current raw PHP request: no verified endpoint path, request signature, authentication protocol, response schema, rate limits, supported PHP versions, or current plan rules are established by the reviewed material.

A generic curl or PHP HTTP example with guessed parameters would be unsafe to present as working ShrinkTheWeb code. Use an official current API reference, if one is published after the relaunch, to implement a direct request. Until then, the historical Drupal example is useful only for understanding the old module’s integration shape.

6. Caching, reliability, and performance considerations

The old Drupal guide describes a thumbnail cache folder and a configurable number of days before cached images change. Caching can reduce repeated capture work and make page rendering less dependent on a screenshot request at every visit, but the guide does not establish current cache semantics, refresh behavior, or service reliability.

  • Keep screenshot generation out of a latency-sensitive page request when your current provider and architecture support background work.
  • Cache generated images locally or at your CDN where licensing and provider terms allow it; define how and when a thumbnail refreshes.
  • Set bounded timeouts and handle failures so a screenshot service outage does not break the page that displays a thumbnail.
  • Measure actual capture latency and storage use in your own environment; the dossier provides no performance benchmarks.
  • For pages behind authentication or containing personal data, verify the provider’s data handling and retention terms before sending URLs or credentials.

7. Troubleshooting the historical integration

Symptom Likely cause Next step
No image appears in Drupal. Missing or invalid module settings, an incorrect theme key, or the old module failing with the installed Drupal version. Check Drupal logs and configuration; verify module compatibility. The module is currently marked unsupported and obsolete.
Credentials are rejected. Keys may be outdated, entered in the wrong settings, or the historical account flow may no longer exist. Confirm current credentials and authentication instructions from official documentation; do not guess a replacement endpoint.
Some target pages cannot be captured. The URL may require login, block automated access, or be unavailable to the service. Check that the page is publicly reachable and review current provider error documentation. Do not assume a particular error code from the old guide.
Images look cropped or too small. Width, viewport, crop height, full-length behavior, or quality settings may not match the intended result. Adjust documented options only if confirmed supported by the installed module/API, then inspect the output.
Changes do not show up. A cached thumbnail may be served until its configured refresh period expires. Review cache settings and refresh behavior. The old documentation does not establish a current cache purge API.
Installation causes compatibility problems. The Drupal module is obsolete and unsupported. Avoid making it a new production dependency; choose a maintained implementation with current documentation.

8. Or skip the browser setup

ScreenshotNeo is a current screenshot API and MCP server for developers. One GET request can return a PNG, JPEG, WebP, or PDF, with options for viewport, full-page capture, element selection, wait behavior, headers, cookies, and more. See the ScreenshotNeo API documentation.

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)
open("shot.webp", "wb").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}`);

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, with no card required.

9. FAQ

Is the old ShrinkTheWeb Drupal module suitable for a new site?

Drupal.org marks it unsupported and obsolete, with no supported stable releases. It should not be treated as a maintained current dependency. [Drupal.org project status]

Does this guide confirm ShrinkTheWeb is down?

No. The homepage says “Relaunching Soon!”, which leaves operational availability unconfirmed; it does not prove that all existing accounts or requests are offline. [ShrinkTheWeb homepage]

Are Indian prices or data residency documented here?

No. The reviewed sources do not establish India-specific prices, billing, data location, or support terms. Check current provider terms before adopting the service.

Sources and scope

The historical implementation details come from the Drupal 8 setup guide, last updated in 2019. Current project status comes from Drupal.org, and the availability caveat comes from the official homepage. No current ShrinkTheWeb API schema or India-specific service terms were established in the reviewed sources.