The Movie Database Support

How can I get only the logo of the movies and tv I only want the logo like this => https://www.themoviedb.org/t/p/original/izvZm6zHyidvhktODSGjnOFldKu.png

4 replies (on page 1 of 1)

Jump to last post

Hi @elmanci2, are you asking about this on the API?

Yes

Ok, I've moved this post into the API forum.

You can get the logos by calling the /images method, and looking at the returned logos filed.

Make sure to read the docs around images:

Hi! This is my solution for this problem, coded in Vue, but it's basically the same as any other js file :

const getImages = (movie_id) => {
            const images = ref([]);
            const main_logo = ref("");
            const xhr = new XMLHttpRequest();
            xhr.open("GET", `https://api.themoviedb.org/3/movie/${movie_id}/images?api_key=${env.apikey}`);
            xhr.onload = () => {
                images.value = JSON.parse(xhr.responseText).logos;          // will return an array of logos in many different languages
                const en_logos = images.value.filter((logo) => {                   // takes only the English logo
                    return logo.iso_639_1 == "en"
                })
                main_logo.value = "https://image.tmdb.org/t/p/original/" + en_logos[0].file_path;
            }
            xhr.send();
            return main_logo;
        }

// Sample Function Call
        const main_logo = getImages("945961");

        watchEffect(() => {
            console.log(main_logo.value);
        });

Can't find a movie or TV show? Login to create it.

Want to rate or add this item to a list?

Login