Background - Air pollution has been shown to increase the susceptibility to community-acquired pneumonia (CAP). Previously, we observed an increased incidence of CAP in adults living within 1 km from poultry farms, potentially related to particulate matter and endotoxin emissions. We aim to confirm the increased risk of CAP near poultry farms by refined spatial analyses, and we hypothesize that the oropharyngeal microbiota composition in CAP patients may be associated with residential proximity to poultry farms Methods - A spatial kernel model was used to analyze the association between proximity to poultry farms and CAP diagnosis, obtained from electronic medical records of 92,548 GP patients. The oropharyngeal microbiota composition was determined in 126 hospitalized CAP patients using 16S-rRNA-based sequencing, and analyzed in relation to residential proximity to poultry farms. Results - Kernel analysis confirmed a significantly increased risk of CAP when living near poultry farms, suggesting an excess risk up to 1.15 km, followed by a sharp decline. Overall, the oropharyngeal microbiota composition differed borderline significantly between patients living <1 km and ≥1 km from poultry farms (PERMANOVA p = 0.075). Results suggested a higher abundance of Streptococcus pneumoniae (mean relative abundance 34.9% vs. 22.5%, p = 0.058) in patients living near poultry farms, which was verified by unsupervised clustering analysis, showing overrepresentation of a S. pneumoniae cluster near poultry farms (p = 0.049). Conclusion - Living near poultry farms is associated with an 11% increased risk of CAP, possibly resulting from changes in the upper respiratory tract microbiota composition in susceptible individuals. The abundance of S. pneumoniae near farms needs to be replicated in larger, independent studies.