To export a Figma frame or layer from code, call GET https://api.figma.com/v1/images/{file_key} with the node ID in ids. Authenticate with a personal access token or OAuth2 token that has file_content:read, and make sure that token can access the file. Figma returns a temporary image URL for each rendered node; download the image from that URL rather than treating it as a permanent asset.
What you need before making the request
- The file key: the identifier in the Figma file URL.
- The node ID: the frame or layer you want to export. A shared design URL may show it as
node-id=12-34; the API form is commonly12:34. - API access: a personal access token or OAuth2 token with the
file_content:readscope, plus permission to access that particular file.
The endpoint renders selected nodes from a Figma file; it is not a browser screenshot of the Figma editor. You do not need to open a browser to render a node. The endpoint is GET /v1/images/{file_key}.
Find the file key and node ID
For a URL shaped like https://www.figma.com/design/FILE_KEY/File-name?node-id=12-34, use the segment in place of FILE_KEY and convert the node-ID separator to the API spelling when needed. For example, the URL value 12-34 is sent as 12:34. If you are exporting a different frame, select that frame in Figma and use its node ID rather than the file’s key or page name.
Make a PNG request with cURL
Set the token in an environment variable so it is not written into the command itself. This request asks for a two-times PNG render of node 12:34:
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
export FIGMA_TOKEN="YOUR_PERSONAL_ACCESS_TOKEN"
curl -G "https://api.figma.com/v1/images/FILE_KEY"
-H "X-Figma-Token: $FIGMA_TOKEN"
--data-urlencode "ids=12:34"
--data-urlencode "format=png"
--data-urlencode "scale=2"
Replace FILE_KEY and 12:34 with values from your file and target node. The response is JSON, not the PNG bytes themselves: find the URL under images for the requested node, then make a second HTTP request to that URL and save its response as an image.
Download the returned image in code
These examples check the API response and the requested node’s map entry before downloading. Keep the temporary URL in memory for the immediate download; do not use it as a durable asset URL.
Python
import os
import requests
file_key = "FILE_KEY"
node_id = "12:34"
token = os.environ["FIGMA_TOKEN"]
response = requests.get(
f"https://api.figma.com/v1/images/{file_key}",
headers={"X-Figma-Token": token},
params={"ids": node_id, "format": "png", "scale": 2},
timeout=60,
)
response.raise_for_status()
payload = response.json()
image_url = payload.get("images", {}).get(node_id)
if image_url is None:
raise RuntimeError(f"Figma did not render node {node_id}: {payload}")
image_response = requests.get(image_url, timeout=60)
image_response.raise_for_status()
with open("figma-frame.png", "wb") as image_file:
image_file.write(image_response.content)
Install the Python dependency with python -m pip install requests. Set FIGMA_TOKEN in the process environment before running the script.
Rank #2
Node.js
const fileKey = 'FILE_KEY';
const nodeId = '12:34';
const token = process.env.FIGMA_TOKEN;
if (!token) throw new Error('Set FIGMA_TOKEN before running this script.');
async function main() {
const endpoint = new URL(`https://api.figma.com/v1/images/${fileKey}`);
endpoint.search = new URLSearchParams({
ids: nodeId,
format: 'png',
scale: '2',
});
const renderResponse = await fetch(endpoint, {
headers: { 'X-Figma-Token': token },
});
if (!renderResponse.ok) {
throw new Error(`Figma render request failed: HTTP ${renderResponse.status} ${await renderResponse.text()}`);
}
const payload = await renderResponse.json();
const imageUrl = payload.images?.[nodeId];
if (!imageUrl) throw new Error(`Figma returned no image for ${nodeId}`);
const imageResponse = await fetch(imageUrl);
if (!imageResponse.ok) {
throw new Error(`Image download failed: HTTP ${imageResponse.status}`);
}
const imageBytes = Buffer.from(await imageResponse.arrayBuffer());
const { writeFile } = await import('node:fs/promises');
await writeFile('figma-frame.png', imageBytes);
}
main().catch(error => {
console.error(error);
process.exitCode = 1;
});
Run this with a Node.js version that provides the built-in fetch API, and set FIGMA_TOKEN in the environment. The URL parameters are encoded by URLSearchParams, including the colon in the node ID.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Choose the render parameters
Start with the smallest set of options that meets your output requirement. The ids value accepts comma-separated node IDs, so related frames can be requested together and returned as separate entries in the response map.
| Parameter | What it controls | When to use it |
|---|---|---|
ids |
One or more node IDs to render. | Select a frame or request several nodes in one API call. |
format |
jpg, png, svg, or pdf. |
PNG is a common choice for a screenshot. Use SVG when vector output and selectable content matter; use PDF when the deliverable should be a document. |
scale |
A numeric scale factor from 0.01 through 4. |
Increase it for more pixels, but account for the export pixel limit and larger downloads. |
version |
The file version to render. | Pass a version ID when a repeatable render of a specific file revision matters; omit it to render the current version. |
contents_only |
Whether output is limited to node contents; defaults to true. |
Set it to false when overlapping content should be included, with potentially longer processing. |
use_absolute_bounds |
Whether the full node dimensions, including empty surrounding space, are used. | Useful for text nodes or layouts where surrounding whitespace must be retained. |
PNG or SVG?
PNG is a practical raster image for documentation, tickets, and previews. SVG keeps vector information, but text treatment affects whether text remains selectable: outlining text favors visual consistency, while retaining text elements can render differently between viewers. For an SVG export, the endpoint also supports svg_outline_text, svg_include_id, svg_include_node_id, and svg_simplify_stroke; choose these based on whether visual fidelity, inspectability, or compactness matters.
Rank #3
Scale and export size
The scale factor changes rendered pixel dimensions, and an export cannot exceed Figma’s stated 32-megapixel limit: larger output is scaled down. A higher scale is therefore not a guarantee of proportionally larger final dimensions. If you need predictable output, verify the image dimensions after download and adjust the requested scale or node bounds.
Handle the response and keep the image
A successful API response contains an images object keyed by the requested node IDs. Check both the HTTP status and the entry for every ID: an individual map value can be null, for instance when the ID is invalid or the node has no renderable content. With a multi-node request, handle each entry independently so one failed node does not silently pass as a successful batch.
The returned image URL is temporary. Figma says, “The image assets will expire after 30 days.” Download the bytes promptly and store them in your own asset storage if they need to remain available. A cached URL or one copied into a long-lived page should not be treated as a permanent file location.
Rank #4
Troubleshoot failed renders
| Symptom | Likely cause | What to check |
|---|---|---|
| HTTP 401 | The token is missing, invalid, or not being sent in the expected header. | Send X-Figma-Token with a valid personal access token or OAuth2 token. Check that the environment variable is populated without printing the secret into logs. |
| HTTP 403 | The token lacks the required permission or the caller cannot access the file. | Confirm file_content:read is granted and that the authenticated account has access to the target file. |
| HTTP 404 | The file key or endpoint path is wrong, or the file is unavailable to the caller. | Copy the key from the file URL and check that it occupies the path segment after /v1/images/. |
| HTTP 500 | The render service returned a server error. | Record the status and response body, retry with the same inputs after a short delay, and avoid treating the failed response as an image result. |
HTTP success but a null image entry |
The requested node did not render; an incorrect ID or a node without renderable content are possible causes. | Check the exact node ID and confirm you selected the intended frame or layer. Inspect each map value when multiple IDs were sent. |
| Image URL no longer works | The temporary asset link expired or is otherwise unavailable. | Make a fresh render request and download its result rather than reusing the old URL. |
| Output is smaller than expected | The scale request or pixel limit constrained the resulting dimensions. | Check the node’s bounds and downloaded image dimensions; lower expectations if the requested export exceeds the maximum pixel area. |
Performance, repeatability, and cost considerations
Figma’s render endpoint returns a URL instead of embedding image bytes in the JSON response, so a complete export entails the render request and a separate download. For a batch of frames, using comma-separated IDs reduces the number of render requests, but your code still needs to inspect and download each successful map entry. If output must match a known design revision, pass version; otherwise, leaving it out selects the current file state and later runs may reflect subsequent edits.
Choose output bounds and scale deliberately: unnecessary pixel area increases download size and may reach the export ceiling without adding usable detail. Figma’s cited endpoint documentation does not state a per-request price or a numeric latency guarantee here, so do not assume a particular render time or cost from the response format alone. Implement timeouts, status checks, and retry handling for transient failures according to your application’s needs.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
The Figma endpoint above exports a design node. ScreenshotNeo is a different tool: a website screenshot API and MCP server. It does not replace the Figma node-render endpoint or turn a private Figma file key and node ID into a render. Use it when the thing you need to capture is a web page URL, such as a publicly accessible prototype page, rather than an API-selected design node.
Best Value
For a website URL, one GET request returns an image or PDF; for example, this cURL request captures the sample page as WebP:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Before capture, it can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for AI agents using Claude, Cursor, or another MCP client. The 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 to try it without a card.
Frequently Asked Questions
Can I use the Figma images endpoint to change the design file?
No. It renders selected nodes for export; it is not a file-editing endpoint.
Can a single request return several frame images?
Yes. Supply comma-separated node IDs in `ids`, then process the corresponding entries in the `images` object independently.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteDoes ScreenshotNeo render a Figma node ID?
No. ScreenshotNeo captures web page URLs; use Figma’s images endpoint when you need a node selected by file key and node ID.
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.




