Skip to content

imjustbackup/insta-scoop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Insta Scoop

A lightweight and framework-agnostic package to fetch Instagram media (reels, posts, videos, etc.) using the Instagram Graph API. Simply provide your account_id and access_token to retrieve all media content from your account effortlessly. Caching is supported to reduce API requests and improve performance.

Installation

npm install insta-scoop

Usage

1. Create a .env file

Store your credentials securely in a .env file:

INSTAGRAM_ACCOUNT_ID=your-instagram-id
INSTAGRAM_ACCESS_TOKEN=your-access-token

2. Use the package in your code

import { getInstagramMedia } from "insta-scoop";
import dotenv from "dotenv";

dotenv.config();

const accountId = process.env.INSTAGRAM_ACCOUNT_ID;
const accessToken = process.env.INSTAGRAM_ACCESS_TOKEN;

async function getInstagramData() {
	try {
		const media = await getInstagramMedia({ accountId, accessToken });
		console.log(media);
	} catch (error) {
		console.error("Error fetching Instagram data:", error);
	}
}

getInstagramData();

How to Retrieve account_id and access_token

1. Create a Facebook Developer App

2. Set Up Instagram API

  • Once your app is created, navigate to the Dashboard
  • Click on Instagram and press Set Up

3. Link Your Instagram Account

  • Under the Generate Access Tokens section, click Add Account
  • Log in to the Instagram account you want to retrieve data from
  • After logging in, you will see a numeric account ID below the username. Save this value

4. Generate an Access Token

  • In the Access Token section, click Generate Token
  • Log in again to confirm and retrieve the generated token
  • Copy and store the access token securely

5. Verify the Access Token (Optional)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%