Get Started
Install and configure Instagram-Meta-Business-API-Handler
Install and configure Instagram-Meta-Business-API-Handler: A comprehensive TypeScript wrapper for Instagram Graph API. Manage posts, stories, comments, DMs, analytics and more with full type safety.
Follow the source instructions for Instagram-Meta-Business-API-Handler. Read the prerequisites and configuration steps before running an example.
Prerequisites
- Meta Business Account - Sign up at business.facebook.com
- Facebook App - Create at developers.facebook.com
- Instagram Business Account - Convert your Instagram account to Business
- Access Token - Generate long-lived access token
- Required Permissions:
instagram_basicinstagram_content_publishinstagram_manage_commentsinstagram_manage_insightsinstagram_manage_messages
Installation
npm install instagram-meta-handlerQuick Start
import InstagramHandler from 'instagram-meta-handler';
const instagram = new InstagramHandler({
accessToken: 'YOUR_ACCESS_TOKEN',
instagramBusinessAccountId: 'YOUR_IG_BUSINESS_ACCOUNT_ID',
version: 'v21.0' // optional, defaults to v21.0
});
// Post an image
const mediaId = await instagram.postImage(
'https://example.com/image.jpg',
'Amazing photo! #instagram'
);Media Requirements
Images
- Format: JPEG, PNG
- Max size: 8MB
- Min resolution: 320px
- Aspect ratio: 1.91:1 to 4:5
Videos
- Format: MP4, MOV
- Max size: 100MB
- Max length: 60 seconds (feed), 15 seconds (stories)
- Frame rate: 30fps max
- Audio: AAC, 128kbps
Stories
- Format: JPEG, PNG (image), MP4 (video)
- Max size: 100MB
- Duration: 15 seconds max (video)
- Aspect ratio: 9:16
Check the installation
After setup, continue with the first example. If a command fails, compare the runtime version, working directory, and required configuration with the original README before changing dependencies.
Source and help
Source captured: 2026-10-11
