To export candidate data to Google Sheets, you need to set up Google Service Account credentials.
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Sheets API and Google Drive API
- Go to IAM & Admin > Service Accounts
- Click Create Service Account
- Enter a name (e.g., "LinkedIn Sourcing Agent")
- Click Create and Continue
- Skip role assignment (click Continue)
- Click Done
- Click on your newly created service account
- Go to Keys tab
- Click Add Key > Create New Key
- Select JSON format
- Download the file and save it as
service_account.jsonin your project directory
For each Google Sheet you want to write to:
- Open the Google Sheet
- Click Share
- Add the service account email (from the JSON file)
- Give it Editor permissions
Add this to your .env file:
GOOGLE_SERVICE_ACCOUNT_FILE=service_account.json
python linkedin_agent.py search --query "python developer" --sheets-name "Python Developers 2025" --share-email your@email.compython linkedin_agent.py export --input candidates.json --sheets "Organized Candidates" --include-analytics --include-messagespython linkedin_agent.py search --query "ML engineer" --excel-file ml_engineers.xlsx --sheets-name "ML Engineers 2025"The exported Google Sheet will contain these organized tabs:
- Candidates - Main candidate information
- Contact_Info - Contact details and social profiles
- Experience_Education - Work history and education
- Skills_Scoring - Skills and fit scores
- Multi_Source_Data - GitHub, Twitter, website data
- Generated_Messages - AI-generated outreach messages
- Analytics - Summary statistics and insights
- Summary - Export metadata and top candidates
- Make sure the service account email is added to the Google Sheet with Editor permissions
- Check that the Google Sheets API is enabled in your Google Cloud project
- Ensure
service_account.jsonis in the correct directory - Update the
GOOGLE_SERVICE_ACCOUNT_FILEpath in your.envfile
- Install required packages:
pip install gspread google-auth pandas openpyxl