Hydroxychloroquine and ivermectin received widespread attention after initial studies suggested that they were effective against COVID-19. However, several of these studies were later discredited. We explored the impact of scientific articles, public announcements and social media posts on hydroxychloroquine and ivermectin purchases in the USA and Canada during the COVID-19 pandemic. We conducted a retrospective, population-based time series analysis of retail hydroxychloroquine and ivermectin purchases in the USA and Canada from February 2016 through to December 2021, using IQVIA's Multinational Integrated Data Analysis database. We fitted the purchasing rates with interventional autoregressive integrated moving average models. We used Google Trends to identify the most influential interventions to include in the models. There were significant pulse increases in hydroxychloroquine purchases in March 2020 in both the USA (P < 0.0001) and Canada (P < 0.0001). For ivermectin, there were no significant changes in April 2020 in either the USA (P = 0.41) or Canada (P = 0.16); however, significant pulse increases occurred from December 2020 to January 2021 in both the USA (P = 0.0006) and Canada (P < 0.0001), as well as significant ramp increases from April to August 2021 in both the USA (P < 0.0001) and Canada (P = 0.02). The increases in ivermectin purchases were larger in the USA than in Canada. Increases in hydroxychloroquine and ivermectin purchasing rates aligned with controversial scientific articles and social media posts. This highlights the importance of scientific integrity and disseminating accurate epidemiologic information during pandemics.