Academic Journal
Collecting data from YouTube using the official API: A tutorial and a ready-to-use tool.
| Τίτλος: | Collecting data from YouTube using the official API: A tutorial and a ready-to-use tool. |
|---|---|
| Συγγραφείς: | Campos-Moinier K; University of Strasbourg, LPC UR 4440, 12 Rue Goethe, F-67000, Strasbourg, France. kevin.campos@unistra.fr. |
| Πηγή: | Behavior research methods [Behav Res Methods] 2026 Jul 15; Vol. 58 (8). Date of Electronic Publication: 2026 Jul 15. |
| Τύπος έκδοσης: | Journal Article |
| Γλώσσα: | English |
| Στοιχεία περιοδικού: | Publisher: Springer Country of Publication: United States NLM ID: 101244316 Publication Model: Electronic Cited Medium: Internet ISSN: 1554-3528 (Electronic) Linking ISSN: 1554351X NLM ISO Abbreviation: Behav Res Methods Subsets: MEDLINE |
| Imprint Name(s): | Publication: 2010- : New York : Springer Original Publication: Austin, Tex. : Psychonomic Society, c2005- |
| Ιατρικοί όροι (MeSH): | Data Collection*/methods , Social Media* , Software*, Humans ; User-Computer Interface ; Internet |
| Περίληψη: | Online data from social media platforms provide an observational window into a wide range of psychological phenomena and real-world social interactions. Accessing these data typically requires the use of application programming interfaces (APIs), which are designed to ensure compliance with the legal and ethical frameworks governing the access, processing, and storage of potentially identifiable information. However, implementing API-based data collection within a dedicated program remains a major barrier for many researchers. This article addresses this challenge by introducing a ready-to-use data collection tool based on the official YouTube Data API (v3) and providing step-by-step guidance for its use. Geared toward researchers and practitioners with little or no prior programming experience, the tutorial enables users to implement transparent and reproducible API-based data collection procedures in their research. The tool and a fully documented interactive Python notebook are freely available via a public GitHub repository. (© 2026. The Psychonomic Society, Inc.) |
| Competing Interests: | Declarations. Conflict of interest: The author declares that there are no conflicts of interest to report. Ethics approval: Not applicable. Consent to participate: Not applicable. Consent for publication: Not applicable. |
| References: | Adjerid, I., & Kelley, K. (2018). Big data in psychology: A framework for research advancement. American Psychologist, 73(7), 899–917. https://doi.org/10.1037/amp0000190. (PMID: 10.1037/amp000019029469579) Berger, J., & Packard, G. (2022). Using natural language processing to understand people and culture. American Psychologist, 77(4), 525–537. https://doi.org/10.1037/amp0000882. (PMID: 10.1037/amp000088234914405) Bradley, A., & James, R. J. (2019). Web scraping using R. Advances in Methods and Practices in Psychological Science, 2(3), 264–270. https://doi.org/10.1177/2515245919859535. (PMID: 10.1177/2515245919859535) Brown, M. A., Gruen, A., Maldoff, G., Messing, S., Sanderson, Z., & Zimmer, M. (2025). Web scraping for research: Legal, ethical, institutional, and scientific considerations. Big Data & Society. https://doi.org/10.1177/20539517251381686. (PMID: 10.1177/20539517251381686) Ceron, A., Curini, L., Iacus, S. M., & Porro, G. (2014). Every tweet counts? How sentiment analysis of social media can improve our knowledge of citizens’ political preferences with an application to Italy and France. New Media & Society, 16(2), 340–358. https://doi.org/10.1177/1461444813480466. (PMID: 10.1177/1461444813480466) Chalkias, I., Tzafilkou, K., Karapiperis, D., & Tjortjis, C. (2023). Learning analytics on YouTube educational videos: Exploring sentiment analysis methods and topic clustering. Electronics, 12(18), 3949. https://doi.org/10.3390/electronics12183949. (PMID: 10.3390/electronics12183949) Chen, E. E., & Wojcik, S. P. (2016). A practical guide to big data research in psychology. Psychological Methods, 21(4), 458. https://doi.org/10.1037/met0000111. (PMID: 10.1037/met000011127918178) Choi, G. E., Pyun, M., Yoon, S. H., Kim, Y., Shin, H., & Lee, S. Y. (2024). Exploring the relationship between YouTube video characteristics and a viewer’s mental health traits among young adults. Frontiers in Psychiatry, 15, 1364930. https://doi.org/10.3389/fpsyt.2024.1364930. (PMID: 10.3389/fpsyt.2024.13649303903560311258633) Clarke, R. (2016). Big data, big risks. Information Systems Journal, 26(1), 77–90. https://doi.org/10.1111/isj.12088. (PMID: 10.1111/isj.12088) Costello, C., Srivastava, S., Rejaie, R., & Zalewski, M. (2021). Predicting mental health from followed accounts on Twitter. Collabra: Psychology. https://doi.org/10.1525/collabra.18731. (PMID: 10.1525/collabra.18731) Dommett, K., & Tromble, R. (2022). Advocating for platform data access: Challenges and opportunities for academics seeking policy change. Politics and Governance, 10(1), 220–229. https://doi.org/10.17645/pag.v10i1.4713. (PMID: 10.17645/pag.v10i1.4713) Galvez-Hernandez, P., Gonzalez-Viana, A., Gonzalez-de Paz, L., Shankardass, K., & Muntaner, C. (2024). Generating contextual variables from web-based data for health research: Tutorial on web scraping, text mining, and spatial overlay analysis. JMIR Public Health and Surveillance, 10, e50379. https://doi.org/10.2196/50379. (PMID: 10.2196/503793819024510804251) Jackson, J. C., Watts, J., List, J. M., Puryear, C., Drabble, R., & Lindquist, K. A. (2022). From text to thought: How analyzing language can advance psychological science. Perspectives on Psychological Science, 17(3), 805–826. https://doi.org/10.1177/17456916211004899. (PMID: 10.1177/1745691621100489934606730) Kemp, S. (2025). Digital 2026 Global Overview Report. Retrieved December 15, 2025, from https://wearesocial.com/uk/blog/2025/10/digital-2026/. Landers, R. N., Brusso, R. C., Cavanaugh, K. J., & Collmus, A. B. (2016). A primer on theory-driven web scraping: Automatic extraction of big data from the Internet for use in psychological research. Psychological Methods, 21(4), 475–492. https://doi.org/10.1037/met0000081. (PMID: 10.1037/met000008127213980) Liyih, A., Anagaw, S., Yibeyin, M., & Tehone, Y. (2024). Sentiment analysis of the Hamas-Israel war on YouTube comments using deep learning. Scientific Reports, 14(1), 13647. https://doi.org/10.1038/s41598-024-63367-3. (PMID: 10.1038/s41598-024-63367-33887173911176161) Lotfi, C., Srinivasan, S., Ertz, M., & Latrous, I. (2021, January). Web scraping techniques and applications: A literature review. In SCRS Conference Proceedings on Intelligent Systems (pp. 381–394). https://doi.org/10.52458/978-93-91842-08-6-38. Marres, N., & Weltevrede, E. (2013). Scraping the social? Issues in live social research. Journal of Cultural Economy, 6(3), 313–335. https://doi.org/10.1080/17530350.2013.772070. (PMID: 10.1080/17530350.2013.772070) Porreca, A., Scozzari, F., & Di Nicola, M. (2020). Using text mining and sentiment analysis to analyse YouTube Italian videos concerning vaccination. BMC Public Health, 20(1), 259. https://doi.org/10.1186/s12889-020-8342-4. (PMID: 10.1186/s12889-020-8342-4320756317031868) Qi, Y., & Shabrina, Z. (2023). Sentiment analysis using Twitter data: A comparative application of lexicon-and machine-learning-based approach. Social Network Analysis and Mining, 13(1), 31. https://doi.org/10.1007/s13278-023-01030-x. (PMID: 10.1007/s13278-023-01030-x367893799910766) Reece, A. G., Reagan, A. J., Lix, K. L., Dodds, P. S., Danforth, C. M., & Langer, E. J. (2017). Forecasting the onset and course of mental illness with Twitter data. Scientific Reports, 7(1), 13006. https://doi.org/10.1038/s41598-017-12961-9. (PMID: 10.1038/s41598-017-12961-9290215285636873) Rieder, B., Padilla, A., & Coromina, Ò. (2025). Forgetful by design? A critical audit of YouTube’s search API for academic research. Information, Communication & Society. https://doi.org/10.1080/1369118X.2025.2591767. (PMID: 10.1080/1369118X.2025.2591767) Rodriguez, M. Y., & Storer, H. (2020). A computational social science perspective on qualitative data exploration: Using topic models for the descriptive analysis of social media data. Journal of Technology in Human Services, 38(1), 54–86. https://doi.org/10.1080/15228835.2019.1616350. (PMID: 10.1080/15228835.2019.1616350) Seiling, L. K., Iglesias Keller, C., Ohme, J., Klinger, U., & de Vreese, C. (2025). Data access for researchers under the Digital Services Act: From policy to practice. Weizenbaum policy papers, No. 14. https://doi.org/10.34669/WI.WPP/14. Stracqualursi, L., & Agati, P. (2025). Predicting MBTI personality of YouTube users. Scientific Reports, 15(1), 7221. https://doi.org/10.1038/s41598-025-85183-z. (PMID: 10.1038/s41598-025-85183-z4002169611871013) Tang, Q., Bai, X., & Gan, F. (2025). On sentiment recognition mechanism in Black Myth: Wukong player communication on YouTube. Frontiers in Psychology, 16, 1729713. https://doi.org/10.3389/fpsyg.2025.1625671. (PMID: 10.3389/fpsyg.2025.16256714129309712641604) Tromble, R. (2021). Where have all the data gone? A critical reflection on academic digital research in the post-API age. Social Media + Society. https://doi.org/10.1177/2056305121988929. (PMID: 10.1177/2056305121988929) Tromble, R., Storz, A., & Stockmann, D. (2017). We don't know what we don't know: When and how the use of Twitter's public APIs biases scientific inference. Available at SSRN 3079927. https://doi.org/10.2139/ssrn.3079927. YouTube Data API (n.d.). Retrieved January 13, 2026, from https://developers.google.com/youtube/v3/getting-started?hl=en. |
| Contributed Indexing: | Keywords: API-based data collection; Open science; Social media data; YouTube Data API |
| Entry Date(s): | Date Created: 20260715 Date Completed: 20260716 Latest Revision: 20260729 |
| Update Code: | 20260729 |
| DOI: | 10.3758/s13428-026-03116-8 |
| PMID: | 42458152 |
| Βάση Δεδομένων: | MEDLINE |
| ISSN: | 1554-3528 |
|---|---|
| DOI: | 10.3758/s13428-026-03116-8 |