Blog #10 and #11 API’s

jesselee pakele
May 15 · 1 min read

XML- a metalanguage which allows users to define their own customized markup languages, especially in order to display documents on the Internet.

XHR- a form of an object whose methods transfer data between a web browser and a web server

JSON- an open-standard file format that uses human-readable text to transmit data objects consisting of attribute

API- a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or another service

What are the steps to create an API?

  1. Create a new XHR object: var oReq= new XMLHttpRequest();\
  2. Add event listener and open our request= oReq.addEventListener(“load”, reqListener)“GET”, “addressToAPIEndpoint”);
  3. Create a function that uses the data from the API= function reqListener{ var data = JSON.parse(this.responseText); //create the commands to access the different parts of your API to fit your program needs// }
  4. Send Request= oReq.send();

I was able to find API’s easy to do becuase my teacher explained it and I got help from my friends. Aspects of connecting the API”s that was the hardest was understanding where to get the information from and I found out that we had to use a website. The easiest aspects were making things and making the loops. The advice I would give to anyone using API’s is to listen carefully while your teacher is explaining and don’t give up.