Instagram Graph API Documentation

Build and grow your business with Instagram

Overview

The Instagram Graph API allows businesses to manage their presence on Instagram. With the API, you can get access to and manage your Instagram Business or Creator Account, and publish content.

Note: The Instagram Graph API is only available for Instagram Business and Creator Accounts. Personal accounts are not supported.

Key Features

Getting Started

  1. Ensure you have an Instagram Business or Creator Account
  2. Create a Facebook App and configure Instagram Basic Display
  3. Generate an access token
  4. Make API calls using the access token
Create a Facebook App

Authentication

The Instagram Graph API uses OAuth 2.0 for authentication. You'll need to obtain an access token to make API calls.

Access Token

GET /oauth/access_token
  ?client_id={app-id}
  &redirect_uri={redirect-uri}
  &scope=instagram_basic,instagram_content_publish
  &response_type=code

Once you have the code, exchange it for a long-lived access token:

GET /oauth/access_token
  ?client_id={app-id}
  &client_secret={app-secret}
  &grant_type=authorization_code
  &redirect_uri={redirect-uri}
  &code={code}

Core API Endpoints

GET /{ig-user-id}

Retrieve information about an Instagram Business or Creator Account

GET /{ig-user-id}?fields=id,username,website,followers_count,media_count
Host: graph.facebook.com
Authorization: Bearer {access-token}

GET /{ig-user-id}/media

Retrieve a list of Instagram Media objects on an Instagram Business or Creator Account

GET /{ig-user-id}/media?fields=id,caption,media_type,media_url,permalink,thumbnail_url,timestamp,username
Host: graph.facebook.com
Authorization: Bearer {access-token}

POST /{ig-user-id}/media

Create a new Instagram Media object

POST /{ig-user-id}/media
Host: graph.facebook.com
Authorization: Bearer {access-token}

image_url={image-url}
caption={caption}

Rate Limits

The Instagram Graph API has rate limits to ensure fair usage across all developers. These limits are subject to change.

API Call Rate Limit
GET requests 200 calls per user per hour
POST requests 25 calls per user per hour
Business Discovery 30 unique businesses per user per hour

Note: Exceeding these rate limits will result in API errors. Implement proper error handling and respect these limits in your applications.

Webhooks

Instagram Graph API supports webhooks for real-time updates. You can subscribe to the following topics:

To set up webhooks, you need to configure your app in the Facebook Developers portal and implement a webhook endpoint in your server.

Best Practices

Support and Resources