python-jobspy Documentation

repository·main·Indexed 23 days ago

https://github.com/speedyapply/jobspy

A job scraping library for aggregating job postings from LinkedIn, Indeed, Glassdoor, ZipRecruiter, Bayt, and other boards into a pandas DataFrame. It features the scrape_jobs() API for filtering by search terms, location, and job type, and supports proxy rotation to mitigate 429 rate limit errors. Requires Python >= 3.10.

Tokens
1.4K
Snippets
2
Records
7
Agent score
38%

What's inside python-jobspy

  1. Troubleshoot 429 Rate Limit Errors

    main

    A 429 response code indicates you have been blocked by a job board for sending too many requests. To mitigate this:

    1. Wait: Allow time between scrapes.
    2. Use Proxies: Use the proxies parameter to rotate your IP address.
  2. Use scrape_jobs() to aggregate job postings

    main

    The primary API for JobSpy is scrape_jobs(). It returns a pandas DataFrame containing aggregated job postings from multiple sources. You can specify which sites to scrape, search terms, locations, and other filters.

    import csv
    from jobspy import scrape_jobs
    
    jobs = scrape_jobs(
        site_name=["indeed", "linkedin", "zip_recruiter", "google"],
        search_term="software engineer",
        google_search_term="software engineer jobs near San Francisco, CA since yesterday",
        location="San Francisco, CA",
        results_wanted=20,
        hours_old=72,
        country_indeed='USA',
    )
    print(f"Found {len(jobs)} jobs")
    print(jobs.head())
    jobs.to_csv("jobs.csv", quoting=csv.QUOTE_NONNUMERIC, escapechar="\", index=False)
  3. Configure country for Indeed and Glassdoor

    main

    When searching on Indeed or Glassdoor, you must provide the country_indeed parameter. Supported countries include:

    ArgentinaAustralia*Austria*
    BahrainBelgium*Brazil*
    Canada*ChileChina
    ColombiaCosta RicaCzech Republic
    DenmarkEcuadorEgypt
    FinlandFrance*Germany
    GreeceHong Kong*Hungary
    India*IndonesiaIreland*
    IsraelItalyJapan
    KuwaitLuxembourgMalaysia
    Mexico*MoroccoNetherlands*
    New ZealandNigeriaNorway
    OmanPakistanPanama
    PeruPhilippinesPoland
    PortugalQatarRomania
    Saudi ArabiaSingapore*South Africa
    South KoreaSpain*Sweden
    Switzerland*TaiwanThailand
    TurkeyUkraineUnited Arab Emirates
    UK*USA*Uruguay
    VenezuelaVietnam

    Note: Asterisk () indicates support for Glassdoor as well.

  4. Understand scrape_jobs() limitations

    main

    Certain parameter combinations are mutually exclusive for specific job boards:

    Indeed Limitations: You can only use ONE of the following in a single search:

    • hours_old
    • job_type & is_remote
    • easy_apply

    LinkedIn Limitations: You can only use ONE of the following in a single search:

    • hours_old
    • easy_apply
  5. Reference parameters for scrape_jobs()

    main

    The following optional parameters are available for scrape_jobs():

    ParameterTypeDescription
    site_namelist or strlinkedin, zip_recruiter, indeed, glassdoor, google, bayt, bdjobs (default is all)
    search_termstrThe job title or keywords
    google_search_termstrSpecific search term for Google Jobs; the only parameter used for filtering Google jobs
    locationstrGeographic location
    distanceintDistance in miles (default: 50)
    job_typestrfulltime, parttime, internship, contract
    proxieslistList of proxies in format ['user:pass@host:port', 'localhost']. Scrapers use round-robin
    is_remoteboolFilter for remote jobs
    results_wantedintNumber of results to retrieve per specified site
    easy_applyboolFilters for jobs hosted on the job board site (Note: LinkedIn easy apply filter no longer works)
    user_agentstrOverride default user agent
    description_formatstrmarkdown (default) or html
    offsetintStarting index for the search
    hours_oldintFilter by hours since posting (ZipRecruiter/Glassdoor round up to next day)
    verboseintVerbosity: 0 (errors only), 1 (errors+warnings), 2 (all logs, default)
    linkedin_fetch_descriptionboolFetches full description and direct URL for LinkedIn (slower, increases requests by O(n))
    linkedin_company_idslist[int]Search LinkedIn jobs by specific company IDs
    country_indeedstrFilter country for Indeed & Glassdoor
    enforce_annual_salaryboolConverts wages to annual salary
    ca_certstrPath to CA Certificate file for proxies
  6. JobPost data schema

    main

    The output DataFrame follows this schema:

    • title
    • company
    • company_url
    • job_url
    • location (country, city, state)
    • is_remote
    • description
    • job_type: fulltime, parttime, internship, contract
    • job_function:
      • interval: yearly, monthly, weekly, daily, hourly
      • min_amount
      • max_amount
      • currency
      • salary_source: direct_data, description (parsed from posting)
    • date_posted
    • emails

    Platform Specific Fields:

    • LinkedIn: job_level
    • LinkedIn & Indeed: company_industry
    • Indeed: company_country, company_addresses, company_employees_label, company_revenue_label, company_description, company_logo
    • Naukri: skills, experience_range, company_rating, company_reviews_count, vacancy_count, work_from_home_type