Automatically reads incoming job application emails and adds/updates them in your Notion database. Uses ChatGPT to intelligently identify job-related emails and extract relevant information.
- ✅ Automatically identifies job application emails
- ✅ Extracts job details (role, organization, status, date, job description link)
- ✅ Checks if job already exists in Notion to avoid duplicates
- ✅ Updates existing entries or creates new ones
- ✅ Supports status tracking: Applied, Interview, Rejected
- ✅ Marks processed emails as read
- Gmail Account - The script uses Gmail API to read emails
- Notion Account with:
- A database set up with the required properties (see setup instructions)
- A Notion API integration token
- OpenAI API Key - For analyzing emails
pip install -r requirements.txt- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Gmail API:
- Navigate to "APIs & Services" > "Library"
- Search for "Gmail API" and enable it
- Configure OAuth Consent Screen:
- Go to "APIs & Services" > "OAuth consent screen"
- Choose "External" (unless you have a Google Workspace, then choose "Internal")
- Fill in the required fields:
- App name: JappTracker (or any name)
- User support email: Your email
- Developer contact information: Your email
- Click "Save and Continue"
- On "Scopes" page, click "Save and Continue" (no need to add scopes here)
- On "Test users" page, ADD YOUR GMAIL EMAIL ADDRESS as a test user
- Click "+ ADD USERS"
- Enter your Gmail address
- Click "Add"
- Click "Save and Continue"
- Create credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth client ID"
- Choose "Desktop app" as the application type
- Name it (e.g., "JappTracker Desktop Client")
- Click "Create"
- Download the credentials file and save it as
credentials.jsonin this directory
-
Create a new database in Notion (or use an existing one)
-
Add the following properties to your database:
Property Name Type Description Number Number Sequential ID for each application Role Title Job title/role name Organization Rich Text Company/organization name Job description URL Link to job description Status Select Options: Applied, Interview, Rejected Date Date Date of application Notes Rich Text Optional notes (can be left empty) -
Get your Database ID:
- Open your Notion database in a web browser
- The URL will look like:
https://www.notion.so/workspace/DATABASE_ID?v=... - Copy the
DATABASE_IDpart (32 characters, with hyphens)
-
Create a Notion Integration:
- Go to https://www.notion.so/my-integrations
- Click "New integration"
- Give it a name (e.g., "JappTracker")
- Select your workspace
- Copy the "Internal Integration Token"
- Go to your database, click the "..." menu, and "Add connections" to connect your integration
Create a .env file in this directory:
# OpenAI API Key
OPENAI_API_KEY=your_openai_api_key_here
# Notion Configuration
NOTION_API_KEY=your_notion_integration_token_here
NOTION_DATABASE_ID=your_database_id_hereWhen you run the script for the first time, it will:
- Open a browser window for Gmail authentication
- Ask you to sign in and authorize the application
- Save your credentials to
token.jsonfor future use
Run the script:
python job_application_tracker.pyThe script will:
- Fetch unread emails from your Gmail inbox
- Use ChatGPT to identify job application emails
- Extract relevant information (role, organization, status, etc.)
- Check if the job already exists in your Notion database
- Create a new entry or update an existing one
- Mark processed emails as read
You can also import and use it as a module:
from job_application_tracker import JobApplicationTracker
tracker = JobApplicationTracker(notion_database_id="your_database_id")
tracker.process_emails(max_emails=20)- Email Reading: Uses Gmail API to fetch unread emails
- Classification: ChatGPT analyzes each email to determine if it's job-related
- Information Extraction: ChatGPT extracts structured data (role, organization, status, date, job link)
- Deduplication: Checks Notion database for existing entries by role and organization
- Database Update: Creates new entries or updates existing ones with latest status
- Make sure
credentials.jsonis in the same directory as the script - Delete
token.jsonand re-authenticate if you get permission errors
- Verify your integration is connected to the database
- Check that all required properties exist in your Notion database
- Ensure property names match exactly (case-sensitive)
- Verify your API key is valid and has sufficient credits
- Check your API usage limits
- The script processes emails in batches (default: 20 unread emails)
- Emails are marked as read after processing (even if skipped)
- Job applications are matched by both role and organization to detect duplicates
- The status field can be: "Applied", "Interview", or "Rejected"
MIT License - feel free to use and modify as needed.