Python - verify_credentials return without the email


  • the app is white listed
  • got the terms of service & privacy policy
  • checked the check box to fetch email

using the following code:

twitter = Twython(app_key=TWITTER_CONSUMER_KEY,

obj = twitter.verify_credentials(
    include_email="true", skip_status=1, include_entities=0)
if "email" in obj.keys():
    return obj["email"]twitter = Twython(app_key=settings.TWITTER_CONSUMER_KEY,
obj = twitter.verify_credentials(
    include_email="true", skip_status=1, include_entities=0)
if "email" in obj.keys():
    return obj["email"]

also tried:

verify_creds_url = ''
    consumer = oauth.Consumer(settings.TWITTER_CONSUMER_KEY,
    token = oauth.Token(settings.TWITTER_ACCESS_TOKEN,
    client = oauth.Client(consumer, token)
    resp, content = client.request(verify_creds_url, "GET")

keep not getting the email
checking on a verified twitter user with a verified email…

any thoughts? what have i missed? at the beginning i though maybe it doesn’t work because the authorization key doesn’t include the params but skip_status works great so it can’t really be that


Have you invalidated any existing user token and had the user sign in to your app again, to get the new privileges?


by revalidating the user you mean had the authorize screen to revalidate the user to allow getting the email?
if so this is done


OK great.

As another debugging step, are you able to use twurl with the same app ID and consumer tokens to hit the verify_credentials endpoint? I guess you’ll see the same result as in your second code snippet, just wondering.

You could try regenerating your app access token and secret and then re-authenticating, but that should not be required.


I just tried this in the REPL (formatting added to show the email entity)

Python 2.7.12 (default, Jul 18 2016, 12:29:00)
[GCC 4.2.1 Compatible Apple LLVM 7.3.0 (clang-703.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from twython import Twython
>>> twitter = Twython(app_key="xxxxxxx",
... app_secret="xxxxxxx",
... oauth_token="xxxxxxx",
... oauth_token_secret="xxxxxxx")
>>> obj = twitter.verify_credentials(
...     include_email="true", skip_status=1, include_entities=0)
>>> obj
{u'follow_request_sent': False, u'has_extended_profile': True, u'profile_use_background_image': True, u'default_profile_image': False, u'id': 786491, u'profile_background_image_url_https': u'', u'verified': False, u'profile_text_color': u'333333', 
u'profile_image_url_https': u'', u'profile_sidebar_fill_color': u'F6F6F6', u'entities': {u'url': {u'urls': [{u'url': u'', u'indices': [0, 23], u'expanded_url': u'', u'display_url': u''}]}, 
u'description': {u'urls': []}}, u'followers_count': 13541, u'profile_sidebar_border_color': u'FFFFFF', u'id_str': u'786491', u'profile_background_color': u'ACDEEE', 
*u'email': u'xxxxxxx@xxxxxx.xxxxx'* <----
, u'listed_count': 781, u'is_translation_enabled': False, u'utc_offset': 3600, u'statuses_count': 89892, u'description': u"I'm on the @TwitterDev team, supporting and listening to developers working on the Twitter platform. Code, community, and respect. #HeForShe", u'friends_count': 3899, u'location': u'Kingston upon Thames, London', 
u'profile_link_color': u'6EA8E6', u'profile_image_url': u'', u'following': False, u'geo_enabled': True, u'profile_banner_url': u'', 
u'profile_background_image_url': u'', u'screen_name': u'andypiper', u'lang': u'en', u'profile_background_tile': False, u'favourites_count': 65502, u'name': u'Pipes', u'notifications': False, 
u'url': u'', u'created_at': u'Wed Feb 21 15:14:48 +0000 2007', u'contributors_enabled': False, u'time_zone': u'London', u'protected': False, u'default_profile': False, u'is_translator': False}