Soporte de The Movie Database

i am new to api and i am having issues with the api requests
i am creating a streaming website and i searched for every movie in the TMDB i got the movie id and i added it into the database
so when the user clicks on one of the movie a script will get the movie id that matches the movie name in mysql (i dont know if this is the right way or not)
i only have movies in my website and only request these info title name - description - poster_path - category - runtime - year - imbdrating - actors with there posters.
everything works fine but sometimes my page give me Undefined variables for my requests and when i check my request log i fond that i am request random information not related to my requests like,
200 GET /3/tv/2 - 200 GET /3/search/multi - 200 GET /3/trending/all/day 7/28/2023 12:11 PM 200 GET /3/trending/all/day 7/28/2023 12:10 PM 200 GET /3/trending/all/day 7/28/2023 12:11 PM 200 GET /3/trending/all/day 7/28/2023 12:10 PM
simply a random requests so i dont know what to do hope i get help

code text here

// Fetch movie details from TMDB using the provided function
list($movieTitle, $movieDescription, $posterPath, $releaseYear, $runtime, $genres, $imdbRating) = getMovieDetails($MovieId, $apiKey);

function getMovieDetails($MovieId, $apiKey) {
    $baseUrl = "https://api.themoviedb.org/3/movie/{$MovieId}";
    $query = http_build_query([
        'api_key' => $apiKey,
        'append_to_response' => 'credits',
    ]);

    try {
        $httpClient = new \GuzzleHttp\Client();
        $response = $httpClient->get("$baseUrl?$query");

        $data = json_decode($response->getBody(), true);

        $movieTitle = $data['title'];
        $movieDescription = $data['overview'];
        $posterPath = $data['poster_path'];
        $releaseYear = date('Y', strtotime($data['release_date']));
        $runtime = $data['runtime'];
        $genres = array_column($data['genres'], 'name');
        $imdbRating = number_format($data['vote_average'], 1);


¿No encuentras una película o serie? Inicia sesión para crearla:

Global

s centrar la barra de búsqueda
p abrir menú de perfil
esc cierra una ventana abierta
? abrir la ventana de atajos del teclado

En las páginas multimedia

b retrocede (o a padre cuando sea aplicable)
e ir a la página de edición

En las páginas de temporada de televisión

(flecha derecha) ir a la temporada siguiente
(flecha izquierda) ir a la temporada anterior

En las páginas de episodio de televisión

(flecha derecha) ir al episodio siguiente
(flecha izquierda) ir al episodio anterior

En todas las páginas de imágenes

a abrir la ventana de añadir imagen

En todas las páginas de edición

t abrir la sección de traducción
ctrl+ s enviar formulario

En las páginas de debate

n crear nuevo debate
w cambiar el estado de visualización
p cambiar público/privado
c cambiar cerrar/abrir
a abrir actividad
r responder al debate
l ir a la última respuesta
ctrl+ enter enviar tu mensaje
(flecha derecha) página siguiente
(flecha izquierda) página anterior

Configuraciones

¿Quieres puntuar o añadir este elemento a una lista?

Iniciar sesión