Skip to main content

Files

Get File Nodes

Returns specific nodes from a Figma file by their IDs.

Fetch specific nodes from a file without downloading the entire document tree. This is significantly faster for large files when you only need a subset of nodes.

GET https://api.figma.com/v1/files/:file_key/nodes

Authentication

Requires a valid access token with file_content:read scope. Pass via X-Figma-Token header (personal access token) or Authorization: Bearer header (OAuth).

Parameters

Path parameters

The key of the file. Find this in the Figma file URL: figma.com/design/:file_key/...

Query parameters

Comma-separated list of node IDs to retrieve. Node IDs use the format 1:23.

Example Request

curl -X GET "https://api.figma.com/v1/files/YOUR_FILE_KEY/nodes?ids=1:2,3:4&depth=2" \
  -H "X-Figma-Token: YOUR_TOKEN"

Response

{
  "name": "My Design File",
  "lastModified": "2024-01-15T10:30:00Z",
  "version": "456789",
  "nodes": {
    "1:2": {
      "document": {
        "id": "1:2",
        "name": "Button",
        "type": "COMPONENT",
        "children": []
      },
      "components": {},
      "styles": {}
    },
    "3:4": {
      "document": {
        "id": "3:4",
        "name": "Header",
        "type": "FRAME",
        "children": []
      },
      "components": {},
      "styles": {}
    }
  }
}

Response Fields

FieldTypeDescription
namestringThe file name
lastModifiedstringISO 8601 timestamp of the last edit
versionstringThe current version ID
nodesobjectMap of node IDs to their data
nodes[id].documentobjectThe node subtree for the requested node
nodes[id].componentsobjectComponent metadata referenced by nodes in the subtree
nodes[id].stylesobjectStyle metadata referenced by nodes in the subtree

Use this endpoint to build efficient design token extraction pipelines. Fetch only the style and component nodes you need instead of the full file.