{"id":13610132,"url":"https://github.com/bisguzar/twitter-scraper","last_synced_at":"2025-02-24T01:31:22.257Z","repository":{"id":37952707,"uuid":"122493502","full_name":"bisguzar/twitter-scraper","owner":"bisguzar","description":"Scrape the Twitter Frontend API without authentication.","archived":true,"fork":false,"pushed_at":"2023-10-30T05:53:33.000Z","size":238,"stargazers_count":3941,"open_issues_count":57,"forks_count":604,"subscribers_count":98,"default_branch":"master","last_synced_at":"2024-12-15T20:02:07.850Z","etag":null,"topics":["client","javascript","no-authentication","python","tweets","twitter","twitter-api"],"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/bisguzar.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-22T14:58:34.000Z","updated_at":"2024-12-15T19:50:28.000Z","dependencies_parsed_at":"2024-01-07T10:51:24.645Z","dependency_job_id":"cad62e45-4c01-48f8-b51a-a67fbca704ca","html_url":"https://github.com/bisguzar/twitter-scraper","commit_stats":{"total_commits":144,"total_committers":32,"mean_commits":4.5,"dds":0.7430555555555556,"last_synced_commit":"010f1bb838623d4914351086991f4d6a1d7e2308"},"previous_names":["kennethreitz/twitter-scraper"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bisguzar%2Ftwitter-scraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bisguzar%2Ftwitter-scraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bisguzar%2Ftwitter-scraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bisguzar%2Ftwitter-scraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bisguzar","download_url":"https://codeload.github.com/bisguzar/twitter-scraper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240403046,"owners_count":19795832,"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":["client","javascript","no-authentication","python","tweets","twitter","twitter-api"],"created_at":"2024-08-01T19:01:41.536Z","updated_at":"2025-02-24T01:31:21.917Z","avatar_url":"https://github.com/bisguzar.png","language":"Python","funding_links":[],"categories":["Python","Python (1887)","[✨ inspiration](https://github.com/stars/ketsapiwiq/lists/inspiration)"],"sub_categories":[],"readme":"# Twitter Scraper\n\n![GitHub](https://img.shields.io/github/license/bisguzar/twitter-scraper) ![GitHub contributors](https://img.shields.io/github/contributors/bisguzar/twitter-scraper) ![code size](https://img.shields.io/github/languages/code-size/bisguzar/twitter-scraper) ![maintain status](https://img.shields.io/maintenance/yes/2020)\n\n[🇰🇷 Read Korean Version](https://github.com/bisguzar/twitter-scraper/blob/master/twitter_scraper/__init__.py)\n\nTwitter's API is annoying to work with, and has lots of limitations — luckily their frontend (JavaScript) has it's own API, which I reverse–engineered. No API rate limits. No restrictions. Extremely fast.\n\nYou can use this library to get the text of any user's Tweets trivially.\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n* Internet Connection\n* Python 3.6+\n\n## Installing twitter-scraper\n\nIf you want to use latest version, install from source. To install twitter-scraper from source, follow these steps:\n\nLinux and macOS:\n```bash\ngit clone https://github.com/bisguzar/twitter-scraper.git\ncd twitter-scraper\nsudo python3 setup.py install \n```\n\nAlso, you can install with PyPI.\n\n```bash\npip3 install twitter_scraper\n```\n\n## Using twitter_scraper\n\nJust import **twitter_scraper** and call functions!\n\n\n### → function **get_tweets(query: str [, pages: int])** -\u003e dictionary\nYou can get tweets of profile or parse tweets from hashtag, **get_tweets** takes username or hashtag on first parameter as string and how much pages you want to scan on second parameter as integer. \n\n#### Keep in mind:\n* First parameter need to start with #, number sign, if you want to get tweets from hashtag.\n* **pages** parameter is optional.\n\n```python\nPython 3.7.3 (default, Mar 26 2019, 21:43:19) \n[GCC 8.2.1 20181127] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e from twitter_scraper import get_tweets\n\u003e\u003e\u003e \n\u003e\u003e\u003e for tweet in get_tweets('twitter', pages=1):\n...     print(tweet['text'])\n... \nspooky vibe check\n…\n```\n\nIt returns a dictionary for each tweet. Keys of the dictionary;\n\n| Key       | Type       | Description                                                      |\n|-----------|------------|------------------------------------------------------------------|\n| tweetId   | string     | Tweet's identifier, visit twitter.com/USERNAME/ID to view tweet. |\n| userId    | string     | Tweet's userId                                                   |\n| username  | string     | Tweet's username                                                 |\n| tweetUrl  | string     | Tweet's URL                                                      |\n| isRetweet | boolean    | True if it is a retweet, False otherwise                         |\n| isPinned | boolean    | True if it is a pinned tweet, False otherwise                     |\n| time      | datetime   | Published date of tweet                                          |\n| text      | string     | Content of tweet                                                 |\n| replies   | integer    | Replies count of tweet                                           |\n| retweets  | integer    | Retweet count of tweet                                           |\n| likes     | integer    | Like count of tweet                                              |\n| entries   | dictionary | Has hashtags, videos, photos, urls keys. Each one's value is list|\n\n### → function **get_trends()** -\u003e list\nYou can get the Trends of your area simply by calling `get_trends()`. It will return a list of strings.\n\n```python\nPython 3.7.3 (default, Mar 26 2019, 21:43:19) \n[GCC 8.2.1 20181127] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e from twitter_scraper import get_trends\n\u003e\u003e\u003e get_trends()\n['#WHUTOT', '#ARSSOU', 'West Ham', '#AtalantaJuve', '#バビロニア', '#おっさんずラブinthasky', 'Southampton', 'Valverde', '#MMKGabAndMax', '#23NParoNacional']\n```\n\n### → class **Profile(username: str)** -\u003e class instance\nYou can get personal information of a profile, like birthday and biography if exists and public. This class takes username parameter. And returns itself. Access informations with class variables.\n\n\n```python\nPython 3.7.3 (default, Mar 26 2019, 21:43:19) \n[GCC 8.2.1 20181127] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e from twitter_scraper import Profile\n\u003e\u003e\u003e profile = Profile('bugraisguzar')\n\u003e\u003e\u003e profile.location\n'Istanbul'\n\u003e\u003e\u003e profile.name\n'Buğra İşgüzar'\n\u003e\u003e\u003e profile.username\n'bugraisguzar'\n```\n\n#### → **.to_dict()** -\u003e dict\n\n**to_dict** is a method of *Profile* class. Returns profile datas as Python dictionary.\n\n```python\nPython 3.7.3 (default, Mar 26 2019, 21:43:19) \n[GCC 8.2.1 20181127] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e from twitter_scraper import Profile\n\u003e\u003e\u003e profile = Profile(\"bugraisguzar\")\n\u003e\u003e\u003e profile.to_dict()\n{'name': 'Buğra İşgüzar', 'username': 'bugraisguzar', 'birthday': None, 'biography': 'geliştirici@peptr', 'website': 'bisguzar.com', 'profile_photo': 'https://pbs.twimg.com/profile_images/1199305322474745861/nByxOcDZ_400x400.jpg', 'banner_photo': 'https://pbs.twimg.com/profile_banners/1019138658/1555346657/1500x500', 'likes_count': 2512, 'tweets_count': 756, 'followers_count': 483, 'following_count': 255, 'is_verified': False, 'is_private': False, user_id: \"1019138658\"}\n```\n\n\n\n## Contributing to twitter-scraper\nTo contribute to twitter-scraper, follow these steps:\n\n1. Fork this repository.\n2. Create a branch with clear name: `git checkout -b \u003cbranch_name\u003e`.\n3. Make your changes and commit them: `git commit -m '\u003ccommit_message\u003e'`\n4. Push to the original branch: `git push origin \u003cproject_name\u003e/\u003clocation\u003e`\n5. Create the pull request.\n\nAlternatively see the GitHub documentation on [creating a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request).\n\n## Contributors\n\nThanks to the following people who have contributed to this project:\n\n* @kennethreitz (author)\n* @bisguzar (maintainer)\n* @lionking6792\n* @ozanbayram\n* @xeliot\n\n\n## Contact\nIf you want to contact me you can reach me at [@bugraisguzar](https://twitter.com/bugraisguzar).\n\n\n## License\nThis project uses the following license: [MIT](https://github.com/bisguzar/twitter-scraper/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbisguzar%2Ftwitter-scraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbisguzar%2Ftwitter-scraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbisguzar%2Ftwitter-scraper/lists"}