Ozone pollution significantly impacts human health. However, less is known about the effects of ozone on pharmacy consumption affecting a wider population, especially in heavily polluted developing countries. Moreover, no studies reveal the community-level heterogeneity of these effects. Taking advantage of multi-sources big data, this study aimed to refine the short-term effects of ozone exposure on the indicator of pharmacy visits to community levels in Nanjing, China. Firstly, we established a random forest model to predict the high-resolution ozone exposure and extracted the indicator of pharmacy visits from mobile phone call detail records and Point of Interest data. Then, we applied a generalized additive model to estimate the percent increase of pharmacy visits per 10 μg/m3 increase in ozone exposure. The results showed that in the best lag model, the pharmacy visits in Nanjing increased by 0.822% (95% CI: 0.818%–0.826%) for each 10 μg/m3 increase in ozone. The exposure-response curve for maximum 8-h average ozone and pharmacy visits was nonlinear, with a rapid increase below 150 μg/m3 and then slightly decreased. The rural 1.210% (95% CI: 1.19%–1.23%) has a higher estimate than the urban 0.819% (95% CI: 0.813%–0.825%). The low temperature intensifies the ozone's effect on increasing pharmacy visits, while the high temperature does the opposite. On the one hand, our study proposed an innovative and promising method to apply multi-sources big data to overcome the health data lacking issues in environmental health studies. On the other hand, it also sheds light on previously unidentified heterogeneous effects of ozone on mild health outcomes, especially in heavily polluted developing countries.