Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Joey Alban
2,458 PointsHow to find JSON data for a webpage
I've recently finished the "Getting Data from the Web" section of the Android Blog Reader App and I was wondering exactly how the URL for the JSON data was found. I'm looking to try and develop a similar app to this in the future with another forum and I can't seem to find the JSON data for it.
I know it has something to do with the "api" characters in the URL given in the lesson, but using that for the site I'm looking to use isn't working. Any insight on this would be much appreciated.
2 Answers
Chris Shaw
26,676 PointsHi Joey,
JSON data formats really depend on the software running behind the website itself, more common examples of JSON structures are Twitter feeds, Flicker feeds, Facebook authentication etc, based on the information above I don't think the course has said that the data source has to support JSON as a data type which most services do by default.
James Barnett
39,199 PointsAn API is basically a way to programmatically consume data from a service. When a service like Twitter returns data from an API call it helps if it comes in a standard format, 2 such formats are XML & JSON.
So the short answer to your question is some blogs expose their data in JSON format to allow it to be programmatically consumed by say a blog reader app.
If you want to find blogs that use json, here's a google search that will help with that.
http://google.com/search?q=filetype:json
If a particular blog you are interested in offers data as rss but not json
You can probably use Yahoo Pipes to convert from RSS to JSON
see also: http://snook.ca/archives/javascript/yahoo-pipes-xml-json