S
S
Shura01022021-06-01 10:11:00
API
Shura0102, 2021-06-01 10:11:00

How to get information from film search?

Hello! I take information about the movie from the movie search for this query

function get_kinopoisk_data() {
let kinopoisk_id = document.getElementById("glink").value;
let xhr = new XMLHttpRequest();
xhr.open('GET', ` https://kinopoiskapiunofficial.tech/api/v2.1/films... `, false);
xhr.setRequestHeader('X-API-KEY', '05e15730-5d36-4a7b-9cb8-1a9034ed276c');
xhr.send();
fill_other_fields(JSON.parse(xhr.responseText));
}

function fill_other_fields(response) {
console.log(response);
document.getElementById("sfF1 title").value = response.data.nameRu ?? "";
document.getElementById("brief"). value = response.data.description ?? "";
document.getElementById("sfF6").value = response.data.ratingAgeLimits ?? "";
document.getElementById("slogan").value = response.data.slogan ?? "";
document.getElementById("sfF13").value = response.data.filmLength ?? "";
document.getElementById("sfF150").value = response.data.nameEn ?? "";
document.getElementById("sfF14").value = response.data.actors ?? "";
document.getElementById("sfF15").value = response.data.budget ?? "";
document.getElementById("sfF8").value = response.data.seasons.length ?? "";
document.getElementById("message").value = response.data.facts ?? "";
document.getElementById("sfF7").value = response.data.premiereRu ?? "";
document.getElementById("distributors").value = response.data.distributors ?? "";
document.getElementById("input_extrafl10").value = response.data.premiereWorld ?? "";
document.getElementById("input_extrafl8").value = response.data.posterUrl ?? "";
document.getElementById("input_extrafl9").value = response.data.posterUrlPreview ?? "";
document.getElementsByClassName("manFlFlt1").value = response.data.country;
let year_options = Array.from(document.querySelectorAll('.manFlFlt1 option'));
year_options.find(c => c.text == response.data.year).selected = true;

, but it is not possible to get a list of actors, director and number of episodes. Tell,

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question