Spaces:
Sleeping
Download LINKEDIN_INTEGRATION.md from StrategyStack/README: direct link, hf CLI and curl.
- Browser
- Download file 7.47 kB
-
https://huggingface.co/spaces/StrategyStack/README/resolve/main/LINKEDIN_INTEGRATION.md
- Command line
-
hf download hf://spaces/StrategyStack/README/LINKEDIN_INTEGRATION.md
-
curl -L -o LINKEDIN_INTEGRATION.md https://huggingface.co/spaces/StrategyStack/README/resolve/main/LINKEDIN_INTEGRATION.md
A newer version of the Gradio SDK is available: 6.32.0
LinkedIn Data Integration Guide
π Quick Setup (5 Minutes)
This guide shows you how to integrate LinkedIn profile data into StrategyStack using RapidAPI's free tier.
Step 1: Get Your Free API Key
- Sign up on RapidAPI (free, no credit card): https://rapidapi.com
- Search for "Fresh LinkedIn Profile Data"
- Subscribe to FREE tier (50 requests/month)
- Copy your API key from the dashboard
Step 2: Add API Key to Spaces
- Go to Settings tab in this Space
- Scroll to Variables and secrets
- Click New secret
- Name:
RAPIDAPI_KEY - Value: Paste your API key
- Click Save
Step 3: What You Get
Free Tier (No Credit Card Required)
- β 50 requests per month
- β 1000 requests per hour rate limit
- β Full profile data access
- β 1-2 second response time
Profile Data Includes:
- Full name, profile photo URL
- Current title & company
- Complete work history
- Education background
- Skills & endorsements
- Location, connections count
- Profile summary/bio
- LinkedIn profile URL
Implementation Details
The integration is already built into the app via linkedin_data.py:
import requests
import os
def fetch_linkedin_profile(profile_url: str) -> dict:
"""Fetch LinkedIn profile data using RapidAPI"""
api_key = os.getenv('RAPIDAPI_KEY')
url = "https://fresh-linkedin-profile-data.p.rapidapi.com/get-linkedin-profile"
headers = {
"x-rapidapi-key": api_key,
"x-rapidapi-host": "fresh-linkedin-profile-data.p.rapidapi.com"
}
response = requests.get(url, headers=headers, params={"linkedin_url": profile_url})
if response.status_code == 200:
return response.json()
return None
Usage in Dashboard
Once configured, the dashboard automatically enriches lead data:
Before Enrichment:
lead = {
"contact_id": "c123",
"linkedin_url": "https://linkedin.com/in/username"
}
After Enrichment:
lead = {
"contact_id": "c123",
"linkedin_url": "https://linkedin.com/in/username",
"full_name": "John Doe",
"headline": "CEO at Tech Company",
"location": "San Francisco, CA",
"current_company": "Tech Company",
"current_title": "Chief Executive Officer",
"experience": [...],
"education": [...],
"skills": ["Leadership", "Strategy", ...]
}
Cost & Scaling
Free Tier Strategy
50 requests/month is perfect for:
- Initial demo and testing
- 1-2 pilot customers
- Enriching your "hottest" leads only
- Development environment
Best Practices:
- Cache enriched profiles (stored in user's
/datadirectory) - Only enrich leads with high engagement
- Don't re-fetch same profile repeatedly
- Use strategically for key decision-makers
When to Upgrade
Pro Plan: $50/month
- 20,000 requests/month (~650/day)
- Perfect for 5-10 active customers
- Small-medium outreach campaigns
Ultra Plan: $200/month
- 100,000 requests/month (~3,300/day)
- 10-20 active customers
- Large-scale campaigns
Mega Plan: $500/month
- 500,000 requests/month (~16,600/day)
- Enterprise scale
- Unlimited customers
Legal & Compliance
What's Legal β
- Scraping public LinkedIn data (hiQ Labs v. LinkedIn precedent)
- Using for B2B lead enrichment
- Caching data for business purposes
- Providing value-added services to customers
Best Practices β οΈ
- Use only for legitimate business purposes
- Don't resell raw LinkedIn data
- Respect privacy laws (GDPR, CCPA)
- Provide data opt-out mechanisms
- Be transparent with customers about data sources
What to Avoid β
- Selling scraped data to third parties
- Storing sensitive personal data unnecessarily
- Excessive scraping (respect rate limits)
- Mixing with breached/unauthorized data
Testing Your Integration
Test Profile URLs:
https://linkedin.com/in/williamhgates
https://linkedin.com/in/jeffweiner08
https://linkedin.com/in/satyanadella
Quick Test:
- Add your
RAPIDAPI_KEYto Spaces Secrets - Restart the Space
- Go to "Consent/Event Audit" tab
- Add a contact with a LinkedIn URL
- Click "Refresh Data"
- See enriched profile information!
Troubleshooting
"API Key Not Found" Error
Solution:
- Verify
RAPIDAPI_KEYis in Spaces Secrets - Check spelling (case-sensitive)
- Restart Space after adding secret
"Rate Limit Exceeded" Error
Solution:
- You've used your 50 free requests this month
- Wait until next month or upgrade plan
- Implement caching to reduce requests
"Invalid Profile URL" Error
Solution:
- Use full LinkedIn URL:
https://linkedin.com/in/username - Remove trailing slashes
- Ensure profile is public
Slow Response Times
Solution:
- First request may take 2-3 seconds (normal)
- Implement local caching for repeat requests
- Consider background job queue for bulk enrichment
Alternative Options
If You Need More Than 50/Month:
Option 1: User OAuth
- Have users connect their own LinkedIn
- Zero API costs
- Legal and compliant
- Already supported in this app!
Option 2: Multiple RapidAPI Accounts
- Rotate between 2-3 free accounts
- 150 requests/month total
- Good for early stage
Option 3: Upgrade to Paid
- $50/month gets you 20,000 requests
- Worth it once you have 3+ paying customers
Advanced Features
Caching Implementation
def get_cached_or_fetch(linkedin_url: str) -> dict:
cache_file = f"/data/linkedin_cache/{hash(linkedin_url)}.json"
if os.path.exists(cache_file):
with open(cache_file, 'r') as f:
return json.load(f)
profile = fetch_linkedin_profile(linkedin_url)
if profile:
os.makedirs(os.path.dirname(cache_file), exist_ok=True)
with open(cache_file, 'w') as f:
json.dump(profile, f)
return profile
Bulk Enrichment
def enrich_lead_list(leads: list) -> list:
enriched = []
for lead in leads:
if 'linkedin_url' in lead:
profile = fetch_linkedin_profile(lead['linkedin_url'])
if profile:
lead.update(profile)
enriched.append(lead)
return enriched
Support & Resources
RapidAPI Documentation:
API Response Format:
{
"full_name": "John Doe",
"headline": "CEO at Company",
"location": "San Francisco, CA",
"summary": "Experienced leader...",
"experiences": [
{
"title": "CEO",
"company": "Company Name",
"start_date": "2020-01",
"end_date": null,
"description": "..."
}
],
"education": [...],
"skills": [...]
}
Need Help?
- Check RapidAPI support: https://rapidapi.com/support
- Review HF Spaces docs: https://huggingface.co/docs/hub/spaces
- Contact StrategyStack support via Space discussions
Summary
β Free tier available (50 requests/month, no credit card) β 5-minute setup (sign up, get key, add to Secrets) β Already integrated into the app (just add API key) β Legal & compliant (public data only) β Scales with you (upgrade when ready)
Get started now: https://rapidapi.com
Last Updated: November 6, 2025 Integration Status: β Ready to use - just add API key! Free Tier: 50 requests/month | Paid: From $50/month