Twitterapi

Minimal python wrapper for Twitter's REST and Streaming APIs
Alternatives To Twitterapi
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Oatpp6,238
4 days ago150apache-2.0C++
🌱Light and powerful C++ web framework for highly scalable and resource-efficient web application. It's zero-dependency and easy-portable.
Examples4,294
a year ago14JavaScript
Example Koa apps
Twitterapi906446119 days ago120June 06, 2022Python
Minimal python wrapper for Twitter's REST and Streaming APIs
Firesharp6676542 months ago17May 10, 201678unlicenseC#
An asynchronous cross-platform .Net library for Firebase
Teslams38226123 years ago65December 01, 201815bsd-3-clauseJavaScript
Tesla node.js apps and javascript libraries using Tesla's HTTP interfaces
Dozer298
an hour ago102otherRust
Connect any data source, combine them in real-time and instantly get low-latency Data APIs. All with just a simple configuration!
Oandapy275
2 years ago28mitPython
Python wrapper for the OANDA REST API
Twitter4s258121 days ago17May 21, 202246apache-2.0Scala
An asynchronous non-blocking Scala client for both the Twitter Rest and Streaming API
Kreya208
a month ago28JavaScript
Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
Coral150
4 years agoapache-2.0Scala
Coral is a real-time analytics and data science platform. It transforms streaming events and extract patterns from data via RESTful APIs. Built on Scala, Akka, Cassandra and Spray.
Alternatives To Twitterapi
Select To Compare


Alternative Project Comparisons
Readme

LOGO

TwitterAPI is a minimal python wrapper for the TwitterAPIs. A list of what it can do:

  • Support for all V1.1 and V2 endpoints, plus Premium, Ads, Labs, Collections.
  • OAuth1 and bearer token authentication, and proxy server authentication.
  • Streaming endpoints.
  • Paging results.
  • The option to "hydrate" results returned by V2 endpoints.
  • Error handling.

Installation

> pip install TwitterAPI

Twitter API Version 1.1 Code Snippets

[More examples in TwitterAPI/examples/v1.1]

Search for recent tweets

from TwitterAPI import TwitterAPI
api = TwitterAPI(consumer_key, consumer_secret, access_token_key, access_token_secret)
r = api.request('search/tweets', {'q':'pizza'})
for item in r:
        print(item)

Stream tweets from New York City as they get tweeted

r = api.request('statuses/filter', {'locations':'-74,40,-73,41'})
for item in r:
        print(item)

Twitter API Version 2 Code Snippets

[More examples in TwitterAPI/examples/v2 ]

Search for recent tweets, and specify fields and expansions

from TwitterAPI import TwitterAPI
api = TwitterAPI(consumer_key, consumer_secret, access_token_key, access_token_secret, api_version='2')
r = api.request('tweets/search/recent', {
        'query':'pizza',
        'tweet.fields':'author_id',
        'expansions':'author_id'})
for item in r:
        print(item)

One Method For Everything

The 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.

The 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 library documentation for more details.

Documentation

Extra Goodies

Command-Line Utility (examples/cli)

Popular Streaming Projects
Popular Rest Projects
Popular Networking Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Python
Rest
Twitter
Streaming
Twitter Api
Twitter Client