Why Does n8n Return a Screenshot API Response as JSON Instead of an Image?
Set n8n’s HTTP Request node to File when an API returns image bytes. If the API returns JSON, inspect whether it contains a URL, base64 data, or a job status.
If n8n shows JSON where you expected a screenshot, first check what the screenshot endpoint actually returned. In the HTTP Request node, set Response Format to File and choose a binary output field such as data when the endpoint returns raw PNG, JPEG, or WebP bytes. If the endpoint returns a JSON object, choosing File cannot turn that JSON into an image: follow the API’s documented flow to download a URL, decode base64, or wait for an asynchronous job to finish.
In n8n, a downloaded image is carried as binary data, separate from ordinary JSON fields. Pass the named binary field to a downstream node that accepts files. The exact labels can vary by n8n version; the current V3 node description lists Autodetect, File, JSON, and Text response formats. See the HTTP Request node documentation and the HTTP Request V3 node description.
1. Identify what the endpoint returned
Open the execution for the HTTP Request node and inspect its output, status, and—when available—response headers. Look at the API documentation for the specific endpoint and check its expected success response. A screenshot API can return any of these patterns:
| Response from the API | n8n handling | What happens next |
|---|---|---|
| Raw PNG, JPEG, or WebP bytes | Set response format to File and name the binary output field, for example data. |
Use that binary field in a downstream file-aware node. |
| JSON containing an image URL | Keep the first response as JSON. | Read the URL, make a second HTTP Request to it, and set that download request to File. Include authentication if the provider requires it. |
| JSON containing base64 data | Keep the response as JSON. | Convert the documented base64 field into binary file data using an appropriate n8n file or binary operation. |
| JSON with a job ID or status | Keep the response as JSON. | Follow the provider’s documented wait, poll, or completion flow, then download the finished image if the API provides it separately. |
These are diagnostic patterns, not behavior guaranteed by any particular provider. Check the API documentation for the endpoint you called; do not infer its response format from the fact that it creates screenshots.
2. Configure n8n for an endpoint that returns image bytes
- Open the HTTP Request node that calls the screenshot endpoint.
- Set the method, URL, authentication, query parameters, and headers as the API documentation requires.
- Find the response-format setting. Choose File.
- Set the binary output field name, such as
data. Use the same name when configuring downstream nodes. - Execute the node, then inspect its binary output. Pass the binary field to a node that can save, upload, or otherwise consume a file.
If you need the status and headers for diagnosis, enable the node’s full-response option if your installed version provides it. Check the actual HTTP status and content type before treating the body as an image. A server can return an error document or JSON error payload even when the request was intended to produce a screenshot.
What “File” changes
The response-format setting tells n8n how to handle the response body. JSON parses or formats the body as JSON; File stores the response as binary file data. The file is not expected to appear as ordinary JSON properties. Downstream, refer to the binary field name you configured. The n8n documentation also describes binary data and external storage for binary data.
3. Handle APIs that return JSON first
JSON with a screenshot URL
Keep the first HTTP Request node set to JSON so you can read the response fields. Map the returned URL into a second HTTP Request node’s URL, then set that second request’s response format to File and choose a binary field name. Check whether the URL is public, signed, temporary, or requires authorization. Use the provider’s documented authentication rules; credentials for the first request are not automatically appropriate for every download URL.
JSON with base64 image content
Keep the response as JSON until you have identified the exact field and encoding documented by the provider. Then use an n8n file or binary conversion operation to decode that field into binary data. Confirm whether the value is plain base64 or a data URL that includes a prefix such as a media type and encoding marker. Remove a prefix only when the provider’s format calls for it. Do not send the encoded text directly to an image viewer as though it were a PNG file.
JSON with an asynchronous job or status
An initial JSON response may confirm that work was accepted rather than contain the image. Follow the API’s documented process: wait or poll using the job identifier, check for the documented completion state, and then retrieve the image or result URL. Avoid assuming a fixed delay or status-field name without consulting that API’s documentation.
4. Example: request a screenshot with ScreenshotNeo
ScreenshotNeo is a website screenshot API and MCP server. Its screenshot endpoint returns a screenshot from one GET request; the example below saves the response body as a file. For endpoint parameters and options, see the ScreenshotNeo API documentation.
cURL
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Python
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)
Node.js
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
n8n HTTP Request node
- Create an HTTP Request node with method GET and URL
https://api.screenshotneo.com/v1/shot. - Add query parameters
access_keyandurl. Set the key to your API key and the URL to the website to capture. - Set Response Format to File and set the binary output field name, for example
data. - Run the node and connect its binary field to a downstream node that accepts files.
Keep API keys in n8n credentials or another appropriate secret store rather than embedding them in shared workflow exports. Use the endpoint’s response and headers to diagnose unsuccessful captures.
5. Troubleshooting checklist
| Symptom | Likely cause | Fix |
|---|---|---|
| The output is a JSON object. | The node is set to JSON, or the API itself returned JSON. | Set the node to File only if the endpoint returns image bytes. Otherwise handle the URL, base64, or job response as documented by the provider. |
| The node is set to File, but the result is not a usable image. | The server may have returned an error body, JSON, or another non-image response. | Inspect status, headers, and body. Confirm the endpoint, parameters, authentication, and documented success response. |
| A later node says the binary field is missing. | The output field name differs from the name referenced downstream, or the request did not produce a file. | Use the same binary field name in both nodes and verify that the HTTP Request execution contains binary output. |
| The download request returns an authorization error. | The returned URL may require authentication, or credentials were not passed to the second request. | Check the provider’s rules for temporary or signed URLs and apply the documented authentication to the download step. |
| The JSON response contains a job ID but no image. | The capture is asynchronous and has not reached its completion step. | Use the provider’s documented polling or completion process, then download the result if required. |
| The file is created but cannot be opened as an image. | The body may be an error payload, the wrong field may have been decoded, or base64 may have been handled as plain text. | Check the response status and content type; verify the field and encoding against the API documentation. |
| The UI does not show the same response-format labels. | Your installed n8n version may expose different labels or node options. | Check the node’s version and its documentation. The cited V3 description is a rolling source, so labels may change. |
6. Reliability, performance, and cost considerations
For reliability, treat capture errors and asynchronous states as explicit workflow outcomes. Inspect the API’s documented status behavior, check the HTTP response before passing data to an image consumer, and handle missing files or failed downloads in the workflow. The research for this article does not identify a specific screenshot provider or publish comparative speed or reliability figures, so those should be evaluated against the endpoint and workload you actually use.
For performance, avoid downloading the same screenshot more than your workflow needs. If an API supports caching or bulk capture, consult its documentation and choose settings appropriate to freshness and request volume. Binary images consume workflow storage; n8n documents options for external binary storage for deployments that need it.
For cost, check the screenshot API’s billing rules for successful captures, retries, cached responses, and failed requests. n8n’s response format setting changes how data is represented; it does not change what the screenshot provider returned or its billing terms.
Or skip the browser setup
ScreenshotNeo can return the capture from one API call:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
Its clean-shot options accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots. Every feature is on every plan. Read the docs or sign up free for 1,000 screenshots a month, no card required.
FAQ
Does n8n convert a JSON screenshot response into an image when I select File?
No. File handles a response body that contains file bytes. If the endpoint returned JSON, follow the API’s documented URL, base64, or asynchronous-job flow.
Where does the downloaded screenshot appear in n8n?
In the binary output field configured on the HTTP Request node, such as data. Use that same field in downstream file-aware nodes.
Why do I see different response-format choices than the documentation?
Node options can differ by n8n version. Check your installed version and its corresponding node documentation; the cited V3 source may change over time.
Should I use JSON or File for an API that returns a URL?
Use JSON for the response containing the URL, then make a second request for that URL with its response format set to File if it serves the image bytes.


