Working with API's

This week’s assignment was to work with an API and use loadJSON() function. I’ve worked on JavaScript fetch API and used await and async. I’ve created two apps for this week.

TEXT’N SPEECH

For one of my project I’ve used Web Speech API. Basically, Web Speech API makes web apps able to handle voice data. It provides two distinct functionality. One of them is speech recognition the other one is speech synthesis. I’ve worked on text to speech functionality and created an app where you can write whatever you want get the results in speech. You can also select a voice and accent.

Web's powerful scriptability, including the DOM and all of the related APIs and interfaces you can use to build Web content and apps.

Screen Shot 2020-09-27 at 5.47.50 PM.png
  • Speech synthesis is accessed via the SpeechSynthesis interface, a text-to-speech component that allows programs to read out their text content (normally via the device's default speech synthesiser.) Different voice types are represented by SpeechSynthesisVoice objects, and different parts of text that you want to be spoken are represented by SpeechSynthesisUtterance objects. You can get these spoken by passing them to the SpeechSynthesis.speak() method.

Screen Shot 2020-09-27 at 5.52.15 PM.png

COVID 19 TRACKER APP USING ASYNC AWAIT AND FETCH API

For my second project, I’ve built a coronavirus (Covid19) tracker app. using async and await and fetch api. The idea is simple I’ve an input and you write the country name and click on get data button. As a result you can get the latest confirmed, recovered cases and number of deaths.

Screen Shot 2020-09-27 at 6.04.23 PM.png

The API I’ve used for this project is covid19api which you can reach the documentation from here. Data is sourced from Johns Hopkins CSSE. John Hopkins University is one of the most trusted sources of COVID-19 data. We can say the relaying information is from a reputable source.

Covid-19 API is free and doesn’t require a subscribtion. This API allows you to follow the progress of the coronavirus around the world. Data returned includes the number of new, active, critical, recovered, and total cases by country. You can also get historical COVID-19 data filtered by country.

Screen Shot 2020-09-27 at 6.15.42 PM.png

You can reach the codes from below;