Overview
Provider: RapidAPI LinkedIn Scraper Data retrieved:- Guest name and headline
- Professional summary
- Career history (positions, companies, dates, descriptions)
- LinkedIn URL
Setup
Get RapidAPI key
- Sign up at https://rapidapi.com
- Subscribe to a LinkedIn scraper API
- Copy your API key from the dashboard
API endpoint
Scrape profile
Endpoint:POST /api/linkedin/profile
Request:
Usage in Pulse Content
Scrape guest profile
With Sanity caching
Force refresh
Caching strategy
Three-tier cache
In-memory cache
First check: Session-level cache (cleared on page refresh)Fastest: No network requestDuration: Until page refresh
Sanity cache
Second check: Database-persisted cacheFast: Single Sanity queryDuration: 24 hours from
scrapedAt timestampCache freshness check
Clear cache
LinkedIn URL validation
Supported formats
Extract from transcript
Transcript headers often include LinkedIn URLs:Career timeline generation
Generate prompt
Generate image
Data structure
LinkedInProfile
CareerPosition (Sanity)
GuestProfile (Sanity schema)
Link guest to episode
Error handling
Profile not found
Rate limit exceeded
Invalid LinkedIn URL
Network timeout
Cost management
RapidAPI pricing
LinkedIn scraper APIs typically charge per request:- Free tier: 10-50 requests per month
- Paid tiers: 500-5000+ requests per month
Reduce API calls
Best practices
- Always normalize URLs: Use
normalizeLinkedInUrl()before querying or caching - Check cache first: Avoid unnecessary API calls by checking Sanity cache
- Store in Sanity: Always upsert profile after successful scrape
- Link to episodes: Connect guest profiles to episodes via
guestRef - Handle errors gracefully: Show clear error messages for invalid URLs or rate limits
- Refresh manually: Provide “Refresh LinkedIn Data” button for users to force refresh
- Validate before scraping: Use
isValidLinkedInUrl()to catch invalid URLs early - Generate timelines async: Scrape profile and generate career timeline in background
Troubleshooting
API key invalid
RAPIDAPI_KEY is set correctly:
Profile data incomplete
Causes:- Guest has minimal LinkedIn profile
- Privacy settings restrict scraping
- Profile URL is incorrect
- Ask guest to update LinkedIn profile
- Manually enter career history
- Verify LinkedIn URL is correct
Scrape takes too long
Expected time: 3-10 seconds If longer:- RapidAPI service may be slow
- Network connectivity issues
- Increase timeout to 15-30 seconds