API returns url to Twitter's status update at the end of the text


Hi all,
It looks like the API appends the url to tweet at the end of the text when there’s a picture attached to the tweet.

So for instance if I post a tweet saying:

“hello world google.com” and attach a picture to it, this is what the API returns in the text field

[text] => hello world http://t.co/kvIVnFEHhs http://t.co/G5emQJnkof

The documentation doesn’t mention anything about it, and it seems like there isn’t an option to turn off this feature.
Any ideas?


Not sure if it’s explicitly stated in the developer documentation but it’s listed in the user support page.

Your Tweet’s character count will update to include the pic.twitter.com URL for your photo(s).


The official Twitter apps remove the picture url and quoted status urls programmatically at the app end.

I wonder if @andypiper could clarify for us if we are allowed to do the same (so long as we actually display the quoted tweet or attached image) as I.2.1 of the Developer Rules say

Do not modify, translate or delete a portion of the Content.


Excellent question that I cannot answer directly from my brain at the moment - I’ll see what I can find out.


Thanks @andypiper


Thanks everyone for the insight.
And for pointing out that the same behaviour occurs for re-tweets, I didn’t notice that.


Hey everyone, Great question! We ask that you don’t disable or modify the URLs generated with this behavior per the below policies (https://dev.twitter.com/overview/terms/agreement-and-policy)

Do not modify, translate or delete a portion of the Content.
Maintain the features and functionality of Content and Twitter API. Do not interfere with, intercept, disrupt, filter, or disable any features of Twitter or the Twitter API, including the Content of embedded Tweets and embedded timelines.

Thanks for bringing this up! Let us know if you need any additional clarification.


Thanks @aaronhoff so by that I take it to mean that if we show the embedded tweet inline (like Twitter.com does) we cannot remove the link though (like Twitter.com does)



Anybody know how to resolve that?



This discussion is over a year old. What exactly is the issue you are seeing?


Akash, Aaron already mentioned thact according to twitter policy you do not have permission to modify the content of the tweet.
In case you plan to go against the policy, the api returns the start and end indices for each url, you could easily use these to remove the links.


It appears that this is still the behavior I’m seeing… Since it gives you the indexes to do the manipulation, is it alright to do so? The twitter Developer Agreements appear to contradict itself on this, as in Section 1.B.3 it says “Modify Twitter Content only to format it for display on your Services;”. Well, in our app, we are showing a user previous tweets of theirs to help keep tabs on their social media, and we would like to format it for best display (not having the t.co link, since it won’t be clickable and would only get in the way).

Is there any way to request the API to not return this extra link? Why is it there?