Skip to content
Init is coming / May 19 - 23
Back

TMDB API got suck

  • 0
  • React Native
Adamnaeman
17 May, 2025, 11:28

Adamnaeman: Hi guys, Sorry for interrupt. I got a problem where my page does not repond to the TMDB API. The link youtube is the tutorial that I follow. For the FlatList component where the props is renderItem, I can make MovieCard appear in index page but I cannot make MovieCard appear in search page.

At timing 1:46:00 https://www.youtube.com/watch?v=f8Z9JyB2EIE&t=6602s

TL;DR
Developers are having issues with the TMDB API not fetching movies properly even after following a tutorial. They have tried troubleshooting for 2 hours and suspect the API may not be working. They are unable to see console logs or search results while index page loads fine. The proposed solution is to add console logs to specific parts of the search code to check for results. The task of checking if the API returns a valid result has been assigned. Solution: Add console logs to the search code to track the results and investigate if the API is returning valid data.
Axistro
17 May, 2025, 11:33

could you check if the api returns valid result?

Axistro
17 May, 2025, 11:34

like console log the result

Adamnaeman
17 May, 2025, 11:34

no

Axistro
17 May, 2025, 11:34

no result?

Adamnaeman
17 May, 2025, 11:34

it don show any respond from console.log

Adamnaeman
17 May, 2025, 11:35

index show, while search not show

Axistro
17 May, 2025, 11:36
TypeScript
 const {
    data: movies = [],
    loading,
    error,
    refetch: loadMovies,
    reset,
  } = useFetch(() => fetchMovies({ query: searchQuery }), false);

in the search could you console log these parts

Axistro
17 May, 2025, 11:36

and check the results

Axistro
17 May, 2025, 11:37
TypeScript
  useEffect(() => {
    console.log("Fetched Movies:", movies);
  }, [movies]);

  useEffect(() => {
    console.log("Loading:", loading);
  }, [loading]);

add these to your search code then search some data

Adamnaeman
17 May, 2025, 11:44

LOG Fetched Movies: null LOG Loading: false

Axistro
17 May, 2025, 11:46

this is when the screen loads or when you type something?

Adamnaeman
17 May, 2025, 11:46

screens loads

Adamnaeman
17 May, 2025, 11:47

from the youtube video it should had appear just like the index page

Adamnaeman
17 May, 2025, 11:48

since i got he problem, i stopped the tutorial and try to fix the code first

Adamnaeman
17 May, 2025, 11:48

it has been 2 hours for me to try fix the code

Axistro
17 May, 2025, 11:50

i mean to check the result when you type some words or a movie name

Adamnaeman
17 May, 2025, 11:55

no, it don appear

Axistro
17 May, 2025, 11:57

so the problem is in the fetching the movies check if api is working or find a another provider

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more