All Projects → geduldig → Twitterapi

geduldig / Twitterapi

Minimal python wrapper for Twitter's REST and Streaming APIs

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Twitterapi

Awesome Twitter Tools
A curated list of awesome twitter tools
Stars: ✭ 113 (-84.39%)
Mutual labels:  twitter-api, twitter-client, twitter
Surfbird
A Microblogging client built on Electron and Vue
Stars: ✭ 309 (-57.32%)
Mutual labels:  twitter-api, twitter-client, twitter
Twitter Api Php
The simplest PHP Wrapper for Twitter API v1.1 calls
Stars: ✭ 1,808 (+149.72%)
Mutual labels:  twitter-api, twitter-client, twitter
Twitter.jl
Julia package to access Twitter API
Stars: ✭ 58 (-91.99%)
Mutual labels:  twitter-api, twitter-client, twitter
Harpy
A Twitter app built with Flutter
Stars: ✭ 211 (-70.86%)
Mutual labels:  twitter-api, twitter-client, twitter
Birdy
A super awesome Twitter API client for Python.
Stars: ✭ 259 (-64.23%)
Mutual labels:  twitter-api, twitter-client
Coretweet
Yet Another .NET Twitter Library
Stars: ✭ 281 (-61.19%)
Mutual labels:  twitter-api, twitter
Twitter Lite
A tiny, full-featured, flexible client / server library for the Twitter API
Stars: ✭ 611 (-15.61%)
Mutual labels:  twitter-api, twitter
Mastodon Twitter Poster
Crossposter to post statuses between Mastodon and Twitter
Stars: ✭ 317 (-56.22%)
Mutual labels:  twitter-api, twitter
TwitterPiBot
A Python based bot for Raspberry Pi that grabs tweets with a specific hashtag and reads them out loud.
Stars: ✭ 85 (-88.26%)
Mutual labels:  twitter, twitter-api
Twitter Api V2 Sample Code
Sample code for the Twitter API early access endpoints (Python, Java, Ruby, and Node.js).
Stars: ✭ 306 (-57.73%)
Mutual labels:  twitter-api, twitter
Social Amnesia
Forget the past. Social Amnesia makes sure your social media accounts only show your posts from recent history, not from "that phase" 5 years ago.
Stars: ✭ 656 (-9.39%)
Mutual labels:  twitter-api, twitter
Twitter Scraper
Scrape the Twitter Frontend API without authentication.
Stars: ✭ 3,037 (+319.48%)
Mutual labels:  twitter-api, twitter
archive-explorer-web
Browse your Twitter archive with a friendly, responsive, full experience, and quickly delete the tweets you don't want.
Stars: ✭ 19 (-97.38%)
Mutual labels:  twitter, twitter-api
markdown-tweet-scheduler
Schedule daily tweets from markdown files in your repo, posted via github actions.
Stars: ✭ 49 (-93.23%)
Mutual labels:  twitter, twitter-api
Tweetie
Simple jQuery Twitter feed plugin
Stars: ✭ 314 (-56.63%)
Mutual labels:  twitter-api, twitter
Search Tweets Python
Python client for the Twitter search endpoints (v2/Labs/premium/enterprise). Now supports Twitter API v2 /recent and /all search endpoints.
Stars: ✭ 378 (-47.79%)
Mutual labels:  twitter-api, twitter
Tweetbotornot
🤖 R package for detecting Twitter bots via machine learning
Stars: ✭ 355 (-50.97%)
Mutual labels:  twitter-api, twitter
Twitter Sort
🐦 Sort numbers with some help from the Twitter API
Stars: ✭ 384 (-46.96%)
Mutual labels:  twitter-api, twitter
Twitteroauth
The most popular PHP library for use with the Twitter OAuth REST API.
Stars: ✭ 4,134 (+470.99%)
Mutual labels:  twitter-api, twitter

|LOGO|

|BADGE_VERSION| |BADGE_CHAT|

|BADGE_1.1| |BADGE_PREMIUM| |BADGE_2| |BADGE_ADS8| |BADGE_LABS|

.. |LOGO| image:: https://raw.githubusercontent.com/geduldig/TwitterAPI/master/logo.png .. |BADGE_VERSION| image:: http://img.shields.io/pypi/v/TwitterAPI.svg :target: https://crate.io/packages/TwitterAPI .. |BADGE_CHAT| image:: https://badges.gitter.im/Join%20Chat.svg :alt: Join the chat at https://gitter.im/geduldig/TwitterAPI :target: https://gitter.im/geduldig/TwitterAPI?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

.. |BADGE_2| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fv2 :target: https://developer.twitter.com/en/docs/twitter-api .. |BADGE_LABS| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Flabs :target: https://developer.twitter.com/en/docs/labs .. |BADGE_ADS8| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fadsv8 :target: https://developer.twitter.com/en/docs/twitter-ads-api .. |BADGE_1.1| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fstandard :target: https://developer.twitter.com/en/docs/twitter-api .. |BADGE_PREMIUM| image:: https://img.shields.io/endpoint?url=https%3A%2F%2Ftwbadges.glitch.me%2Fbadges%2Fpremium :target: https://developer.twitter.com

TwitterAPI is a Python package for accessing Twitter's REST APIs and Streaming APIs. It supports both Version 1.1 and Version 2 endpoints.

REST APIs that are supported are: Public API, Collections API, Curator API, Ads API, Webhook API, Premium Search API.

NEW -- Twitter API Version 2!!

By default TwitterAPI will permit only Version 1.1 endpoints. To start using Verson 2 endpoint you must supply the api_version parameter:

api = TwitterAPI(consumer_key, consumer_secret, access_token_key, access_token_secret, api_version='2')

Check the examples folder for more information on making requests using Version 2 endpoints.

Installation

From the command line::

pip install TwitterAPI

Documentation

  • An Introduction <http://geduldig.github.com/TwitterAPI>_
  • Authentication <http://geduldig.github.com/TwitterAPI/authentication.html>_
  • Error Handling <http://geduldig.github.com/TwitterAPI/errors.html>_
  • Paging Results <http://geduldig.github.com/TwitterAPI/paging.html>_
  • Tiny Examples <http://geduldig.github.com/TwitterAPI/examples.html>_
  • Fault Tolerant Streams and Pages <http://geduldig.github.com/TwitterAPI/faulttolerance.html>_

Some Code...

[See TwitterAPI/examples <https://github.com/geduldig/TwitterAPI/tree/master/examples>_ for working examples.]

First, authenticate with your application credentials::

from TwitterAPI import TwitterAPI
api = TwitterAPI(consumer_key, consumer_secret, access_token_key, access_token_secret)

Tweet something::

r = api.request('statuses/update', {'status':'This is a tweet!'})
print(r.status_code)

Get tweet by its id::

r = api.request('statuses/show/:%d' % 210462857140252672)
print(r.text)

Get some tweets::

r = api.request('search/tweets', {'q':'pizza'})
for item in r:
	print(item)

Stream tweets from New York City::

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

Notice that request() works with all endpoints found in either the REST APIs or the Streaming APIs. Usually request() takes two arguments: a Twitter endpoint and a dictionary of endpoint parameters. The above examples use get_iterator() to consume each tweet object. The iterator knows how to iterate results returned from either the REST APIs or the Streaming APIs.

You also have access to the response object returned by request(). From a response object r you can get the raw response with r.text and the HTTP status code with r.status_code. See the requests <http://docs.python-requests.org/en/latest/user/quickstart/>_ library documentation for more details.

Extra Goodies

Command-Line Utility (examples/cli <https://github.com/geduldig/TwitterAPI/blob/master/examples/cli>_)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].