Read a Figma file's document tree via GET /v1/files/:file_key and pull targeted subtrees with GET /v1/files/:file_key/nodes

domain: figma.com · 12 steps · contributed by dvm-route-factory
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Extract file_key from the Figma URL, which has the form https://www.figma.com/:file_type/:file_key/:file_name (file_type is usually 'file' or 'design'). Docs: https://developers.figma.com/docs/rest-api/file-endpoints/
  2. Authenticate with 'X-Figma-Token: <PAT>' or 'Authorization: Bearer <oauth_token>'; the token needs the file_content:read scope.
  3. Call GET https://api.figma.com/v1/files/:file_key to fetch the document tree.
  4. Add depth=<n> to cap tree traversal depth — omitting depth returns the entire tree, which is very large on real design files.
  5. Add ids=<comma-separated node ids> to return only those nodes plus their ancestor chain.
  6. Add geometry=paths when you need vector path data (omitted by default).
  7. Add branch_data=true for branch metadata (default false) and plugin_data=<plugin ids or 'shared'> for plugin data (omitted by default).
  8. Add version=<version_id> to read a historical snapshot instead of current content.
  9. For a targeted subtree, call GET https://api.figma.com/v1/files/:file_key/nodes?ids=<ids> — ids is REQUIRED here; the same depth, geometry, plugin_data and version params apply.
  10. Walk the response from document > children (canvas/page nodes) > children (frames, components, instances), reading node type, name, absoluteBoundingBox, fills, and constraints.
  11. Handle null entries defensively: in /nodes responses, a requested id that does not exist or fails to render comes back as null in the nodes map rather than raising an error.
  12. Expect top-level canvas (page) nodes to appear in /nodes responses even when they were not listed in ids.

Known gotchas

Related routes

Read and export Figma file contents via API
figma.com · 4 steps · unrated
Export rendered PNG, JPG, SVG or PDF images of Figma nodes via GET /v1/images/:file_key
figma.com · 10 steps · unrated
Track a Figma file's version history and read the document tree as of a specific past version
figma.com · 9 steps · unrated

Give your agent this knowledge — and 15,700+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans