Search code examples
pythontwittertweepy

tweepy twitter api stream status objects vs api search status objects - timestamp_ms / created_at difference?


is there documentation on the tweepy streaming api that describes why the timestamp_ms as well as the created_at fields are present in the json, and why for tweepy search api the timestamp_ms attribute is excluded but created_at is given?

i have a small mini library of helpers to standardize a bunch of my twitter api operations. i was surprised when i started passing my mini library of helpers tweepy search status objects that it threw an error saying no timestamp_ms attribute is there. i searched a few diff times for sort of a 'reason' here and want to better understand the "why" and also to sort of confirm what i am seeing as i inspect these objects


Solution

  • The create_at field is present in all tweet status objects (returned by search or streaming). It's the date/time stamp of when the tweet was created.

    The timestamp_ms is present only in the real time stream and indicates when the object that contains the timestamp was added to the stream. It is not necessarily a tweet status object. Could be a deletion event, for example.

    More info here... https://twittercommunity.com/t/adding-new-features-to-streaming-api/15214