Skip to main content

Files

Get File

Returns the document tree for a Figma file.

Returns the full document tree, including metadata, pages, and all nodes. For large files, consider using the Get File Nodes endpoint to fetch specific nodes.

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

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 to retrieve. You can find this in the Figma file URL: figma.com/file/:file_key/...

Optional

Example Request

curl -X GET "https://api.figma.com/v1/files/YOUR_FILE_KEY?depth=2" \
  -H "X-Figma-Token: YOUR_TOKEN"

Response

The document field contains the full node tree. Use the depth parameter to limit how much of the tree is returned, which can significantly reduce response size and latency.

{
  "name": "My Design File",
  "lastModified": "2024-01-15T10:30:00Z",
  "version": "456789",
  "document": {
    "id": "0:0",
    "name": "Document",
    "type": "DOCUMENT",
    "children": [
      {
        "id": "0:1",
        "name": "Page 1",
        "type": "CANVAS",
        "children": []
      }
    ]
  },
  "schemaVersion": 0,
  "thumbnailUrl": "https://s3-alpha.figma.com/thumbnails/..."
}

Response Fields

FieldTypeDescription
namestringThe file name
lastModifiedstringISO 8601 timestamp of the last edit
versionstringThe current version ID
documentobjectThe root node of the document tree
schemaVersionnumberSchema version for the file format
thumbnailUrlstringURL to the file thumbnail image