Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

To authenticate a screenshot or PDF capture of a protected page, pass the page’s headers in the screenshot provider’s documented target-header option. Keep those separate from headers that authenticate your Node.js request to the rendering service: the service credential goes on the outer request; a target-page Authorization or tenant header goes on the browser request the service makes to the site.

These fields differ by provider. For example, PDFSpark puts target headers in options.headers, while Api2Pdf uses extraHTTPHeaders. The examples below show where they belong, how to save binary output safely, and how to diagnose the common case where the capture returns a login page instead of the expected document.

Two HTTP requests, two places for headers

A screenshot or PDF API usually involves two separate HTTP hops:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Outer request: your Node.js program calls the screenshot service. Its API key or other service credential belongs here, in the authentication format that service specifies.
  2. Target request: the rendering service opens the protected URL in its browser. Page-specific headers, such as Authorization or X-Tenant-Id, must be configured using that provider’s target-header option.

Do not assume that an outer X-API-Key or bearer token is forwarded to the target website. These credentials are for different recipients. Sending a target token as the screenshot service credential will not authenticate the browser at the protected page, and sending a service key to the target may disclose it to the wrong host.

#1 Best Overall
Anker USB C to USB C Cable, 60W Fast Charging Cable (2-Pack, 6 ft, Black)
  • Durable Design: Reinforced nylon exterior and a robust core ensure this cable withstands up to 5,000 bends, outlasting other brands
  • Fast Charging: Supports Power Delivery for up to 60W high-speed charging when paired with a USB-C charger
  • Versatile Compatibility: Works with virtually all USB-C devices, including phones, tablets, and laptops
  • High-Speed Data Transfer: Transfer files quickly with 480Mbps data transfer speeds
  • Included Accessories: Comes with a hook-and-loop cable tie for easy organization and a welcome guide for hassle-free setup

Providers also use different option names and methods. Check the endpoint’s documentation for whether it accepts target headers, how they are encoded, which headers are disallowed, and how it returns the resulting file.

PDFSpark: put target headers in options.headers

For PDFSpark’s /pdf/from-url endpoint, target-page headers go in the JSON request body under options.headers. The endpoint’s documented example uses a POST request. This example reads the target bearer token from an environment variable, checks the HTTP response, and saves the returned bytes to a PDF file:

const response = await fetch('https://pdfspark.dev/api/v1/pdf/from-url', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    url: 'https://app.example.com/dashboard',
    options: {
      headers: {
        Authorization: `Bearer ${process.env.TARGET_TOKEN}`,
        'X-Tenant-Id': 'tenant-42'
      },
      waitUntil: 'networkidle'
    }
  })
});

if (!response.ok) {
  throw new Error(`Render failed: ${response.status}`);
}

const pdfBytes = Buffer.from(await response.arrayBuffer());
await import('node:fs/promises').then(({ writeFile }) =>
  writeFile('page.pdf', pdfBytes)
);

Set TARGET_TOKEN in the process environment before running the script; do not replace it with a token committed to source control. The tenant header is an example of an application-specific value: use the name and value your target application actually requires. The waitUntil setting shown is part of PDFSpark’s example, not a portable option across screenshot services. [PDFSpark documentation]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
LISEN USB C to USB C Cable, 240W Fast Charging Type C Charger Cord (6.6FT)
  • CONFIRM BEFORE BUYING — USB-C to USB-C ONLY: This iPhone 18 Charging cable connects two USB-C ports — it does NOT include a USB-A connector. Not a retractable coil cable. Not a magnetic self-winding cable. Features a tangle-free, ultra-flexible design for everyday 240W fast charging. If you experience any quality issues upon arrival, our customer support team is available 24/7 to assist with a prompt and professional solution
  • High Power ≠ High Risk | Smarter Compatibility for Every Device: 240W doesn't mean compromising safety—it means unmatched versatility. Thanks to PD3.1 Extended Power Range (EPR) technology, our c to c cable fast charging dynamically adjusts voltage/current to deliver each device's maximum safe power (e.g., 60W to iPads, 100W to older MacBooks, 140W to MacBook Pro). Other 60W/100W usb c to usb c cable can't hit full charging speed for your power-hungry devices—they're held back by their own power limits. LISEN 240W usb-c charge cable? It charges all your gear steadily, efficiently, and at full speed, with zero safety risks
  • 240W Ultra Fast Charging | Smart Protocol Matching: This iPhone 18 pro max charger fast charging cable supports PD3.1 EPR/QC4.0 fast charging up to 240W Max, working seamlessly with USB-C Power Delivery adapters (e.g.60W/100W/240W). It automatically matches your device’s handshake protocol to deliver the maximum safe power it can handle. It's 2.4X faster than 100W fast charging usb-c cables: Up to 85% charged in 30 mins for iPhone 18 Pro Max, up to 65% charged in 30 mins for iPad Pro, and up to 80% charged in 30 mins for MacBook Pro 16''(M5). This iPhone 18 charger cord balances speed and protection perfectly, giving you both fast and secure charging
  • E-Marker 3.0 Chip | Real-Time Current/Voltage Monitoring: LISEN 240W type c charger fast charging cable has an E-Marker 3.0 + PD3.1 EPR system that actively monitors current/voltage 3.2M+ times per second, ensuring zero overloads, short circuits, or battery damage. Paired with dual safeguards (overheat + surge protection) and PD3.1/QC4.0 certifications, it's not just a USB-C to USB-C cable—it's a smart guardian for your devices
  • Premium Copper Core | Conductivity Meets Durability: This high speed usb c cable fast charging is upgraded from standard copper to 99.99% oxygen-free copper cores—thicker, purer, and lower-resistance. This means: (1) Stable power delivery even at 240W (no energy loss or heat buildup). (2) Longer lifespan (resists corrosion and wear, unlike cheaper alloys). (3) Faster data sync (480Mbps) with minimal signal interference

