Api returns tweet with t.co link instead of what is see on my tweet timeline. On timeline i see bit.ly


#1

I am trying to read my tweets via API v1.1

On my profile (http://twitter.com/vasimpadhiyar) i see following tweet

“Checkout http://bit.ly/1248bJ0 for seo marketing.”

And when i read my timeline via api i got following tweet

Checkout http://t.co/9yWR2VpLME for seo marketing.

How do i get original tweet ?


#2

Vasim —

The t.co link will always be substituted in the tweet text returned by the API. This is done partially to help prevent the spread of potentially abusive links (e.g., links to point to malware). However, you can always get the original link back by looking at the “entities” key in the tweet’s JSON response.

If the tweet contains any links, then the entities key will contain a “urls” key, which will have the following information:

  • url: The t.co link
  • expanded_url: The original url. In your case, this will be the bit.ly link
  • display_url: A display version of the expanded_url
  • indices: Indices of the tweet text where the display_url should be substituted for the t.co link

Cheers,

Vince