A Photo Upload API

Monday, 15 August 2011

Photos are a fundamental way that people share context, information, jokes, and personal moments on Twitter. Following last week’s wider release of photos to Twitter.com users, we’re ready to share our media upload API, which will allow developers to conveniently attach an image to a Tweet. We’ll soon incorporate this service into Twitter mobile clients as well.

If you’ve used OAuth Echo for image uploads, you’ll find that the new method available at POST statuses/update_with_media is simpler and requires fewer dependencies. One of the first things you’ll notice about this method is the host name: status updates with media can only be executed on upload.twitter.com rather than api.twitter.com. Using this alternative host name for the upload path ensures high availability and flexibility.

Please adhere to our display guidelines when rendering Tweets with media. Be sure to link the URLs included in the Tweet text to the original URL, and the Display URL should be displayed as the anchor text for the link. For example, displayed text should read pic.twitter.com/SLUG, and not t.co/SLUG. It’s also important to note that our rate limits still apply - expect to see HTTP 403 errors returned if the user is over their daily media limit or tries to exceed the number of updates allowed. PNG, JPG, and unanimated GIFs will be supported.

For more on this, please take a look at our Developer Discussion.