This is a Next.js project bootstrapped with create-next-app.
This project uses the Facebook Graph API which can only fetch data from your own Instagram Business Account. Unlike web scraping methods, you cannot fetch data from other users' profiles (like @virat.kohli). This is a limitation of the official API.
Add your credentials in .env.local:
FACEBOOK_PAGE_ACCESS_TOKEN=your_page_access_token_here
INSTAGRAM_BUSINESS_ACCOUNT_ID=your_instagram_business_account_id_here
How to get your credentials:
-
Page Access Token:
- Go to Facebook Developers
- Create or select your app
- Add "Instagram Graph API" product
- Generate a Page Access Token with
instagram_basicandpages_read_engagementpermissions
-
Instagram Business Account ID:
- Use Graph API Explorer
- Make a request to:
/me/accounts?fields=instagram_business_account - Copy the
instagram_business_account.idvalue
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.