Figma REST API for accessing design files, comments, components, and projects. Use this skill to read file contents, export images, manage comments, and integrate with Figma workspaces.
If requests fail, run zero doctor check-connector --env-name FIGMA_TOKEN or zero doctor check-connector --url https://api.figma.com/v1/me --method GET
All examples assume FIGMA_TOKEN is set.
Base URL: https://api.figma.com/v1
Get information about the authenticated user (no parameters needed):
curl -s "https://api.figma.com/v1/me" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '{id, email, handle, img_url}'
Retrieve complete file structure including frames, components, and styles.
Replace <file-key> with your actual file key from a Figma URL.
curl -s "https://api.figma.com/v1/files/<file-key>" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '{name, lastModified, version, document: .document.children[0].name}'
Retrieve specific nodes from a file by node IDs.
Replace <file-key> with your file key and <node-id> with actual node IDs (comma-separated for multiple, e.g., 1:2,1:3).
curl -s "https://api.figma.com/v1/files/<file-key>/nodes?ids=<node-id>" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '.nodes'
Node IDs can be found in the file structure or from the Figma URL ?node-id=X-Y parameter (convert - to :).
Export nodes as images in PNG, JPG, SVG, or PDF format.
Replace <file-key> with your file key and <node-id> with actual node IDs.
curl -s "https://api.figma.com/v1/images/<file-key>?ids=<node-id>&format=png&scale=2" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '.images'
Parameters:
format: png, jpg, svg, pdf (default: png)scale: 0.5, 1, 2, 4 (default: 1)Get download URLs for all images used in a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/images" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '.meta.images'
List all comments on a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/comments" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '.comments[] | {id, message: .message, user: .user.handle, created_at}'
Add a comment to a file. Figma requires client_meta with a node_id to anchor the comment.
Replace <file-key> with your file key and <node-id> with an actual node ID.
Write to /tmp/figma_comment.json:
{
"message": "This looks great!",
"client_meta": {
"node_id": "<node-id>",
"node_offset": { "x": 0, "y": 0 }
}
}
curl -s -X POST "https://api.figma.com/v1/files/<file-key>/comments" --header "Authorization: Bearer $FIGMA_TOKEN" --header "Content-Type: application/json" -d @/tmp/figma_comment.json | jq '{id, message}'
List version history of a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/versions" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '.versions[] | {id, created_at, label, description, user: .user.handle}'
List all files in a project.
Replace <project-id> with your project ID. Project IDs can be found in Figma URLs or from team project listings.
curl -s "https://api.figma.com/v1/projects/<project-id>/files" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '.files[] | {key, name, last_modified}'
Get component sets (variants) in a file.
Replace <file-key> with your file key.
curl -s "https://api.figma.com/v1/files/<file-key>/component_sets" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '.meta.component_sets[] | {key, name, description}'
Get metadata for a specific component.
Replace <component-key> with your component key from the component sets output.
curl -s "https://api.figma.com/v1/components/<component-key>" --header "Authorization: Bearer $FIGMA_TOKEN" | jq '{key, name, description, containing_frame}'
Figma files have a hierarchical structure:
FILE
└── CANVAS (page)
├── FRAME
│ ├── RECTANGLE
│ ├── TEXT
│ └── GROUP
│ └── VECTOR
└── FRAME
└── COMPONENT
Common node types: CANVAS, FRAME, GROUP, VECTOR, BOOLEAN_OPERATION, STAR, LINE, ELLIPSE, REGULAR_POLYGON, RECTANGLE, TEXT, SLICE, COMPONENT, COMPONENT_SET, INSTANCE
/v1/me: Always verify auth first before calling other endpoints/design/<file-key>/...)X:Y (e.g., 1:2) — in URLs they appear as X-Y, convert - to :next_page in responses