Twitter API Ditches XML For Trends: New Features Are JSON-Only

Adam DuVander
Aug. 26 2011, 05:17PM EDT

Twitter is embracing the trend where 1 in 5 new APIs do not support XML. The trend is playing out, appropriately enough, with Twitter's endpoint for accessing global and local trending topics. It follows a move in late 2010 where Twitter Streaming went JSON-only. All signs point to no XML support for new Twitter features.

The move to JSON is brought on by Twitter's consolidation of the three separate endpoints for accessing trends into a single endpoint. The one solution is built off of Yahoo's WOEIDs (Where on Earth IDs). WOEIDs have been the basis of location-related Twitter calls since Twitter originally released location trends nearly two years ago. The identifiers were also central to the Mixer Labs' GeoAPI acquired by Twitter in late 2009. Global trends will still be available using a WOEID of 1.

Twitter's Jason Costa explained why Twitter is removing XML:

As well as standardizing the trends URL we are also planning to switch the trends API to JSON only. The reason for this is because the use of XML on the trends API is significantly low and removing support would allow us to free up resources for other developments.

Running down the data formats supported by Twitter's various APIs, there is still plenty of XML support (as well as RSS and Atom), but some of the newer features are JSON-only.

Twitter API Data Formats

Twitter API
  • Home timeline, favorites and direct messages
  • JSON, XML, RSS, Atom
  • Geo, trends
  • JSON
  • Individual statuses, retweets, followers/friends, users, lists, etc.
  • JSON, XML
    Twitter Search API JSON, Atom
    Twitter Streaming API
  • User streams, site streams
  • JSON

    As we wrote then the JSON-only Streaming API was announced, it seems clear that XML does not have much future at Twitter, at least with new features. Since so many applications count upon some of the oldest Twitter functionality, such as the core timeline, we'd expect XML to be supported for awhile, if not indefinitely. That said, Twitter hasn't shied away from forcing developers to make updates before. After several delays, Twitter shut off basic authentication one year ago. Most recently the company implemented changes for applications accessing direct messages.

    Via Ryan Sarver

    Adam DuVander Hi! I'm Developer Communications Director for SendGrid and former Executive Editor of ProgrammableWeb. I currently serve as a Contributing Editor. If you have API news, or are interested in writing for ProgrammableWeb, please contact editor@programmableweb.com Though I'm a fan of anything API-related, my particular interest is in mapping. I've published a how-to book, Map Scripting 101, to get anyone started making maps on websites. In a not-so-distant past life I wrote for Wired and Webmonkey.

    Comments

    Comments(1)

    User HTML

    • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
    • Lines and paragraphs break automatically.
    • Web page addresses and e-mail addresses turn into links automatically.

    [...] but Twitter could likely force developers to make updates. In Programmable Web’s article, “Twitter API Ditches XML For Trends: New Features Are JSON-Only,” Twitter’s Jason Costa explained why Twitter is removing XM L: As well as standardizing the [...]