Missing media_url_https part in tweet details

api

#1

Hi Twitter community,

in our apllication we download basic data about individual tweets. For this purposes we use endpoint https://api.twitter.com/1.1/statuses/user_timeline.json. For most of our tweets we get correct results. But for some of them JSON contains restricted list of objects. In the JSON below you can see that for tweet
https://twitter.com/NESCAFEfr/status/821360183096045568 object media_url_https (image url) is available but for second tweet
https://twitter.com/NESCAFEfr/status/822372934027096065 this object is not present. Both tweets contain images, so Iā€™d expect to have in the JSON relevant information in both cases.

Do you have an idea why this is happening?

[
   {
      "created_at":"Fri Jan 20 09:19:21 +0000 2017",
      "id":822372934027096065,
      "id_str":"822372934027096065",
      "text":"La bonne r\u00e9solution 2017 ? R\u00e9duire de 11% votre empreinte carbone en utilisant notre format recharge.\u2026 https:\/\/t.co\/bA9tkf92IY",
      "truncated":true,
      "entities":{
         "hashtags":[

         ],
         "symbols":[

         ],
         "user_mentions":[

         ],
         "urls":[
            {
               "url":"https:\/\/t.co\/bA9tkf92IY",
               "expanded_url":"https:\/\/twitter.com\/i\/web\/status\/822372934027096065",
               "display_url":"twitter.com\/i\/web\/status\/8\u2026",
               "indices":[
                  103,
                  126
               ]
            }
         ]
      },
      "source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e",
      "in_reply_to_status_id":null,
      "in_reply_to_status_id_str":null,
      "in_reply_to_user_id":null,
      "in_reply_to_user_id_str":null,
      "in_reply_to_screen_name":null,
      "user":{
         "id":2161776235,
         "id_str":"2161776235",
         "name":"NESCAF\u00c9 France",
         "screen_name":"NESCAFEfr",
         "location":"France",
         "description":"Ici on d\u00e9connecte pour se reconnecter.\r\nIt all starts with a NESCAF\u00c9\r\nhttp:\/\/t.co\/3xFjGw41wY",
         "url":"https:\/\/t.co\/BVVCcHEW4X",
         "entities":{
            "url":{
               "urls":[
                  {
                     "url":"https:\/\/t.co\/BVVCcHEW4X",
                     "expanded_url":"https:\/\/www.facebook.com\/nescafe.fr",
                     "display_url":"facebook.com\/nescafe.fr",
                     "indices":[
                        0,
                        23
                     ]
                  }
               ]
            },
            "description":{
               "urls":[
                  {
                     "url":"http:\/\/t.co\/3xFjGw41wY",
                     "expanded_url":"http:\/\/www.nescafe.fr",
                     "display_url":"nescafe.fr",
                     "indices":[
                        70,
                        92
                     ]
                  }
               ]
            }
         },
         "protected":false,
         "followers_count":16987,
         "friends_count":546,
         "listed_count":62,
         "created_at":"Mon Oct 28 23:21:15 +0000 2013",
         "favourites_count":2282,
         "utc_offset":3600,
         "time_zone":"Paris",
         "geo_enabled":false,
         "verified":true,
         "statuses_count":1964,
         "lang":"fr",
         "contributors_enabled":false,
         "is_translator":false,
         "is_translation_enabled":false,
         "profile_background_color":"000000",
         "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
         "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
         "profile_background_tile":false,
         "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/481818682851467267\/0I0UG6Sn_normal.jpeg",
         "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/481818682851467267\/0I0UG6Sn_normal.jpeg",
         "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2161776235\/1485435802",
         "profile_link_color":"DD2E44",
         "profile_sidebar_border_color":"000000",
         "profile_sidebar_fill_color":"000000",
         "profile_text_color":"000000",
         "profile_use_background_image":false,
         "has_extended_profile":false,
         "default_profile":false,
         "default_profile_image":false,
         "following":false,
         "follow_request_sent":false,
         "notifications":false,
         "translator_type":"none"
      },
      "geo":null,
      "coordinates":null,
      "place":null,
      "contributors":null,
      "is_quote_status":false,
      "retweet_count":25,
      "favorite_count":113,
      "favorited":false,
      "retweeted":false,
      "possibly_sensitive":false,
      "lang":"fr"
   },
   {
      "created_at":"Tue Jan 17 14:15:02 +0000 2017",
      "id":821360183096045568,
      "id_str":"821360183096045568",
      "text":"Si vous aviez encore un doute sur la dose parfaite, faites confiance \u00e0 votre instinct ou \u00e0 nos sticks, c'est tout. https:\/\/t.co\/O0Rug7jK6c",
      "truncated":false,
      "entities":{
         "hashtags":[

         ],
         "symbols":[

         ],
         "user_mentions":[

         ],
         "urls":[

         ],
         "media":[
            {
               "id":821360075621203969,
               "id_str":"821360075621203969",
               "indices":[
                  115,
                  138
               ],
               "media_url":"http:\/\/pbs.twimg.com\/media\/C2YOoxQXAAENZo6.jpg",
               "media_url_https":"https:\/\/pbs.twimg.com\/media\/C2YOoxQXAAENZo6.jpg",
               "url":"https:\/\/t.co\/O0Rug7jK6c",
               "display_url":"pic.twitter.com\/O0Rug7jK6c",
               "expanded_url":"https:\/\/twitter.com\/NESCAFEfr\/status\/821360183096045568\/photo\/1",
               "type":"photo",
               "sizes":{
                  "medium":{
                     "w":720,
                     "h":720,
                     "resize":"fit"
                  },
                  "small":{
                     "w":680,
                     "h":680,
                     "resize":"fit"
                  },
                  "thumb":{
                     "w":150,
                     "h":150,
                     "resize":"crop"
                  },
                  "large":{
                     "w":720,
                     "h":720,
                     "resize":"fit"
                  }
               }
            }
         ]
      },
      "extended_entities":{
         "media":[
            {
               "id":821360075621203969,
               "id_str":"821360075621203969",
               "indices":[
                  115,
                  138
               ],
               "media_url":"http:\/\/pbs.twimg.com\/media\/C2YOoxQXAAENZo6.jpg",
               "media_url_https":"https:\/\/pbs.twimg.com\/media\/C2YOoxQXAAENZo6.jpg",
               "url":"https:\/\/t.co\/O0Rug7jK6c",
               "display_url":"pic.twitter.com\/O0Rug7jK6c",
               "expanded_url":"https:\/\/twitter.com\/NESCAFEfr\/status\/821360183096045568\/photo\/1",
               "type":"photo",
               "sizes":{
                  "medium":{
                     "w":720,
                     "h":720,
                     "resize":"fit"
                  },
                  "small":{
                     "w":680,
                     "h":680,
                     "resize":"fit"
                  },
                  "thumb":{
                     "w":150,
                     "h":150,
                     "resize":"crop"
                  },
                  "large":{
                     "w":720,
                     "h":720,
                     "resize":"fit"
                  }
               }
            }
         ]
      },
      "source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e",
      "in_reply_to_status_id":null,
      "in_reply_to_status_id_str":null,
      "in_reply_to_user_id":null,
      "in_reply_to_user_id_str":null,
      "in_reply_to_screen_name":null,
      "user":{
         "id":2161776235,
         "id_str":"2161776235",
         "name":"NESCAF\u00c9 France",
         "screen_name":"NESCAFEfr",
         "location":"France",
         "description":"Ici on d\u00e9connecte pour se reconnecter.\r\nIt all starts with a NESCAF\u00c9\r\nhttp:\/\/t.co\/3xFjGw41wY",
         "url":"https:\/\/t.co\/BVVCcHEW4X",
         "entities":{
            "url":{
               "urls":[
                  {
                     "url":"https:\/\/t.co\/BVVCcHEW4X",
                     "expanded_url":"https:\/\/www.facebook.com\/nescafe.fr",
                     "display_url":"facebook.com\/nescafe.fr",
                     "indices":[
                        0,
                        23
                     ]
                  }
               ]
            },
            "description":{
               "urls":[
                  {
                     "url":"http:\/\/t.co\/3xFjGw41wY",
                     "expanded_url":"http:\/\/www.nescafe.fr",
                     "display_url":"nescafe.fr",
                     "indices":[
                        70,
                        92
                     ]
                  }
               ]
            }
         },
         "protected":false,
         "followers_count":16987,
         "friends_count":546,
         "listed_count":62,
         "created_at":"Mon Oct 28 23:21:15 +0000 2013",
         "favourites_count":2282,
         "utc_offset":3600,
         "time_zone":"Paris",
         "geo_enabled":false,
         "verified":true,
         "statuses_count":1964,
         "lang":"fr",
         "contributors_enabled":false,
         "is_translator":false,
         "is_translation_enabled":false,
         "profile_background_color":"000000",
         "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
         "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png",
         "profile_background_tile":false,
         "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/481818682851467267\/0I0UG6Sn_normal.jpeg",
         "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/481818682851467267\/0I0UG6Sn_normal.jpeg",
         "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/2161776235\/1485435802",
         "profile_link_color":"DD2E44",
         "profile_sidebar_border_color":"000000",
         "profile_sidebar_fill_color":"000000",
         "profile_text_color":"000000",
         "profile_use_background_image":false,
         "has_extended_profile":false,
         "default_profile":false,
         "default_profile_image":false,
         "following":false,
         "follow_request_sent":false,
         "notifications":false,
         "translator_type":"none"
      },
      "geo":null,
      "coordinates":null,
      "place":null,
      "contributors":null,
      "is_quote_status":false,
      "retweet_count":1190,
      "favorite_count":568,
      "favorited":false,
      "retweeted":false,
      "possibly_sensitive":false,
      "lang":"fr"
   }
]

#2

Can you try using tweet_mode=extended on the API call? This is a result of the change to enable longer Tweets by excluding media attachments from 140 characters. The first Tweet shows truncated: true indicating that it is an extended Tweet.


#3

Hi Andy,

yes it works. Thank you.

Tomas


#4