Buen dia.
Этот aprendiendo sobre apis en electronics.js, pero ahora quisiera que cuando ingrese un dato en el input me filter la informacion de la api publica, una especie de buscador, alguien podria ayudarme con eso por Favor.
mi codigo es el siguiente:
var con = document.getElementById('contenido')
var bot = document.getElementById('peticion')
bot.addEventListener('click', realizarPeticion)
function realizarPeticion() {
fetch('http://www.7timer.info/bin/api.pl?lon=113.17&lat=23.09&product=civillight&output=json')
.then(res => {
res.json()
.then(resJSON => {
var data = resJSON['dataseries']
for (var i = 0; i < data.length; i++) {
var dia = data[i]
con.innerHTML += dia['date'] + " " + dia['weather'] +
" " + dia['temp2m']['max'] + "<br>"
}
})
})
}<!DOCTYPE html>
<html>
<head>
<title>Clima</title>
</head>
<body>
<input type = "search" id = "site-search" name = "q">
<input type = "button" value = "Realizar Peticion" id = "peticion">
<table id = "contenido"></table>
</body>
<script src = "index.js"></script>
</html>


![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


¡Hola! Las preguntas y respuestas aquí deben estar escritas en inglés. В пользу утилиты es.stackoverflow.com. (Вопросы и ответы здесь должны быть написаны на английском языке. Используйте es.stackoverflow.com/.)