PDFSpark documents a maximum of 20 target headers and blocks Host, Cookie, Set-Cookie, Origin, Referer, Proxy-Authorization, Transfer-Encoding, and Content-Length. These are provider constraints: do not try to work around them by putting blocked fields in a generic object. If the target requires cookies, use a cookie mechanism the provider supports rather than assuming a Cookie header can be injected.

How other screenshot and PDF APIs name target headers

Do not copy an option name from one provider into another without checking the endpoint documentation. These documented examples use different request shapes:

Provider Target-header configuration Request and output details
getscreenshot.dev Its Node.js examples show X-API-Key in the outer request headers. The available reference does not establish a target-header option, so do not assume that service credential is forwarded. The examples use Node.js fetch; the PDF example sends a POST request with JSON. The cited reference does not establish binary download details.
PDFSpark options.headers in the JSON body for /pdf/from-url. POST JSON; PDF bytes can be read from the response body. The provider documents a 20-header maximum and a blocked-header list.
Screenshot API GET requests accept a repeatable header parameter; POST requests accept a headers object. Its documentation says these headers are sent only to the target host. Documents X-Page-Status for the final document’s HTTP status after redirects. The cited reference does not establish binary handling details.
Api2Pdf The Node.js SDK method chromeUrlToPdf accepts extraHTTPHeaders for the source URL. With outputBinary: true, the result resolves to a Node.js Buffer.
CloudBrowser The target-header option is named custom_http_header. The cited reference does not establish request-method or binary-output details.

The table reflects the cited provider documentation and does not compare speed, reliability, pricing, or security guarantees. A field name such as headers is meaningful only in its documented location: an outer HTTP request option, a JSON body field, and a query parameter are not interchangeable.

