Missed shared urls in API response

php
api

#1

I have PHP script that parses twitter page https://twitter.com/tag24owl each few minutes and gets posted urls in each post.
All the posts that are posted on the page have a link to an external website. The problem is next: some of the tweets, in the response from API, have only the link to itself, but not the original one that user can see in browser.
For example post with id 783930571114352640 ( https://t.co/VmGbL7IAqZ ) has an external link, but inside of the API answer I receive only link like https://twitter.com/i/web/status/… and it’s shortened version (response.entities.urls[0]). And nowhere the original link could be found. Even in text of the tweet I can see only shortened version of the link to the tweet.

Original tweet text:

Mächtig viel Kohle für den #DSC! Fünf Millionen winken in der nächsten Saison. #Bielefeld #Bundesliga #DFL 
https://www.tag24.de/nachrichten/fussball-bundesliga-dsc-arminia-bielefeld-geld-tv-vertrag-dfl-gerrit-meinke-170398

Tweet, as response from API:

Text:

Mächtig viel Kohle für den #DSC! Fünf Millionen winken in der nächsten Saison. #Bielefeld #Bundesliga #DFL 
https://t.co/VmGbL7IAqZ

Urls:

[urls] => Array
                (
                    [0] => stdClass Object
                        (
                            [url] => https://t.co/VmGbL7IAqZ
                            [expanded_url] => https://twitter.com/i/web/status/783930571114352640
                            [display_url] => twitter.com/i/web/status/7
                            [indices] => Array
                                (
                                    [0] => 108
                                    [1] => 131
                                )

                        )

                )

Are there any possibility to get the original link for these tweets?


#2

This is an extended tweet as identified by the truncated flag. You need to use tweet_mode=extended on all endpoints that return tweets


#3

Thanks alot! Your solution solved my problem.