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.
/plugin marketplace add vm0-ai/api0/plugin install api0@api0This skill inherits all available tools. When active, it can use any tool Claude has access to.
Access and manage design files, components, comments, and projects in Figma workspaces via REST API.
Official docs:
https://developers.figma.com/docs/rest-api/
Use this skill when you need to:
vm0-skills-test)figd_...)
export FIGMA_API_TOKEN="figd_..."
Test your token with this command:
bash -c 'curl -s -X GET "https://api.figma.com/v1/me" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq .
Expected response: Your user information (id, email, handle)
Figma file URLs contain the file key:
URL: https://www.figma.com/design/abc123XYZ/My-Design-File
File Key: abc123XYZ
The file key is the alphanumeric string between /design/ (or /file/) and the next /.
Important: When using
$VARin a command that pipes to another command, wrap the command containing$VARinbash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq .
All examples assume FIGMA_API_TOKEN is set.
Base URL: https://api.figma.com/v1
Retrieve complete file structure including frames, components, and styles:
FILE_KEY="abc123XYZ"
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '{name, lastModified, version, document: .document.children[0].name}'
Get specific version:
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}?version=123" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq .
Retrieve specific nodes from a file by node IDs:
FILE_KEY="abc123XYZ"
NODE_IDS="1:2,1:3"
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}/nodes?ids=${NODE_IDS}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.nodes'
Node IDs can be found in the file structure or by appending ?node-id=X-Y to the Figma URL.
Export nodes as images in PNG, JPG, SVG, or PDF format:
FILE_KEY="abc123XYZ"
NODE_IDS="1:2,1:3"
bash -c 'curl -s -X GET "https://api.figma.com/v1/images/${FILE_KEY}?ids=${NODE_IDS}&format=png&scale=2" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.images'
Parameters:
format: png, jpg, svg, pdf (default: png)scale: 0.5, 1, 2, 4 (default: 1)svg_outline_text: true to convert text to outlines in SVGsvg_include_id: true to include node IDs in SVGDownload an exported image:
IMAGE_URL="$(bash -c 'curl -s -X GET "https://api.figma.com/v1/images/${FILE_KEY}?ids=1:2&format=png" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq -r '.images["1:2"]')"
curl -s -o output.png "$IMAGE_URL"
Get download URLs for all images used in a file:
FILE_KEY="abc123XYZ"
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}/images" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.meta.images'
List all comments on a file:
FILE_KEY="abc123XYZ"
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}/comments" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.comments[] | {id, message: .message, user: .user.handle, created_at}'
Add a comment to a file:
FILE_KEY="abc123XYZ"
bash -c 'curl -s -X POST "https://api.figma.com/v1/files/${FILE_KEY}/comments" -H "X-Figma-Token: ${FIGMA_API_TOKEN}" -H "Content-Type: application/json" -d '"'"'{"message": "This looks great!", "client_meta": {"x": 100, "y": 200}}'"'"'' | jq .
To comment on a specific node, add client_meta with node coordinates.
Delete a comment by ID:
FILE_KEY="abc123XYZ"
COMMENT_ID="123456"
curl -s -X DELETE "https://api.figma.com/v1/files/${FILE_KEY}/comments/${COMMENT_ID}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"
List version history of a file:
FILE_KEY="abc123XYZ"
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}/versions" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.versions[] | {id, created_at, label, description, user: .user.handle}'
List all projects in a team:
TEAM_ID="123456"
bash -c 'curl -s -X GET "https://api.figma.com/v1/teams/${TEAM_ID}/projects" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.projects[] | {id, name}'
To find your team ID, go to your Figma team page and extract it from the URL: https://www.figma.com/files/team/123456/TeamName
List all files in a project:
PROJECT_ID="123456"
bash -c 'curl -s -X GET "https://api.figma.com/v1/projects/${PROJECT_ID}/files" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.files[] | {key, name, last_modified}'
Get all published components in a team:
TEAM_ID="123456"
bash -c 'curl -s -X GET "https://api.figma.com/v1/teams/${TEAM_ID}/components" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.meta.components[] | {key, name, description, containing_frame: .containing_frame.name}'
Get metadata for a specific component:
COMPONENT_KEY="abc123"
bash -c 'curl -s -X GET "https://api.figma.com/v1/components/${COMPONENT_KEY}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '{key, name, description, containing_frame}'
Get all published styles (colors, text, effects, grids) in a team:
TEAM_ID="123456"
bash -c 'curl -s -X GET "https://api.figma.com/v1/teams/${TEAM_ID}/styles" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.meta.styles[] | {key, name, description, style_type}'
Style types: FILL, TEXT, EFFECT, GRID
Get metadata for a specific style:
STYLE_KEY="abc123"
bash -c 'curl -s -X GET "https://api.figma.com/v1/styles/${STYLE_KEY}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '{key, name, description, style_type}'
Get information about the authenticated user:
bash -c 'curl -s -X GET "https://api.figma.com/v1/me" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '{id, email, handle, img_url}'
List all members of a team:
TEAM_ID="123456"
bash -c 'curl -s -X GET "https://api.figma.com/v1/teams/${TEAM_ID}/members" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.members[] | {id, email: .user.email, handle: .user.handle, role}'
Get component sets (variants) in a file:
FILE_KEY="abc123XYZ"
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}/component_sets" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.meta.component_sets[] | {key, name, description}'
Search for files in a team (requires team ID):
TEAM_ID="123456"
QUERY="button"
bash -c 'curl -s -X GET "https://api.figma.com/v1/teams/${TEAM_ID}/files?name=${QUERY}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.files[] | {key, name, last_modified}'
FILE_KEY="abc123XYZ"
# Get all frame IDs
FRAME_IDS="$(bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq -r '.document.children[0].children[] | select(.type=="FRAME") | .id' | paste -sd "," -)"
# Export frames
bash -c 'curl -s -X GET "https://api.figma.com/v1/images/${FILE_KEY}?ids=${FRAME_IDS}&format=png&scale=2" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.images'
FILE_KEY="abc123XYZ"
# Get color styles
bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq '.styles | to_entries[] | select(.value.styleType == "FILL") | {name: .value.name, key: .value.key}'
FILE_KEY="abc123XYZ"
# Get current version
CURRENT_VERSION="$(bash -c 'curl -s -X GET "https://api.figma.com/v1/files/${FILE_KEY}" -H "X-Figma-Token: ${FIGMA_API_TOKEN}"' | jq -r '.version')"
echo "Current version: $CURRENT_VERSION"
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
version parameter to access specific file versionsX:Y (e.g., 1:2) and must be URL-encoded in some endpointsnext_page in responses