Rank #3
LISEN USB C to USB C Cable 60W for iPhone 18 Pro Duo Charging Cable, 5-Pack
  • 60W Turbo Fast Charging:This iPhone 18 charger cord support PD3.0/QC3.0/QC4.0 fast charging up to 60W Max (20V/3A) with USB-C Power Delivery adapters such as 30W/45W/60W. Which 2.2X faster than 3.1A version and charges USB C Phone from 0% to 80% within 35 minutes, iPad Pro 64% within 35 minutes, Macbook air 50% within 35 minutes, and data transfer speeds up to 480Mbps (1200 songs synced per minute) compatible with Samsung,Tablt,iPad Air Mini Pro,Macbook and More.
  • Right for ALL Your Devices:This is the USB-C to USB-C cable Not the USB-C to USB-A cable, iPhone 18 Pro Max fast charger Compatible with virtually all USB-C devices including phones, tablets, and laptops. Such as Samsung Galaxy S25/S24/S23/S22/S21+/S21/S20/ S20+/ S20 Ultra/ Note 10, MacBook Air/Pro 13'', iPad Mini 6, iPad Pro 2021/2020/2018, iPad Air 2020, iPhone 18/ iPhone Duo/ 18 pro max/ iPhone 17/ iPhone Air/ 17 pro max/iPhone 16/ 16 Plus/ 16 pro max/iPhone 15 pro max plus. NOTE: Don't Compatible with iPhone 14/13/12/11/X. This product supports bulk purchasing, making it ideal for businesses and large orders.
  • Green Recyclable Materials:The LISEN USB C to USB C iPhone 18 17 16 15 charger fast charging you rely on most are braided from 48 strands of recyclable cotton yarn material. This braiding design also helps to prevent tangling and damage from bending and twisting. Using recycled materials is one of the ways we can lower the carbon impact of our products, since these materials often have a lower carbon footprint than materials from primary sources.
  • Triple Protection USB C Port:USB to USB C Cable has electronic safety certifications that comply with appropriate standards, it built-in laser welding technology, which ensure the metal part won't break. The copper core part is reinforced with UV glue to prevent the solder joints from falling off. The USB C port pass Load-bearing 13KG test which longer service life and will never break.
  • What You Get:LISEN USB C to USB C Cable 5-Pack (3.3/3.3/6.6/6.6/10FT), 18-Month worry-free period and 24/7 customer service, if you have any questions, we will resolve your issue within 24 hours. Whether you're shopping for samsung or iphone 16 pro max charger cord accessories gifts for men/women or reliable car accessories, this super fast charger usb c to c cable is built to last

Use ScreenshotNeo for a one-call capture with target headers

