Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →For a stable gallery or documentation page, generate screenshots during Astro’s build; for captures requested after deployment, use an on-demand server endpoint. Astro’s built-in fetch() can call a hosted screenshot service in either place, so you do not need to add a browser-rendering package just to follow ScreenshotAPI’s documented integration pattern. The key decision is when the capture should happen—and, for a public endpoint, how you will protect it from misuse.
Choose build time or request time
Astro has two distinct moments when it can run code that captures a page. Static endpoints execute while building the site and write files into the generated output. Server endpoints execute when someone requests the route. A static deployment cannot produce a new, user-specific screenshot after it has been published; that requires a server-rendered endpoint.
| Approach | Good fit | Trade-off |
|---|---|---|
| Build-time capture | Showcases, documentation, and other stable content | The image is refreshed by a later build, not by a visitor’s request. Captures also use build resources and add image bytes to the generated site. |
| On-demand endpoint | Changing targets or captures initiated by a user | Requires server rendering, protected credentials, error handling, caching, and controls against abuse. |
Astro’s Endpoints documentation describes static endpoints as build-time output and server endpoints as request-time responses. In hybrid mode, a route intended to stay live must opt out of prerendering with export const prerender = false. Astro’s global fetch() likewise runs at build time by default and at runtime when used in server-rendered output, as explained in its data fetching guide.
Set up ScreenshotAPI credentials and server rendering
The provider-specific example here is for ScreenshotAPI at screenshotapi.to, not the similarly named Screenshot API documented at screenshot-api.org. Their endpoints, authentication, quotas, and feature sets are not interchangeable. ScreenshotAPI’s Astro guide, last updated March 25, 2026, uses Astro’s built-in fetch() and an x-api-key header; it says no additional package is required for its examples.
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Choose an adapter and output mode. For a live capture route, configure Astro for
output: 'server'oroutput: 'hybrid'and install the adapter appropriate to your deployment target, following Astro’s deployment documentation. Purely static output cannot serve a newly generated request-specific image after build. - Keep the API key on the server. Put it in the project’s
.envfile asSCREENSHOTAPI_KEY=your_key. Do not use a browser-visible public variable prefix or embed the credential in client-side code. - Configure the provider endpoint. ScreenshotAPI’s request contract is provider-specific. Use the screenshot endpoint and parameter names shown in its current account documentation. The code below reads that URL from an environment variable rather than assuming a path that may not match your account or current API version.
For example, add the documented ScreenshotAPI endpoint URL as SCREENSHOTAPI_ENDPOINT in your server environment. The variable is configuration, not a browser parameter. Never accept an arbitrary upstream API endpoint from the person requesting a screenshot.
Create an on-demand Astro image endpoint
Create src/pages/api/screenshot.png.ts. This example accepts a target URL and common capture settings, checks that the provider succeeded, and returns image bytes as a PNG response. Confirm the parameter names against ScreenshotAPI’s current guide before deploying; the fields below are not universal screenshot-API conventions.
import type { APIRoute } from 'astro';
export const prerender = false;
const allowedHosts = new Set(['example.com', 'www.example.com']);
export const GET: APIRoute = async ({ request }) => {
const key = import.meta.env.SCREENSHOTAPI_KEY;
const endpoint = import.meta.env.SCREENSHOTAPI_ENDPOINT;
if (!key || !endpoint) {
return new Response('Screenshot service is not configured', { status: 500 });
}
const incoming = new URL(request.url);
const rawTarget = incoming.searchParams.get('url');
if (!rawTarget) {
return new Response('Missing url parameter', { status: 400 });
}
let target: URL;
try {
target = new URL(rawTarget);
} catch {
return new Response('Invalid url parameter', { status: 400 });
}
if (target.protocol !== 'https:' || !allowedHosts.has(target.hostname)) {
return new Response('Target host is not allowed', { status: 403 });
}
const params = new URLSearchParams({
url: target.href,
width: incoming.searchParams.get('width') ?? '1280',
height: incoming.searchParams.get('height') ?? '800',
output: 'png',
full_page: incoming.searchParams.get('full_page') ?? 'false',
color_scheme: incoming.searchParams.get('color_scheme') ?? 'light',
});
let upstream: Response;
try {
upstream = await fetch(endpoint + '?' + params.toString(), {
headers: { 'x-api-key': key },
signal: AbortSignal.timeout(60_000),
});
} catch {
return new Response('Screenshot provider could not be reached', { status: 502 });
}
if (!upstream.ok) {
return new Response('Screenshot provider returned an error', { status: 502 });
}
const bytes = await upstream.arrayBuffer();
return new Response(bytes, {
headers: {
'Content-Type': 'image/png',
'Cache-Control': 'public, s-maxage=3600',
'X-Content-Type-Options': 'nosniff',
},
});
};
The sample allowlist is intentionally restrictive: replace its example hostname with domains your application is meant to capture. If users must submit arbitrary public URLs, define and enforce a careful policy instead of removing validation wholesale. At minimum, reject non-HTTP(S) schemes, localhost, private and link-local address ranges, and internal hostnames; account for redirects and DNS resolution as well. Add authentication, rate limits, and request-size or concurrency controls appropriate to your app. A capture route can otherwise be used to consume your provider quota or probe destinations that should not be reachable.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
The one-hour shared-cache header is only a starting point. It suits targets that rarely change; use a shorter lifetime or bypass shared caching when freshness matters. For user-specific or sensitive captures, do not publicly cache the response. Astro endpoints return standard Response objects, so you can set status and headers explicitly.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Generate static screenshots during a build
For a fixed set of showcase URLs, capture images while rendering a page or generating static endpoint files. The core pattern is to fetch the provider response in build-time code, convert successful bytes to a data URL, and render an image. The guide’s example displays a placeholder when a capture fails rather than failing the whole page.
const response = await fetch(screenshotEndpoint, {
headers: { 'x-api-key': import.meta.env.SCREENSHOTAPI_KEY },
});
let screenshotSrc = '/images/screenshot-unavailable.png';
if (response.ok) {
const bytes = new Uint8Array(await response.arrayBuffer());
let binary = '';
for (const byte of bytes) binary += String.fromCharCode(byte);
screenshotSrc = `data:image/png;base64,${btoa(binary)}`;
}
Here screenshotEndpoint must be built from the endpoint and parameters in ScreenshotAPI’s current documentation for the target page. In production, also check or constrain the target list and verify the returned media type before labeling bytes as PNG. For many large screenshots, writing image files into the build output rather than embedding base64 in HTML can keep markup smaller. Either way, each image is regenerated only when you run another build; deploy the updated output to publish refreshed captures.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Adapt the capture to a gallery, social card, or theme
Reusable gallery component
Keep a list of known URLs and metadata—such as title, alt text, and capture options—in one data source, then render a card per item. Generate each image at build time when the list changes infrequently. Give the image meaningful alternative text, and provide a visible fallback when the provider cannot return a capture. If the list is user-editable or needs fresh captures immediately, move capture work to a protected server endpoint rather than expecting a static page to update itself.
Open Graph image endpoint
A server endpoint can return a fixed social-card size, such as the ScreenshotAPI guide’s 1200 × 630 PNG example. Set the correct image content type and cache policy, and make the target page or card inputs explicit. If a static site is sufficient, produce the card at build time and point its metadata at the generated file instead of adding a runtime capture request.
Recommended Free Tools
Light and dark variants
Where the target supports a color-scheme preference, pass the provider’s documented color-scheme option for separate light and dark captures. Treat those as distinct cache entries; otherwise a cached light capture could be returned for a dark request. The exact option spelling belongs to the selected provider, not Astro.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Provider options and implementation choices
ScreenshotAPI’s Astro guide demonstrates request settings for URL, dimensions, output type, quality, color scheme, and full-page capture. Check its current API documentation for accepted values and parameter names; a parameter accepted by another service may not work here. Beyond those settings, decide who controls each input: fixed build configuration is safer and easier to cache, while request parameters support flexibility but expand validation and abuse-control needs.
- Output and content type: make the returned format agree with the response’s
Content-Type. A PNG endpoint should not label JPEG or PDF bytes as PNG. - Full-page and dimensions: use bounded dimensions and full-page capture only where needed; very large pages can make responses and generated artifacts heavier.
- Cache policy: choose freshness based on how often the target changes. Vary cache keys by every option that affects pixels, including URL, viewport, output, theme, and full-page mode.
- Failure behavior: return an appropriate error for a live request, or a fallback image for non-critical build content. Do not silently display an empty or mislabeled file.
Or skip the browser setup
ScreenshotNeo offers a one-request hosted screenshot API, so you can call it from Astro without running a browser renderer in your app. One GET request can return a PNG, JPEG, WebP, or PDF; its API accepts an access key and target URL. The example below saves the response bytes as WebP. See the ScreenshotNeo API documentation for response formats and options.
curl -G "https://api.screenshotneo.com/v1/shot"
-d access_key=YOUR_API_KEY
--data-urlencode url=https://stripe.com
-o shot.webp
Keep the access key in server-side Astro code or a server environment variable, not in browser JavaScript. ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture, and each of those cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed; response headers report the page verdict and billing status. It also provides an MCP server for AI agents, and its free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo’s free plan.
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 matchTroubleshoot common failures
- The endpoint works locally but returns a prerendered file after deployment: the route is being built as static output. Use server or hybrid output with a compatible adapter, and set
export const prerender = falseon the live route. - The provider returns an authorization error: verify that
SCREENSHOTAPI_KEYis set in the deployed server environment and is sent asx-api-key. Do not expose it as a public client variable. - The provider rejects the request: check its current endpoint, required parameter names, allowed output values, and URL encoding. Do not copy authentication or quotas from the separate service at screenshot-api.org.
- The route returns an error when the provider is slow: inspect provider status and network behavior, set a timeout appropriate to deployment limits, and return a visible error or fallback. Avoid allowing a request to hang indefinitely.
- The image is corrupt or shown as a download: check that the response contains image bytes and that
Content-Typematches the actual output format. - Visitors see stale or another visitor’s image: make cache keys include all capture-affecting inputs and avoid shared caching for private results.
- Builds fail when a target page is unavailable: decide whether a missing screenshot should block publication. For optional showcase art, catch the failure and use a placeholder; for required assets, fail clearly so the build does not publish incomplete content unnoticed.
Cost, reliability, and maintenance
A hosted screenshot API avoids operating a browser renderer in your Astro app, but introduces a dependency on the provider’s API, availability, quota, and current terms. No independent speed or reliability measurements are established here, so do not assume a particular capture time or uptime. Keep build-time captures limited to assets worth regenerating, and use a cache for repeated runtime requests when the freshness and privacy requirements allow it.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
ScreenshotAPI’s Astro guide advertises 200 free screenshots per month with no credit card, as of its March 25, 2026 update. That is a vendor offer, not an Astro allowance, and offers can change; check the current provider terms before budgeting. The separate Screenshot API service at screenshot-api.org describes a different free quota and API contract, which should not be applied to ScreenshotAPI examples.
Choose the simplest deployment that fits
Use build-time screenshots when targets are known and change on a publishing cadence. Use a server endpoint when captures must respond to live input, but make target policy, credential protection, error handling, caching, and rate limits part of the implementation rather than afterthoughts. In both modes, Astro’s built-in fetch() is sufficient for the provider call; the actual screenshot request contract comes from the service you select.
Quick 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.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitches

