DEV Community

Margaret W.N
Margaret W.N

Posted on

Day 56: Getting data from Spott Api

I worked on consuming the spot api. I got one part right today getting back the data from the API. I'm still trying to filter out the responses to autoupdate the city and country.

const input = document.getElementById("input");
input.addEventListener('keyup', async (input)=> {

    const typedString = document.getElementById("input").value;

    await fetch(`${typedString}&limit=10&skip=0&type=CITY&language=ar`, {
    "method": "GET",
    "headers": {
        "x-rapidapi-host": "",
        "x-rapidapi-key": "insertKey"
.then(response => {
    let data = response.json();

const country = document.querySelector('country');
country.textContent =

.catch(err => {
Enter fullscreen mode Exit fullscreen mode

Day 55

Top comments (0)