{"id":13405624,"url":"https://github.com/geduldig/TwitterAPI","last_synced_at":"2025-03-14T10:31:07.653Z","repository":{"id":6731036,"uuid":"7977016","full_name":"geduldig/TwitterAPI","owner":"geduldig","description":"Minimal python wrapper for Twitter's REST and Streaming APIs","archived":false,"fork":false,"pushed_at":"2023-03-23T02:04:15.000Z","size":1107,"stargazers_count":939,"open_issues_count":0,"forks_count":262,"subscribers_count":50,"default_branch":"master","last_synced_at":"2024-10-01T13:21:21.546Z","etag":null,"topics":["python","twitter","twitter-api","twitter-client"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geduldig.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGE.log","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2013-02-02T14:47:58.000Z","updated_at":"2024-09-29T16:41:24.000Z","dependencies_parsed_at":"2023-01-13T14:05:28.192Z","dependency_job_id":"2a8e9f14-8bb6-495d-9906-9a23c6158953","html_url":"https://github.com/geduldig/TwitterAPI","commit_stats":{"total_commits":358,"total_committers":37,"mean_commits":9.675675675675675,"dds":0.4245810055865922,"last_synced_commit":"5c07c02fce51302e747190a47b6c6796fee23352"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geduldig%2FTwitterAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geduldig%2FTwitterAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geduldig%2FTwitterAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geduldig%2FTwitterAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geduldig","download_url":"https://codeload.github.com/geduldig/TwitterAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243120409,"owners_count":20239467,"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":["python","twitter","twitter-api","twitter-client"],"created_at":"2024-07-30T19:02:06.861Z","updated_at":"2025-03-14T10:31:07.646Z","avatar_url":"https://github.com/geduldig.png","language":"Python","readme":"|LOGO|\n======\n\n.. |LOGO| image:: https://raw.githubusercontent.com/geduldig/TwitterAPI/master/logo.png \n.. |BADGE_VERSION| image:: http://img.shields.io/pypi/v/TwitterAPI.svg\n   :target: https://crate.io/packages/TwitterAPI \n.. |BADGE_CHAT| image:: https://badges.gitter.im/Join%20Chat.svg\n   :alt: Join the chat at https://gitter.im/geduldig/TwitterAPI\n   :target: https://gitter.im/geduldig/TwitterAPI?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n\n.. |BADGE_2| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2\n   :target: https://developer.twitter.com/en/docs/twitter-api \n.. |BADGE_LABS| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Flabs\n   :target: https://developer.twitter.com/en/docs/labs \n.. |BADGE_ADS| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fadsv9\n   :target: https://developer.twitter.com/en/docs/twitter-ads-api\n.. |BADGE_1.1| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fstandard\n   :target: https://developer.twitter.com/en/docs/twitter-api\n.. |BADGE_PREMIUM| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fpremium\n   :target: https://developer.twitter.com\n\n\nTwitterAPI is a minimal python wrapper for the TwitterAPIs. A list of what it can do:\n\n* Support for all V1.1 and V2 endpoints, plus Premium, Ads, Labs, Collections.\n* OAuth1 and bearer token authentication, and proxy server authentication.\n* Streaming endpoints.\n* Paging results.\n* The option to \"hydrate\" results returned by V2 endpoints. \n* Error handling.\n\nInstallation\n------------\n\n\t\u003e pip install TwitterAPI\n\nTwitter API Version 1.1 Code Snippets \n-------------------------------------\n[More examples in `TwitterAPI/examples/v1.1 \u003chttps://github.com/geduldig/TwitterAPI/tree/master/examples/v1.1\u003e`_]\n\nSearch for recent tweets\n::\n\n\tfrom TwitterAPI import TwitterAPI\n\tapi = TwitterAPI(consumer_key, consumer_secret, access_token_key, access_token_secret)\n\tr = api.request('search/tweets', {'q':'pizza'})\n\tfor item in r:\n\t\tprint(item)\n\nStream tweets from New York City as they get tweeted\n::\n\n\tr = api.request('statuses/filter', {'locations':'-74,40,-73,41'})\n\tfor item in r:\n\t\tprint(item)\n\nTwitter API Version 2 Code Snippets \n------------------------------------\n[More examples in `TwitterAPI/examples/v2 \u003chttps://github.com/geduldig/TwitterAPI/tree/master/examples/v2\u003e`_ ]\n\nSearch for recent tweets, and specify `fields` and `expansions`\n::\n\n\tfrom TwitterAPI import TwitterAPI\n\tapi = TwitterAPI(consumer_key, consumer_secret, access_token_key, access_token_secret, api_version='2')\n\tr = api.request('tweets/search/recent', {\n\t\t'query':'pizza', \n\t\t'tweet.fields':'author_id',\n\t\t'expansions':'author_id'})\n\tfor item in r:\n\t\tprint(item)\n\nOne Method For Everything\n-------------------------\n\nThe ``request()`` method works with all version 1.1 and version 2 endpoints. Typcally, ``request()`` takes two arguments: a Twitter endpoint and a dictionary of endpoint parameters.  \n\nThe method returns an object that will iterate either search results and streams. The returned object also gives you access to the raw response (``r.text``) and the HTTP status code (``r.status_code``). See the `requests \u003chttp://docs.python-requests.org/en/latest/user/quickstart/\u003e`_ library documentation for more details.\n\nDocumentation\n-------------\n* `An Introduction \u003chttp://geduldig.github.io/TwitterAPI\u003e`_\n* `Authentication \u003chttp://geduldig.github.io/TwitterAPI/authentication.html\u003e`_\n* `Error Handling \u003chttp://geduldig.github.io/TwitterAPI/errors.html\u003e`_\n* `Paging Results \u003chttp://geduldig.github.io/TwitterAPI/paging.html\u003e`_\n* `Tiny Examples \u003chttp://geduldig.github.io/TwitterAPI/examples.html\u003e`_\n* `Fault Tolerant Streams and Pages \u003chttp://geduldig.github.io/TwitterAPI/faulttolerance.html\u003e`_\n\nExtra Goodies\n-------------\nCommand-Line Utility (`examples/cli \u003chttps://github.com/geduldig/TwitterAPI/blob/master/examples/cli\u003e`_)\n","funding_links":[],"categories":["Python","Libraries","常用 Python 工具","Tools"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeduldig%2FTwitterAPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeduldig%2FTwitterAPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeduldig%2FTwitterAPI/lists"}