APIs Project
Project Name : Bitcoin Ticker
Create a new folder:
open this folder in terminal or cmd for create files
write the command for create new file:
create a new file index.js
open these files in code editor .
Now npm init for install package.json
Now install the express server using this command
• npm install express -S
Now install body-parser
• npm install body-parser -S
Now install nodemon
• npm install nodemon -S
Now install request
• npm install request -S
Now check the package.json file and check the all
install packages in dependencies.
Write a code in index.js :
Now add html
now write a command in terminal to run server :
see server is running on port 3000 successfully.
Now open the browser and run localhost:3000
Output:
Now use the post method and get the crypto , fiat ,
and store is variables. Amount is get from API
body.
Now create option variable and store the all
requirements for API ..
Go this link and open the API documentation
Use price converter API
we use the API before question mark
Now use request method
Refresh the browser and see the terminal server is
running ? And check the output:
Click the check button and price is show in console
print time from API
write() method writes the specified string into a buffer, at the specified
position.
Now refresh the browser and check the terminal server is running?
And check the output.
Enter any number in input and select any currency in given which you
want check
Output:
Project End