I’m need to know how to use API in order to make use of it in web pages that we are developing. I’m now currently developing weather app. But I have no idea what to do with JSON object that I’m getting or what even JSON means.
I looking for tutorial/docs which helps me understand how to use any API and convert the data provided it to present to User in useful manner.
Hey vikramnr, this is really quite a vague question. A good starting point would be for you to tell us why you need to learn about this.
Are you trying to build an API interface for users of your services to query/retrieve data/information?
Are you trying to connect to a supplier/service that isn’t yours?
In any case, you want to be looking at parsing and retrieving data to and from a web-service using JSON. and if you’re building it yourself like I do, then a PHP web-service could be your option.
There are many approaches but we’d need to understand how you’re using APIs to make it a bit more relevant.
Please message me if you want to know what I know. Always happy to help.
Thanks for reply. As I have mentioned in the edit I’m curious to learn about it:slight_smile:
Since the exercises in the JSON part of the course don’t even do what they claim they do (has anyone made any other message appear than “the message goes here”?), I am still absolutely clueless as to what code is needed on my webpage to access an API from an external resource.
You can try out beta version of FCC which might be more aligned and helpful.
I completely agree. I feel very lost going into these projects and I am having to do a lot of research on my own. But at least I’m learning from it.
I am working on the Weather App project and running into a problem. I am accessing the JSON file from Dark Sky’s API. The URL I have constructed is working because when I enter it into the address bar of a new tab it brings up the JSON information. However, I am getting blocked by an “Access Allow Control Origin” error. This is blocking Codepen from accessing the Dark Sky API.
The URL I am creating in my pen is: https://api.darksky.net/forecast/800550978634a6a3c4067b924aa371de/45.517835998058914,-122.41655223732604
Is there something I’m missing that will allow my pen to access the Dark Sky?
You can use herouku extn to prevent this from happening.
Heroku Extension? I’m unfamiliar with this.
https://crossorigin.me solved this issue with little work and effort.