Skip to main content
This guide uses an API key to list the Instagram accounts available to you, then reads metrics for one account.

Create an API key

  1. Open API key settings and sign in.
  2. Create a key with the metrics:read scope.
  3. Give the key access to the account you want to query.
  4. Copy the key when levios shows it. You cannot retrieve the secret later.
Keep the key outside your source code and never expose it in client-side code.

Set your environment variable

Store the key in your shell for this session:

List your accounts

Send the key as a Bearer credential:
Choose an id from the response and store it for the next request:

Read account metrics

Request the seven-day metrics window:
The response includes the selected window, KPI values, and up to five top automations.

Continue