For a screenshot request, ScreenshotNeo accepts custom headers, cookies, and Authorization values for the target page. Its parameter names also work with the names other screenshot APIs use, which can make an integration easier to switch. The API returns a screenshot or PDF, and its response includes diagnostic billing and page-verdict headers. Read the ScreenshotNeo API documentation for the target-header parameter and other request options; do not put a page credential in the outer API key field.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://app.example.com/dashboard',
  header: 'Authorization: Bearer YOUR_TARGET_TOKEN'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Capture failed: ${res.status}`);
await import('node:fs/promises').then(({ writeFile }) =>
  writeFile('shot.webp', Buffer.from(await res.arrayBuffer()))
);

In the code above, access_key authenticates the ScreenshotNeo request and header supplies a header for the target page. Store both credentials outside source control. ScreenshotNeo can also remove cookie-consent banners, newsletter popups, and chat widgets before capture; those cleanup steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

ScreenshotNeo is a website screenshot API and MCP server from Yorker Media. Plans include 1,000 shots per month free without a card; paid plans start at $5 for 3,000 shots. Sign up for ScreenshotNeo and get 1,000 free screenshots a month with no card.

Protect credentials and verify the file

  • Keep service and target credentials distinct. Put the rendering service’s API key in the outer request exactly where that service requires it. Put page authentication in the documented target-header field.
  • Avoid logging secret values. Log whether a credential is configured, not its contents. Prefer short-lived target tokens where the application supports them.
  • Check the response before writing a file. A successful HTTP response does not, by itself, prove that the bytes are a valid PDF or the expected image. Check response.ok and Content-Type, then inspect the saved file signature. A PDF begins with %PDF.
  • Inspect the captured page’s status if available. A final target status of 401 or 403 commonly indicates that the browser received an unauthorized page rather than the intended content. Redirects can also affect the final document status.
  • Use the right mechanism for cookies. A provider may expose a cookie option separate from headers; PDFSpark explicitly blocks the Cookie header.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting: why the capture shows the wrong page

The capture is a login screen or returns 401/403

First verify that the token is a target credential accepted by the destination—not merely the key for the screenshot API. Confirm the target header is under the provider’s documented field and that its exact scheme and value match what the application expects, such as Bearer …. If the provider exposes the final page status, inspect it; Screenshot API documents X-Page-Status, which reports the final document’s HTTP status after redirects. A 401 or 403 points toward missing, invalid, expired, or incorrectly scoped page authentication.

Rank #4
ANKER USB A to USB C Cable, USB to USB C Cable (2-Pack, 6 ft, Black)
  • The Anker Advantage: Join the 50 million+ powered by our leading technology.
  • Enhanced Durability: Improved construction techniques and materials make a cable that lasts 5× longer.
  • Universal Compatibility: Designed to work flawlessly with any device that uses a USB-C port.
  • Fast Sync & Charge: Supports fast charging up to 15W (3A/5V) and data transfer speeds up to 480Mbps. (Not compatible with Power Delivery).
  • What You Get: 2 × Premium Nylon-Braided USB-A to USB-C Charger Cable (6ft), welcome guide, everlasting warranty, and our friendly customer service.

The request fails before producing a file

Check the outer service’s authentication format separately from the target headers. Confirm the HTTP method, endpoint, JSON content type, and body shape match that provider’s API. A target option copied from another vendor—such as using extraHTTPHeaders where the endpoint expects options.headers—may be ignored or rejected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The PDF file is empty, corrupt, or actually an error response

Do not write every response body to a .pdf file and assume it worked. Check response.ok and the content type before saving, then check that the result starts with %PDF. For APIs that return JSON errors, read and report that error response rather than treating it as PDF bytes. For SDKs, confirm whether the method returns a URL, a structured result, or binary data; Api2Pdf documents that outputBinary: true yields a Node.js Buffer.

The target requires a blocked header or cookie

Check the provider’s blocked-header policy. PDFSpark’s documented restrictions include cookie and several connection- or origin-related headers. Do not attempt to bypass those restrictions. Use the service’s separate cookie feature if available, or an authentication flow supported by the target and rendering provider.

Best Value
Sale
Apple 60W USB-C to USB-C Woven Charge Cable (1 m): Fast and Convenient Charging
  • DESIGNED BY APPLE — Ideal for charging, syncing, and transferring data between USB-C devices, this 1-meter charge cable is made with a woven design and has USB-C connectors on both ends.
  • FAST AND CONVENIENT CHARGING — Supports charging of up to 60 watts and transfers data at USB 2 rates. Pair the USB-C Charge Cable with a compatible USB-C power adapter to conveniently charge your devices from a wall outlet and even take advantage of the fast-charging feature on select iPhone models.
  • WHAT’S IN THE BOX — Apple USB-C Woven Charge Cable only. Power adapter sold separately.
  • CABLE LENGTH — 1 meter (3 feet).

The page loads but content is missing

Authentication and rendering readiness are separate issues. A token can grant access while the page’s client-side application is still loading data. Where supported, configure a documented wait condition, selector, or delay suitable for the page. PDFSpark’s example uses waitUntil: 'networkidle'; that setting should not be assumed to exist under the same name in another provider.

Performance, reliability, and cost considerations

Custom headers solve access to a target resource; they do not establish how quickly or reliably the provider will render it. The cited provider references do not provide comparable latency, uptime, or cost measurements, so choose based on documented request support, header policy, response diagnostics, file handling, and the credential requirements of your target.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Minimize what you send. Include only headers the target application needs, and avoid forwarding broad session or service credentials.
  • Make failures observable. Preserve the HTTP status and any provider diagnostic headers in application logs, while redacting tokens. Distinguish a provider request error from a target-page 401/403 and from a successful capture of the wrong content.
  • Plan for binary output. Buffer the response for modest files; for larger or high-volume workloads, follow the provider’s documented streaming or asynchronous options rather than assuming every API behaves the same way.
  • Evaluate caching deliberately. A cache may return a capture made under different authentication or content conditions. Check the provider’s cache semantics before using it for personalized pages, and avoid exposing a cached private document through a public URL.

Frequently Asked Questions

Does adding an Authorization header to Node.js fetch authenticate the page being screenshotted?

Not necessarily. That header may authenticate only your request to the screenshot service. Put target-page authorization in the provider’s documented target-header option.

Can I send the same target-header option to every screenshot API?

No. Providers use different names and request locations, including options.headers, headers, extraHTTPHeaders, and custom_http_header.

What should I check if the capture looks successful but contains a login page?

Check the target request’s final page status if the provider exposes it, and verify the target token, header syntax, and redirect behavior.

Quick Recap

Bestseller No. 1
Anker USB C to USB C Cable, 60W Fast Charging Cable (2-Pack, 6 ft, Black)
Anker USB C to USB C Cable, 60W Fast Charging Cable (2-Pack, 6 ft, Black)
High-Speed Data Transfer: Transfer files quickly with 480Mbps data transfer speeds
$9.99
Bestseller No. 4
ANKER USB A to USB C Cable, USB to USB C Cable (2-Pack, 6 ft, Black)
ANKER USB A to USB C Cable, USB to USB C Cable (2-Pack, 6 ft, Black)
The Anker Advantage: Join the 50 million+ powered by our leading technology.
$9.99
SaleBestseller No. 5

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.