Streaming tweets that stem from a tweet from a certain user



I was wondering if there was a method free (or paid) that can stream tweets that have replied to a specific user or is a follow on tweet from the same specific user.

For example, just say the specific user is @realdonaldtrump. I would like to access all the tweets that have followed on from a tweet from @realdonaldtrump.

My aim is to analyse conversation lengths of a specific user rather than a topic (which is how I stream at the moment).

I am able to just sort the data that I stream from entering the search term realdonaldtrump, such that I only use data which stems from the user @realdonaldtrump but I would like to maximise the data points that I can capture through streaming because a lot of tweets replying to @realdonaldtrump won’t have that term in the tweet.



You could use the is:reply operator in the enterprise PowerTrack API. This is not available in the standard streaming API.


Thanks Andy.

That is kind of what I’m looking for, however is that referencing the in_reply_to_user_id? If it is, it would only find the first tweet that replied to @realdonaldtrump and all my conversations would be of length 2. Or does this reference “people in conversation” (see pics) that is visible when browsing twitter through the browser or app. From what I could see this information isn’t available in a single tweet and is generated, but I could be wrong and will be happily corrected.


Hi @dshandler - the Tweet payload returns an in_reply_to_status_id field. Taking your example, you could pass a query that would return all Tweets that respond directly to the first Tweet of the thread (the original Tweet). You would get a series of Tweets back, all of which are a direct response to the original Tweet. Example query below (using Historical PowerTrack).

So to answer your first question: with this example query, the number of Tweets returned would be a lot more than 2.


However, this example request would not pick up on “sub-conversations”, such as the Tweet you screenshotted.

I’ve pasted below the first part of the Tweet payload that corresponds to the Tweet in your screenshot. You can see that the in_reply_to_status_id field references a different status id: this is the status id that the user was directly responding to here (and not the status id that first started the thread).

If you wanted to know all the “people in conversation”, you can use the user_mentions field to see all people who are included in this response (including the very first user who started the thread).

  "created_at": "Wed Dec 05 00:33:51 +0000 2018",
  "id": 1070113988245999616,
  "id_str": "1070113988245999616",
  "full_text": "@jstrong244 @krassenstein @EdKrassen @realDonaldTrump Cant handle the truth mate?",
  "truncated": false,
  "display_text_range": [
  "entities": {
    "hashtags": [],
    "symbols": [],
    "user_mentions": [
        "screen_name": "jstrong244",
        "name": "Jasaplay",
        "id": 2868067125,
        "id_str": "2868067125",
        "indices": [
        "screen_name": "krassenstein",
        "name": "Brian Krassenstein",
        "id": 133938408,
        "id_str": "133938408",
        "indices": [
        "screen_name": "EdKrassen",
        "name": "Ed Krassenstein",
        "id": 132339474,
        "id_str": "132339474",
        "indices": [
        "screen_name": "realDonaldTrump",
        "name": "Donald J. Trump",
        "id": 25073877,
        "id_str": "25073877",
        "indices": [
    "urls": []
  "source": "<a href=\"http:\/\/\" rel=\"nofollow\">Twitter Web Client<\/a>",
  "in_reply_to_status_id": 1070113599199371265,
  "in_reply_to_status_id_str": "1070113599199371265",
  "in_reply_to_user_id": 2868067125,
  "in_reply_to_user_id_str": "2868067125",
  "in_reply_to_screen_name": "jstrong244",
  "user": {
    "id": 830612821155082241,
    "id_str": "830612821155082241",
    "name": "Vince Smith",
    "screen_name": "TheNutter64",
    "location": "Brisbane, Queensland",
    "description": "",
    "url": null,
    "entities": {
      "description": {
        "urls": []