r/research • • 3d ago

Scraping Reddit Data

Hello,

I am a post doc trying to scrape data from reddit for a study I am conducting. I am having the hardest and worst time trying to figure how to scrape the actual data from Reddit. Does anyone have any advice they can give as to how to get this done?

Really appreciate any advice.

0 Upvotes

29 comments sorted by

2

u/TLDW_Tutorials 2d ago

You can try the PRAW module in Python for getting Reddit posts and comments if you want to explore and decide if it's something you want to explore. Not sure about R or other languages. If you want some code, DM me and I can send you a GitHub repo of mine. I think as of 2026 though, if you are considering a new research project, you may want to check Reddit for Researchers.

1

u/mnewman1buh 2d ago

I followed the Reddit for Researchers pathway. The require a protocol submission - I submitted a very basic version as there is no NDA in place to protect my work, but they denied it that they needed more information.

2

u/finding_flora 1d ago

That is likely your immediate answer then, that you will need to resubmit with more project detail

2

u/GXWT 3d ago

What have you tried? What is not working?

2

u/BhujelChoulaime 2d ago

wonder if OP even has academic api access approved yet or if theyre getting blocked before that step

2

u/Magdaki Professor 3d ago

See the Reddit Research Program.

Reddit for Researchers Program – Reddit Help

2

u/Blinkinlincoln 3d ago

There's an API

1

u/Bright_Wear8476 2d ago

Have you looked into the Pushshift API or PRAW? Those are usually the go to options for Reddit data.

1

u/Possible-Breath2377 2d ago

I had done some research on Twitter, when it was still Twitter, and there was a way to pull the information you needed through NVIVO. It sounds like you’re looking for other information than the word-for-word posts, but I wonder if you might be able to find built-in capabilities in your analysis software?

1

u/Budget-Juggernaut-68 16h ago

How about just asking them?

1

u/Interesting-Baker473 16h ago

Yeah, I do Qualitative Multimedia Content Analysis and redit it the hardest for me to scrape. Use Google anti gravity not Claude to build the scrapper. I believe that last tried Claude I did not get as much as I wanted. Depending on what your study is and what you need the data for I may have a couple scrappers and the data that might work for you. I don't want to say on here what I study and why I use it for redit (for obvious reasons) so you can DM me if you like

-1

u/esalman 3d ago

Ask Claude.

-2

u/Vic_toorb37 2d ago

Claude won’t do it, Claude is too much by the book and will read Reddit’s data policy and automatically tell you it won’t do it for you.

0

u/esalman 2d ago

Then you don't know how to use agents. 

-1

u/Vic_toorb37 2d ago

Claude might tell you how to do it, but it won’t do it for you, go argue with the wall

1

u/esalman 2d ago

I maintain that you don't know how to use agents. 

-1

u/Vic_toorb37 2d ago

Then tell us or show us how to do it or shut up, just yapping just to yap

1

u/esalman 2d ago

I'd ask Claude to write a playwright script for the job. It can handle everything from login to auto crawling, without spending any tokens. 

Login and crawling should be fine. If Claude refuses to scrape the actual content, just try some different prompt, like say it's for nonconmmercial research, or give it a snippet of html code and ask to generate output in given format. Later you can adapt for reddit or whatever website you need.

Remember, these language models were built by flouting all sorts of data and copyright policies and burning books, so it's all fair, data policy don't apply.

2

u/Vic_toorb37 2d ago

Playwright and crawling are not the issue I’ve experienced, Claude will not scrape the data regardless of how you prompt it unless I’m missing something. Ironically, I have tried Claude & Playwright, the issue ends up being the actual scraping and retrieving the data. But again maybe the non-commercial research thing would work, I didn’t try that.

Also, props to giving an actual answer, respect earned lol 😂

1

u/esalman 2d ago

Instead of saying this is Reddit, you can just copy source from a page, give it to Claude, say this is the expected html format and to adjust the playwright script accordingly. There's so many ways to get around this.

1

u/TLDW_Tutorials 2d ago

You're right. It'll go here https://www.reddit.com/robots.txt right away and refuse to scrape.

-2

u/IceImmediate1944 3d ago

Nunca fiz isso, mas não daria para integrar a IA e o Reddit?

1

u/TLDW_Tutorials 2d ago

You could; but if you don't know what you're doing it will likely be an AI slop mess. Too lazy to elaborate but I can if it's helpful.

1

u/mnewman1buh 2d ago

This is the other part, I know I am way out of my league as I do not know much about any of this. I would love as much guidance as possible.

-1

u/IceImmediate1944 2d ago

Sim, mas vc sabe o que está fazendo…

0

u/TLDW_Tutorials 2d ago

Na verdade, eu sei, sim. Já fiz fine-tuning do Qwen3.5-2B com LoRA em BF16 pra identificar onde o autor de um post do Reddit mora. Passo o título e o corpo do post pro modelo e peço uma saída em JSON que diferencie onde a pessoa mora, onde já morou, onde esteve de visita e quais lugares ela só mencionou. Se o post não deixa claro onde ela mora, a resposta é “desconhecido”. Eu avalio isso com posts rotulados manualmente, porque dá pra gerar um JSON impecável e ainda assim errar com toda a confiança do mundo.

Pra inferência local, prefiro GGUF a safetensors e comparo Q4_K_M com Q8_0 usando os mesmos exemplos rotulados. O que me interessa é se a quantização mais agressiva começa a errar nos posts ambíguos. Com o gpt-oss-120b, eu começaria pelos pesos nativos dos experts em MXFP4 como referência. Gosto de ter 128K de contexto à disposição, mas pode jogar os 128K inteiros num post de três frases que isso ainda não vai ensinar o modelo a diferença entre “moro em Detroit” e “fui pra Detroit no fim de semana passado”.

0

u/IceImmediate1944 2d ago

Entendi, mas isso não está sendo o suficiente?

0

u/TLDW_Tutorials 2d ago

Tô de boa com você, mano. Te desejo tudo de bom. Paz!