Use a Google Apps Script time-driven trigger to run on a schedule, call a screenshot-rendering service over HTTPS, and save the returned image bytes into a Google Drive folder. Apps Script can schedule and store the work, but it does not render a web page into a screenshot by itself. The example below uses ScreenshotNeo for rendering; the schedule is approximate rather than an exact-to-the-minute appointment.
The workflow is usable from India, but the available evidence does not establish India-specific service availability, pricing, or legal requirements. Check the terms and data-handling requirements of the services you choose.
As an Amazon Associate I earn from qualifying purchases.
What you need
- A Google account with access to Apps Script and the destination Drive folder.
- A screenshot-rendering endpoint that accepts a URL and returns an image. Apps Script’s
UrlFetchAppcan make HTTP and HTTPS requests, but fetching a page’s HTML is not the same as rendering it in a browser. - An API key for the screenshot service, if required. Keep it private; do not put it in a publicly shared script or document.
Google documents time-driven triggers as allowing scripts to execute at specific times or intervals: Apps Script installable triggers. Google also documents UrlFetchApp for making requests and the Drive service for managing files and folders.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Set up the scheduled capture
1. Create a Drive folder
Create a folder for the captures in Google Drive and copy its folder ID from the folder URL. The folder ID is the part after /folders/. The Google account that creates the trigger must have permission to write to this destination.
#1 Best Overall
2. Add the script
Open Google Apps Script, create a project, and replace its starter code with the following. Change the target URL, folder ID, and API key. The request uses ScreenshotNeo’s documented endpoint and saves the returned image as a timestamped WebP file.
const TARGET_URL = 'https://example.com';
const DRIVE_FOLDER_ID = 'YOUR_DRIVE_FOLDER_ID';
const SCREENSHOT_API_KEY = 'YOUR_API_KEY';
function captureWebsiteToDrive() {
const endpoint = 'https://api.screenshotneo.com/v1/shot';
const response = UrlFetchApp.fetch(endpoint, {
method: 'get',
payload: {
access_key: SCREENSHOT_API_KEY,
url: TARGET_URL
},
muteHttpExceptions: true
});
const status = response.getResponseCode();
const headers = response.getAllHeaders();
const verdict = headers['X-Page-Verdict'] || headers['x-page-verdict'];
const billed = headers['X-Billed'] || headers['x-billed'];
if (status < 200 || status >= 300) {
throw new Error(`Screenshot request failed: HTTP ${status}; verdict=${verdict}; billed=${billed}`);
}
const contentType = String(headers['Content-Type'] || headers['content-type'] || '');
if (!contentType.toLowerCase().startsWith('image/')) {
throw new Error(`Expected an image response but received ${contentType || 'an unknown content type'}; verdict=${verdict}; billed=${billed}`);
}
const folder = DriveApp.getFolderById(DRIVE_FOLDER_ID);
const timestamp = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), 'yyyy-MM-dd_HH-mm-ss');
const blob = response.getBlob().setName(`website-shot-${timestamp}.webp`);
folder.createFile(blob);
}
In Apps Script’s request options, payload is sent as query parameters for a GET request. The equivalent request shape and available capture options are documented at ScreenshotNeo API documentation. If your selected provider uses different parameter names or returns a different content type, adapt the request and file extension to that provider.
3. Authorize and run once
Choose captureWebsiteToDrive in the function selector and click Run. Google will ask you to authorize the script to contact external services and manage Drive files. Confirm the output by checking the folder for a newly created image. If the script project specifies OAuth scopes explicitly, include the external-request scope required by UrlFetchApp; otherwise Apps Script typically requests scopes as needed.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
- Intuitive interface of a conventional FTP client
- Easy and Reliable FTP Site Maintenance.
- FTP Automation and Synchronization
4. Create the recurring trigger
- In the Apps Script editor, open Triggers (the clock icon) and click Add Trigger.
- Choose
captureWebsiteToDriveas the function to run. - Set the event source to Time-driven, then choose the schedule type and interval you need—for example, an hourly or daily trigger.
- Save the trigger and authorize it if prompted.
Installable time-driven triggers can recur as frequently as once per minute or as infrequently as once per month. They are not exact-time schedulers: Google may randomize a nominal trigger time within an hour, then keep the chosen time consistent thereafter. Choose a trigger frequency that matches your tolerance for this timing window; do not use it for deadlines that require a guaranteed run at a precise minute.
Choose the capture and storage behavior
Visible viewport or full page
A viewport capture records what fits in the browser window; a full-page capture attempts to include content beyond the initial screen. Choose based on what you need to compare or archive. Lazy-loaded images and content that appears only after scrolling may need provider-specific full-page handling.
Viewport, format, and dynamic content
Set viewport dimensions and output format in the screenshot service. If the page populates content asynchronously, use that service’s supported wait behavior, such as waiting for a selector or a delay, if available. Parameter names and behavior are provider-specific; consult the provider’s documentation rather than assuming one API’s options work with another.
Rank #3
File naming and retention
The sample uses a timestamp in the filename so successive runs create distinct files. Repeated captures will accumulate in Drive; decide how long to retain them and periodically remove files you no longer need. If you need to overwrite a single file or organize captures into dated subfolders, add that behavior deliberately rather than relying on the timestamped-file example.
Personal Drive or shared drive
The basic example uses the built-in Drive service for a folder accessible to the trigger’s owner. Google’s advanced Drive service supports additional Drive features, including shared-drive operations, and may need to be enabled in the Apps Script project and its associated Cloud project. See Advanced Drive service for setup and limitations.
Or skip the browser setup
ScreenshotNeo handles the page rendering through a single HTTP request, while Apps Script can still schedule a call and save its response to Drive. Its clean-shot steps accept cookie or consent banners like a visitor and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. It also offers an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents.
cURL example:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
For the Apps Script function above, use this request snippet in place of the provider-specific fetch block:
Rank #4
const response = UrlFetchApp.fetch('https://api.screenshotneo.com/v1/shot', {
method: 'get',
payload: {
access_key: SCREENSHOT_API_KEY,
url: TARGET_URL
},
muteHttpExceptions: true
});
See the ScreenshotNeo API documentation for request options. One thousand screenshots per month are free with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.
Troubleshooting
- The script saves HTML or a JSON error as an image: Check the HTTP status and response content type before creating the Drive file. The example throws an error for non-image responses rather than saving them silently.
- Authorization or permission error: Run the function manually to complete authorization. Confirm the account that created the trigger can access the Drive folder and that explicit OAuth scopes, if configured, include external requests and Drive access.
- No file appears: Verify the folder ID, inspect the Apps Script execution log for the latest run, and check that the request completed successfully. A trigger runs under the account of its creator, not necessarily the person currently viewing the script.
- The page is blank, incomplete, or different from your browser: The site may block automated requests, require a login or region-specific session, or load content asynchronously. Confirm the target page is publicly accessible to the rendering service, and adjust the provider’s wait settings where supported. Do not assume the service sees the same content or region as your local browser.
- The capture does not run at the requested exact time: Time-driven triggers have a timing window. If exact execution timing is essential, use a scheduler designed for that requirement rather than treating Apps Script triggers as a precise clock.
- Runs stop or exceed limits: Check Apps Script’s execution history and the quotas or runtime limits applicable to your Google account and script. Reduce the frequency or avoid unnecessary captures if the target does not need to be checked so often.
Reliability, privacy, and cost considerations
Each scheduled run depends on several systems: Google’s trigger execution, network access from Apps Script, the screenshot provider’s rendering, and permission to create the Drive file. A trigger does not guarantee that the target site will be available or render the same content on every run. Review execution logs and periodically verify saved files if these screenshots support an operational workflow.
Consider whether the page contains private or personal information before sending its URL or authenticated content to a third-party renderer. Keep API credentials out of shared source code, restrict access to the Drive folder, and review the provider’s data practices and terms directly. Costs depend on the screenshot service and the number and type of captures; the cited implementation evidence does not establish India-specific provider availability or pricing beyond ScreenshotNeo’s stated plans.
Best Value
Frequently Asked Questions
Can I run this without a screenshot API?
Yes, if you operate browser automation or a browser-rendering service yourself; Apps Script’s HTTP fetch alone does not render a page into an image.
Will a time-driven trigger run while my computer is off?
Yes. Apps Script executes the trigger in Google’s service under the account that created it; it does not depend on your computer staying on.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchQuick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




