Welcome to the Treehouse Community
Looking to learn something new?
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.