Search code examples
twittertwitter4j

Twitter API returns Link to tweet while tweet has no link


I have a tweet in my timeline which has no link. When I retrieve my tweets via the twitter API it contains a link which refers to the tweet itself, e.g.:

"expanded_url": "https://twitter.com/i/web/status/<tweed-id>",

Is this intented behaivior? I searched for this in the twitter API Docs but was not able to find anything.


Solution

  • If you check the Tweet JSON and it contains the field truncated: true then you need to use the tweet_mode=extended parameter to retrieve the complete Tweet object.