Skip to main content
Solved

How do I get figma assets, components & variants via Rest API

  • September 7, 2021
  • 3 replies
  • 4610 views

Nalin_Agrawal

I am trying to fetch information about variants of a component. Which node returns that info.

Is it a different endpoint?
I tried GET team Components, GET file components. Both return an empty array. GET file does not seem to return any information about variants.

Thanks

Best answer by Gleb

GET file returns all file data, including the components and component sets that are in this file. You just need to find them in the file structure.

View original

3 replies

Gleb
  • Power Member
  • 4706 replies
  • Answer
  • September 7, 2021

GET file returns all file data, including the components and component sets that are in this file. You just need to find them in the file structure.


RachelFranklin

I already use the approach mentioned by @Gleb but it is laborious and expensive when searching through large files, so was excited to see there is a dedicated endpoint for retrieving a file’s components.

However, I’m having the same issue as @Nalin_Agrawal - the file components endpoint keeps returning an empty array. Has anyone seen this before, and managed to resolve it?

This is the structure of my request:

curl -H 'X-FIGMA-TOKEN: <my-auth-token>' 'https://api.figma.com/v1/files/6HQRQOxFtpc8mppUXgcgLz/components'

Gleb
  • Power Member
  • 4706 replies
  • May 23, 2022

Are your file components published to the library?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings