Day 49

in #code7 years ago

March 3rd, 2018

Hello! Today I was at the Web Development Bootcamp by Colt Steele and I learned about APIs.
API stands for Application Program Interface and it is a way for computers to interact with each other. It is a set of codes, tools to use in building applications.

ProgrammableWeb -a cool website with lots of APIs

APIs communicate with HTTP. First there is the HTTP request, and the HTML is what comes back. APIs send data, not structure. They use data formats like XML and JSON.

XML Extended Markup Language
it doesn't not describe presentation, but it used the key value pairs.

JSON JavaScript Object Notation
similar to JS objects, but it is all a string. You need quotes around the keys.

npm install request

   var request = require("request");
   request('https://google.com”, function(error, response, body ) {
            if(!error && response.statusCode == 200) {
                   var parsedData = JSON.parse(body);
                   console.log(parsedData["query"]["results"]["channel"]["astronomy"]["sunset"]);
               }
         });

Cheers!

Coin Marketplace

STEEM 0.25
TRX 0.19
JST 0.036
BTC 92920.99
ETH 3299.26
USDT 1.00
SBD 3.81