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 trialcesarruelas
27,718 PointsAPI request modified for Celsius degrees
Anyone tried to get the info in Celsius instead of Fahrenheit? I've read the API Docs and I know I'm supposed to append "units=si" somewhere in the request but I just can't seem to figure out where. I've tried at the end prefixed by a &, prefixed by a comma, with and without brackets... Nothing seems to work
1 Answer
Jeremiah Shore
31,168 Pointsyou just need to append ?units=si to your Request URL
https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE?units=si
Jeremiah Shore
31,168 PointsOptions The API request may optionally be modified through the use of query parameters.
you start them with a '?' then separate them with '&' like so: ?units=si&exclude=minutely
cesarruelas
27,718 PointsThanks, this worked perfectly
Jeremiah Shore
31,168 PointsJeremiah Shore
31,168 PointsYou can always use a formula to convert the Fahrenheit value to Celsius.
(°F - 32) x 5/9 = °C
Definitely not the same but always a viable option. I'll look into getting you a "real" answer though ;)