I’m able to get an image with the image rest api (GET https://api.figma.com/v1/images/:key?ids=:node_id), but it doesn’t crop the result to the provided node id. Instead, it renders everything below the top layer the node is nested under.
This is what I receive from the api.
This is what I want from the api roughly.
Is it possible to get the desired result from this api, or do I need to explore alternatives? The node ids I’m using are derived from the url after clicking on the node in the figma viewer (www.figma.com/design/{file_id}/{file_name}?node-id={node_id}).