Instagram Tool
Scrape Instagram profiles and posts with a simple, unified interface. Works with individual user profiles and hashtags.
Quick Start
import { InstagramTool } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new InstagramTool({
operation: 'scrapeProfile',
credentials: {
[CredentialType.APIFY_CRED]: process.env.APIFY_CRED as string,
},
}).action();
Operation Details
execute
- Input Schema
- Output Schema
operation'scrapeProfile' | 'scrapeHashtag' required- Operation to perform: scrapeProfile for user profiles, scrapeHashtag for hashtag posts
profilesstring[]- Instagram usernames or profile URLs to scrape (for scrapeProfile operation). Examples: ["@username", "https://www.instagram.com/username/"]
hashtagsstring[]- Hashtags to scrape (for scrapeHashtag operation). Examples: ["ai", "tech"] or ["https://www.instagram.com/explore/tags/ai"]
limitnumber- Maximum number of posts to fetch (default: 20 for profiles, 50 for hashtags)
credentialsRecord<CredentialType,string>- Required credentials (auto-injected)
operation'scrapeProfile' | 'scrapeHashtag' required- Operation that was performed
postsobject[] required- Array of Instagram posts scraped
profilesobject[]- Profile information for each scraped profile (only for scrapeProfile operation)
scrapedHashtagsstring[]- List of hashtags that were scraped (only for scrapeHashtag operation)
scrapedProfilesstring[]- List of profile usernames that were scraped (only for scrapeProfile operation)
totalPostsnumber required- Total number of posts scraped
successboolean required- Whether the operation was successful
errorstring required- Error message if operation failed