Basic Usage

This section will cover how to use Twython and interact with some basic Twitter API calls

Before you make any API calls, make sure you authenticated the user!

Create a Twython instance with your application keys and the users OAuth tokens:

from twython import Twython
twitter = Twython(APP_KEY, APP_SECRET
                  OAUTH_TOKEN, OAUTH_TOKEN_SECRET)

Important

All sections on this page will assume you’re using a Twython instance

What Twython Returns

Twython returns a dictionary of JSON response from Twitter

User Information

Documentation: https://dev.twitter.com/docs/api/1.1/get/account/verify_credentials

twitter.verify_credentials()

Authenticated Users Home Timeline

Documentation: https://dev.twitter.com/docs/api/1.1/get/statuses/home_timeline

twitter.get_home_timeline()

Updating Status

Documentation: https://dev.twitter.com/docs/api/1/post/statuses/update

twitter.update_status(status='See how easy using Twython is!')

Table Of Contents

Previous topic

Starting Out

Next topic

Developer Interface

This Page