Answers.Body: <p>There should actually be a <code>entities.media</code> property available in the JSON, when there are images attached to the tweet.</p>
  
  <p>This is what works for me:</p>
  
  <pre><code>{% set tweets = craft.twitter.get('statuses/user_timeline') %}
  
  {% for tweet in tweets %}
      &lt;li&gt;
          &lt;p&gt;{{ tweet.text }}&lt;/p&gt;
  
          {% if tweet.entities.media is defined %}
              {% for item in tweet.entities.media if item.type == 'photo' %}
                  &lt;img src="{{ item.media_url }}"&gt;
              {% endfor %}
          {% endif %}
      &lt;/li&gt;
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-17T15:58:42.537Z
Answers.Text: Brilliant thanks Carl, this is what I was starting to get to by testing different profiles. Turns out this doesn't cover images that have come from them embedding a link (I don't think), I may revert to directly embedding the default card style it's pretty nice these days
Answers.UserDisplayName: André Goldstein
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-17T16:17:03.963Z
Answers.Text: Ahh yeah, I don’t think Twitter Cards images are available form the API.
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-18T05:44:19.660Z
Answers.Text: Thanks André, I posted a similar question [http://craftcms.stackexchange.com/questions/17059/twitter-api-request-for-images-with-dukt-twitter] and couldn't work out how to pickup the media URLs - let us know what you ended up doing, perhaps with an example as the Plugin's docs are rather succinct.
Answers.UserDisplayName: Nutmeg
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-18T06:21:30.273Z
Answers.Text: @nutmeg the Twitter API returns all media with the `entities` property. What kind of data are you missing? Usual links to websites that are extended as Twitter Cards?
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T00:09:53.873Z
Answers.Text: Has anyone else had an issue where long tweets, that include an image, are being truncated, and not showing the image?  Any help on this would be greatly appreciated. Here is an example of two tweets with the same image http://yak.la/temp/jm.png
Answers.UserDisplayName: SteveO
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T05:18:52.200Z
Answers.Text: I solved my issue. You must use the api parameter: tweet_mode:'extended', then call {{tweet.full_text|autoLinkTweet}}
Answers.UserDisplayName: SteveO
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-21T06:27:13.100Z
Answers.Text: @SteveO nice! Might want to post a dedicated answer for it?
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-17T04:05:45.373Z
Answers.Text: @SteveO Do you mind sharing your code?
Answers.UserDisplayName: Nutmeg
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-14T09:01:36.043Z
Answers.Text: Where would you add the api parameter tweet_mode:'extended'?
Answers.UserDisplayName: Nutmeg
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-17T15:44:51.570Z
Answers.LastActivityDate: 2016-10-17T15:44:51.570Z
Answers.UserDisplayName: carlcs
Body: <p>I'm using Dukt's very nice Twitter plugin and it's working nicely returning the most recent tweet as I want, however I cannot seem to access the tweet's image. Is this possible?</p>
  
  <pre><code>{% set tweets = craft.twitter.get("statuses/user_timeline.json?screen_name=#{twitterHandle}&amp;count=1&amp;exclude_replies=true&amp;include_rts=true&amp;include_entities=true") %}
  </code></pre>
  
  <p>I've tried adding <code>&amp;include_entities=true</code></p>
  
  <p>When I print out the json, I can't seem to see any media URLs. Has anyone else had any joy here? Thanks</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-17T15:22:41.063Z
Comments.Text: Hmm digging around further using Twitter's test console https://dev.twitter.com/rest/tools/console seems maybe the images I'm seeing in the tweets were only coming from the client embedding a URL which was autounfurled in Twitter
Comments.UserDisplayName: André Goldstein
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-08T18:38:21.370Z
Comments.Text: Has anyone had issues with this only working sporadically? I have a feed where images show up on some tweets but not others. Any help would be greatly appreciated.
Comments.UserDisplayName: SteveO
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-02-10T15:29:16.150Z
Comments.Text: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://craftcms.stackexchange.com/questions/ask). You can also [add a bounty](https://craftcms.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/6281)
Comments.UserDisplayName: Robin Schambach
Tags: <plugin-dukttwitter>
Title: Is it possible to get a tweet image when using Twitter plugin
ThreadText: # Is it possible to get a tweet image when using Twitter plugin
  
  (Asked by: username_0 on 2016-10-17)
  
  I'm using Dukt's very nice Twitter plugin and it's working nicely returning the most recent tweet as I want, however I cannot seem to access the tweet's image. Is this possible?
  
  ```
  {% set tweets = craft.twitter.get("statuses/user_timeline.json?screen_name=#{twitterHandle}&count=1&exclude_replies=true&include_rts=true&include_entities=true") %}
  
  ```
  
  I've tried adding `&include_entities=true`
  
  When I print out the json, I can't seem to see any media URLs. Has anyone else had any joy here? Thanks
  
  **Tags:** plugin-dukttwitter
  
  > **Comments:**
  > **username_0**: Hmm digging around further using Twitter's test console https://dev.twitter.com/rest/tools/console seems maybe the images I'm seeing in the tweets were only coming from the client embedding a URL which was autounfurled in Twitter  
  > **username_1**: Has anyone had issues with this only working sporadically? I have a feed where images show up on some tweets but not others. Any help would be greatly appreciated.  
  > **username_2**: This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://craftcms.stackexchange.com/questions/ask). You can also [add a bounty](https://craftcms.stackexchange.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/low-quality-posts/6281)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2016-10-17. Score: 4 | Accepted answer
  
  There should actually be a `entities.media` property available in the JSON, when there are images attached to the tweet.
  
  This is what works for me:
  
  ```
  {% set tweets = craft.twitter.get('statuses/user_timeline') %}
  
  {% for tweet in tweets %}
      <li>
          <p>{{ tweet.text }}</p>
  
          {% if tweet.entities.media is defined %}
              {% for item in tweet.entities.media if item.type == 'photo' %}
                  <img src="{{ item.media_url }}">
              {% endfor %}
          {% endif %}
      </li>
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: Brilliant thanks Carl, this is what I was starting to get to by testing different profiles. Turns out this doesn't cover images that have come from them embedding a link (I don't think), I may revert to directly embedding the default card style it's pretty nice these days  
  > **username_3**: Ahh yeah, I don’t think Twitter Cards images are available form the API.  
  > **username_4**: Thanks username_0, I posted a similar question [http://craftcms.stackexchange.com/questions/17059/twitter-api-request-for-images-with-dukt-twitter] and couldn't work out how to pickup the media URLs - let us know what you ended up doing, perhaps with an example as the Plugin's docs are rather succinct.  
  > **username_3**: @username_4 the Twitter API returns all media with the `entities` property. What kind of data are you missing? Usual links to websites that are extended as Twitter Cards?  
  > **username_1**: Has anyone else had an issue where long tweets, that include an image, are being truncated, and not showing the image?  Any help on this would be greatly appreciated. Here is an example of two tweets with the same image http://yak.la/temp/jm.png  
  > **username_1**: I solved my issue. You must use the api parameter: tweet_mode:'extended', then call {{tweet.full_text|autoLinkTweet}}  
  > **username_3**: @username_1 nice! Might want to post a dedicated answer for it?  
  > **username_4**: @username_1 Do you mind sharing your code?  
  > **username_4**: Where would you add the api parameter tweet_mode:'extended'?  
  
  ---
  
  