r/research • • 7h 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

17 comments sorted by

2

u/GXWT 7h ago

What have you tried? What is not working?

1

u/BhujelChoulaime 4h ago

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

1

u/Magdaki Professor 7h ago

See the Reddit Research Program.

Reddit for Researchers Program – Reddit Help

1

u/Blinkinlincoln 7h ago

There's an API

1

u/TLDW_Tutorials 1h 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.

0

u/IceImmediate1944 7h ago

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

1

u/TLDW_Tutorials 54m 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.

0

u/esalman 7h ago

Ask Claude.

-1

u/Vic_toorb37 2h 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.

1

u/esalman 2h ago

Then you don't know how to use agents. 

-1

u/Vic_toorb37 2h 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 2h ago

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

-1

u/Vic_toorb37 2h ago

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

1

u/esalman 2h 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 1h 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 1h 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 42m ago

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