figmalisted
Install: claude install-skill Makiya1202/ai-agents-skills
# Figma API Integration
Extract design data, generate code from components, and automate design workflows with Figma's API.
## Quick Start
### Authentication
```typescript
const FIGMA_TOKEN = process.env.FIGMA_TOKEN;
const headers = {
'X-Figma-Token': FIGMA_TOKEN
};
// Get file
const response = await fetch(
`https://api.figma.com/v1/files/${FILE_KEY}`,
{ headers }
);
```
### File Key & Node IDs
```typescript
// Extract from Figma URL: figma.com/file/FILE_KEY/Name?node-id=NODE_ID
const figmaUrl = 'https://www.figma.com/file/abc123/MyDesign?node-id=1%3A2';
const fileKey = figmaUrl.match(/file\/([^/]+)/)?.[1]; // abc123
const nodeId = new URL(figmaUrl).searchParams.get('node-id'); // 1:2
```
## Core API Endpoints
### Get File
```typescript
// Full file
GET https://api.figma.com/v1/files/:file_key
// Specific nodes (components)
GET https://api.figma.com/v1/files/:file_key/nodes?ids=1:2,1:3
// With geometry for SVG paths
GET https://api.figma.com/v1/files/:file_key?geometry=paths
// With plugin data
GET https://api.figma.com/v1/files/:file_key?plugin_data=shared
```
### Get Components
```typescript
// Get all components in a file
GET https://api.figma.com/v1/files/:file_key/components
// Get component sets (variants)
GET https://api.figma.com/v1/files/:file_key/component_sets
// Get team's published components
GET https://api.figma.com/v1/teams/:team_id/components
```
### Export Images
```typescript
// Export nodes as images
GET https://api.figma.com/v1/imag