Skip to main content
Question

Fetch published variables via rest API

  • February 7, 2024
  • 1 reply
  • 654 views

I am trying to fetch all variables (names and color values) from Figma via two endpoints:

GET /v1/files/:file_key/variables/local
GET /v1/files/:file_key/variables/published

Both of them are currently in beta.
Via the local var endpoint everything works fine and I am able to fetch all var names and colors in this prop: “valuesByMode”

For the published endpoint on the other hand I am not able to fetch these values. The endpoint returns data, but somehow not color names and values. Also according to the api docs this doesnt seem to be intended and I am wondering why?
Am I overlooking something or is there any other way how to fetch Figma variables with names and values?

This topic has been closed for replies.

1 reply

Valstar_L.R_Ron

Looking at this issue as well. The documentation leaves a bit to be desired. Did you ever find a solution?
It looks as though variables set in ‘published’ are also set in ‘local’. So I’m guessing one should fetch both, and then match ‘local’ values to the ‘public’ keys.


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