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 trialAbhinav Kanoria
7,730 PointsGetting treehouse API key
In the Teacher's Notes section of the video 'Wrapping Up' in the course 'Build a Weather App', there is a link to Treehouse Blog API. BUt how do I get the API key and URL so that I can use it in my app?? Because I'll be required to pass this URL in the Request.build.url() method while requesting Treehouse Blog data. Please help! Thanks.
2 Answers
Kourosh Raeen
23,733 PointsI played around with the Treehouse Blog API the other day to answer someone's question here and as far as I know you don't need a key.
Abhinav Kanoria
7,730 PointsWhat is the count parameter for? The number of Treehouse Blog Posts that I wish to access I believe?
Kourosh Raeen
23,733 PointsThat's correct. That is the number of results that the get_recent_summary
method returns.
Abhinav Kanoria
7,730 PointsAbhinav Kanoria
7,730 PointsSo can you tell me how I can access the information on Treehouse Blog API? In the videos, Ben told us that we need to pass a URL. I guess the following line is the URL we need to access the Blog Post data: http://blog.teamtreehouse.com/api/get_recent_summary/?count=20 Am I right?
Kourosh Raeen
23,733 PointsKourosh Raeen
23,733 PointsYes, that is the URL and you can change the value of the
count
parameter.