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
Adedeji Awodele1,964 Points
How do you know the url from which JSON data can be gotten?
I was going through the videos for the iOS course: Build a simple blog reader; and was wondering if there is a way to know the url from which the json data for each website can be obtained.
What I mean is, in the video, the teacher readily provided the url (blog.teamtreehouse.com/api/get_recent_summary) to download the json data from but what if I wanted to get the json data for some random website, how do I know the url to access?
You don't :) you can sometimes guess though! For example, appending .json to a URL sometimes returns the JSON version of that document. So www.reddit.com/.json returns JSON. Sites that want you to use their JSON will usually tell you about it and where you can find it through their API documentation.
If a site doesn't want you using their JSON you should probably respect that wish, but you can also sniff around and see if there's an undocumented API somewhere.
I had this question too, thank you.