The H-1B visa policy is at the core of the public debate on high-skilled migrations in the US. The controversy focuses especially on firms' motives to hire foreign workers. While firms claim that their vacancies would stay unfilled without recruiting foreign workers, the lack of data limits the investigation of this problem. In this paper, I address this gap by scraping job posting data from Indeed.com to measure labor shortages. I study the online duration of job ads to approximate firms' difficulties to fill their vacancies. Completing this analysis with administrative data, I observe for each job advertised on Indeed.com whether it leads to a demand for an H-1B visa. Exploiting variations at both extensive and intensive margins allows me to show that labor shortages explain a part of the demand for high-skilled foreign workers. By taking advantage of a discontinuity in H-1B visas application rules, I ensure the causal identification of this relationship.