Third party API
When you start to become more comfortable with coding, and requesting data doesn’t make your heart skip thinking about how lost you are… Third party APIs are a great place to grab data and start to manipulate it First I recommend search for free APIs for a subject that you like, for this example, we’ll go with Rick and Morty, a fun API to play with, although the dat structure comes back a little odd, when it gets figured out a lot of fun.. so now that we found an API lets start with our Fetch. Fetch isa function that will make a default GET request, we talk about custom POST requests a different time. After specifying the url we then chain on two promises. The first .then is gathering the data then parsing it into json(json is how your browser reads the data) If we didnt do this step, The data would come back and be very computer readable, but not human readable, making too hard to manipulate and use in later functions.
The second promise is specifying that after we have our JSON data we want to call it results and then finally Im console.logging the results which will come back like this..
Few tools along my journey have proven themselves to be more powerful than console.log…. Supplied by JS its typically the first way that you can see information when you start up your server, also, every app that Ive built and seen anybody else build, the obligatory “HELLO WORLD” is typically shown through this
I use VSCode as my IDE(independent dev environment) of choice. Starting with any empty project use the side bar to create a new file…
In my next blog, Ill talk about how to further get into the data to start to make some fun things happen!