How to get all new favorites of user foo since last fetch?


My last post was flagged, not sure why. So i’ll simply ask it again as a question. Any advice would be greatly appreciated.

A different, yet similar question, “How do I list a user’s favorites in order of ‘favorited at’, not the order of when the status was created?”


Related questions:

Clarification regarding User Stream Connection limitations

What endpoint are you using? favorites/list? You can try to set since_id depending on what you’re using it for. Otherwise you’ll have to store the stuff you already fetched and ignore it if it’s already been added.


Yeah, favorites/list. Unfortunately, since_id will not work, as my user could easily favorite a tweet from a later time, even weeks in the past. It’s a fairly common behavior. Right now I have to continuously deep crawl all favorites.


Edit: The content in this post is incorrect, refer to posts below.

@rromanchuk that endpoint should be returning in order based on when it was favorited. If you’re trying to use since_id try to use both the tweet id and the favorite id (they’re different).


Last I checked it was sorted based on when the status was created, not when the status was favorited.


There is no such thing as a favorite id, it’s simply the id of the status, therefore since_id/mac_id are basically nonsensical in context of when the user took the action. There is also no way to get the timestamp of when the action was done (no top level meta data)


Interesting I never remember it being an issue, if this is the case then the endpoint is flawed since you could sort it by yourself.


I’ve never actually noticed this as a problem, I guess because most people tend to favourite based on their current home timelines.

It would make sense to allow us to refresh with since_id based on favourite time rather than status creation date though


Most cases yeah, but I have caught myself landing on someone’s profile and favoriting historical tweets. It also gets fuzzy with searches and trending content where the feed is curated by twitter.


I’m facing this issue as well.

There’s no problem using since_id/max_id combination in most cases, as naturally users favorite recent tweets mostly.

However, it’s a possibility that a user favorites an old tweet from the past. A tweet like that will not appear at the list’s top when fetching the endpoint in question:

This is a problem I’d love to see addressed.


As a matter of fact, I ended up with the following strategy:

  1. pull all favorites for a user, via REST API endpoint,
  2. start a streaming process,
  3. when events arrive to the process, only pick events marked as “favorites”.