{"id":19700234,"url":"https://github.com/dbeley/reddit-scraper","last_synced_at":"2025-04-29T13:31:46.140Z","repository":{"id":40975833,"uuid":"127208646","full_name":"dbeley/reddit-scraper","owner":"dbeley","description":"Various scripts to download posts/submissions/comments of a reddit subreddit/post/user.","archived":false,"fork":false,"pushed_at":"2025-03-21T12:26:29.000Z","size":127,"stargazers_count":14,"open_issues_count":8,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T17:35:47.053Z","etag":null,"topics":["reddit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbeley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-28T23:03:06.000Z","updated_at":"2025-03-29T21:08:51.000Z","dependencies_parsed_at":"2022-08-18T21:10:24.618Z","dependency_job_id":null,"html_url":"https://github.com/dbeley/reddit-scraper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Freddit-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Freddit-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Freddit-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbeley%2Freddit-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbeley","download_url":"https://codeload.github.com/dbeley/reddit-scraper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251509593,"owners_count":21600670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["reddit"],"created_at":"2024-11-11T21:04:51.358Z","updated_at":"2025-04-29T13:31:45.898Z","avatar_url":"https://github.com/dbeley.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reddit-scraper\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1b70d3ce7401431e88f357e090852ea9)](https://app.codacy.com/app/dbeley/reddit-scraper?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=dbeley/reddit-scraper\u0026utm_campaign=Badge_Grade_Dashboard)\n\nVarious scripts to scrape reddit.\n\n- **download_comments_post.py** : Download the comments of one or several posts.\n- **download_comments_user.py** : Download the last 1000 comments of one or several users.\n- **download_posts_user.py** : Download the posts of one or several users.\n- **fetch_posts_subreddit.py** : Download the posts of a subreddit with the help of the Pushshift api.\n\nSome scripts using pushshift api wrapper psaw can be found in the psaw folder.\n\n## Requirements\n\n- tqdm\n- praw\n- requests\n- pandas\n- numpy\n- xlsxwriter\n- xlrd\n- psaw\n\nNeeds a praw.ini under the form :\n\n```\n[bot]\nclient_id=id\nclient_secret=secret\npassword=password\nusername=username\n```\n\n## Installation of the virtualenv (recommended)\n\n```\npipenv install\n```\n\n## Usage\n\n```\npython fetch_posts_subreddit.py -s france\n```\n\n## Help\n\n### download_comments_post\n\n```\npython download_comments_post -h\n```\n\n```\nusage: download_comments_post.py [-h] [--debug] [-i ID] [-u URL]\n                                 [--source SOURCE] [--file FILE]\n                                 [--export_format EXPORT_FORMAT]\n                                 [--import_format IMPORT_FORMAT]\n\nDownload comments of a post or a set of posts (by id or by url)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --debug               Display debugging information\n  -i ID, --id ID        IDs of the posts to extract (separated by commas)\n  -u URL, --url URL     URLs of the posts to extract (separated by commas)\n  --source SOURCE       The name of the json file containing posts ids\n  --file FILE           The name of the file containing comments already\n                        extracted\n  --export_format EXPORT_FORMAT\n                        Export format (csv or xlsx). Default : csv\n  --import_format IMPORT_FORMAT\n                        Import format, if used with --file (csv or xlsx).\n                        Default : csv\n```\n\n### download_comments_user\n\n```\npython download_comments_user -h\n```\n\n```\nusage: download_comments_user.py [-h] [--debug] [-u USERNAME]\n                                 [--export_format EXPORT_FORMAT]\n\nDownload the last 1000 comments of one or several users\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --debug               Display debugging information\n  -u USERNAME, --username USERNAME\n                        The users to download comments from (separated by\n                        commas)\n  --export_format EXPORT_FORMAT\n                        Export format (csv or xlsx). Default : csv\n```\n\n### download_posts_user\n\n```\npython download_posts_user -h\n```\n\n```\nusage: download_posts_user.py [-h] [--debug] [-u USERNAME]\n                              [--export_format EXPORT_FORMAT]\n\nDownload all the posts of one or several users\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --debug               Display debugging information\n  -u USERNAME, --username USERNAME\n                        The users to download posts from (separated by commas)\n  --export_format EXPORT_FORMAT\n                        Export format (csv or xlsx). Default : csv\n```\n\n### fetch_posts_subreddit\n\n```\npython fetch_posts_subreddit -h\n```\n\n```\nusage: fetch_posts_subreddit.py [-h] [--debug] [-s SUBREDDIT] [-a AFTER]\n                                [-b BEFORE] [--source SOURCE] [--file FILE]\n                                [--export_format EXPORT_FORMAT]\n                                [--import_format IMPORT_FORMAT]\n\nDownload all the posts of a specific subreddit\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --debug               Display debugging information\n  -s SUBREDDIT, --subreddit SUBREDDIT\n                        The subreddit to download posts from. Default :\n                        /r/france\n  -a AFTER, --after AFTER\n                        The min unixstamp to download\n  -b BEFORE, --before BEFORE\n                        The max unixstamp to download\n  --source SOURCE       The name of the json file containing posts ids\n  --file FILE           The name of the file containing posts already\n                        extracted\n  --export_format EXPORT_FORMAT\n                        Export format (csv or xlsx). Default : csv\n  --import_format IMPORT_FORMAT\n                        Import format, if used with --file (csv or xlsx).\n                        Default : csv\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbeley%2Freddit-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbeley%2Freddit-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbeley%2Freddit-scraper/lists"}