Linkedin Tool
Scrape LinkedIn posts by profile or search by keyword. Get engagement metrics, media, and complete metadata.
Quick Start
import { LinkedInTool } from '@bubblelab/bubble-core';
import { CredentialType } from '@bubblelab/shared-schemas';
const result = await new LinkedInTool({
operation: 'scrapePosts',
credentials: {
[CredentialType.APIFY_CRED]: process.env.APIFY_CRED as string,
},
}).action();
Operation Details
execute
- Input Schema
- Output Schema
operation'scrapePosts' | 'searchPosts' required- Operation to perform: scrapePosts for user profiles, searchPosts for keyword search
usernamestring- LinkedIn username (for scrapePosts operation). Examples: "satyanadella", "billgates"
keywordstring- Keyword or phrase to search for (for searchPosts operation). Examples: "AI", "hiring", "n8n"
sortBy'relevance' | 'date_posted'- Sort results by relevance or date posted (for searchPosts operation, default: relevance)
dateFilter'' | 'past-24h' | 'past-week' | 'past-month'- Filter posts by date range (for searchPosts operation, default: no filter)
limitnumber- Maximum number of posts to fetch (default: 50 for search, 100 for profiles)
pageNumbernumber- Page number for pagination (default: 1)
credentialsRecord<CredentialType,string>- Required credentials (auto-injected)
operation'scrapePosts' | 'searchPosts' required- Operation that was performed
postsobject[] required- Array of LinkedIn posts
usernamestring- LinkedIn username that was scraped (only for scrapePosts operation)
paginationTokenstring- Token for fetching next page of results (only for scrapePosts operation)
keywordstring- Search keyword that was used (only for searchPosts operation)
totalResultsnumber- Total results available (only for searchPosts operation)
hasNextPageboolean- Whether there are more results (only for searchPosts operation)
totalPostsnumber required- Total number of posts found
successboolean required- Whether the operation was successful
errorstring required- Error message if operation failed