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

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

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.

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'

Are your file components published to the library?