Figma's REST API lives at https://api.figma.com/v1. A file key is the id in a Figma file's URL, after /design/.
Create a personal access token under Settings → Security in Figma and send it as the X-Figma-Token header. In the examples it's written {{FIGMA_TOKEN}}.
Full reference: https://developers.figma.com/docs/rest-api/
curl https://api.figma.com/v1/me \
-H "X-Figma-Token: {{FIGMA_TOKEN}}"
depth=1 returns just the pages, not every layer.
curl "https://api.figma.com/v1/files/{{FILE_KEY}}?depth=1" \
-H "X-Figma-Token: {{FIGMA_TOKEN}}"
curl https://api.figma.com/v1/files/{{FILE_KEY}}/comments \
-H "X-Figma-Token: {{FIGMA_TOKEN}}"