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

Derek Saunders
5,167 PointsFinding the JSON file
How can you find the JSON file on a website? I've been searching google and can't find anything, please can you help me on how to locate the JSON file to use it in my app.
2 Answers

Chris Shaw
26,676 PointsHi Derek,
Generally sites don't just have a JSON file sitting around, they will have an API running in the background that allows you to define the data return type of application/json
as part of the response headers, as an example lets takes Flickr's photo API.
https://www.flickr.com/services/api/response.json.html
In the documentation it shows you can make the requests as either raw JSON or JSONp which is derived from JSON but allows you to execute as a callback but I won't go into that, so for example take the following URL.
In here we have the following.
- format=json
- nojsoncallback=1
The format
parameter tells flickr we want a JSON type response for the data and the nojsoncallback
parameter says we just want raw JSON as this isn't a JSONp request.
Hopefully that helps, it may be a bit confusing if you're new to the concept of an API but there are literally thousands of websites they have one if they are of a 3rd party service such as Facebook and Twitter.

Derek Saunders
5,167 PointsThanks for the answer Chris, but do all sites have a json file? Let's say that I wanted to add posts from AutoBlog to my app, how would I be able to tell if they are using JSON or not? Would I just type autoblog.com/json to see if they have an api running in the background? Thanks!

Chris Shaw
26,676 PointsNo, not every site has an API, typically the easiest way to check is in the footer which you may find the words API, developer or words to that effect.

Derek Saunders
5,167 PointsChris you are a huge help to me, I have one more question. Is it possible to add a blog's posts to your iphone app without using JSON or XML? Can you just simply use the URL of the homepage to obtain the posts from there?

dierkpolzin
7,380 PointsCheck this out to find a useful JSON API resource.
Keith Shadle
1,290 PointsKeith Shadle
1,290 PointsSame problem for me!!
How do you know/find a sites JSON data/file?...or even know it's there?
How would I even know of..blog.teamtreehouse.com/api/getrecentsummary...without watching the tutorial video?
Google search for me just comes up with jQuery stuff.
Thanks!!