Two API endpoints without GraphQL?

Hi, everyone.

I’m currently making an app for my friend who is having a rough time.

The gist is this:

I need to pull from both the CatAPI and YouTube API to randomly GET either an image from the CatAPI or a video from a specific YouTube channel once a button is clicked/tapped.

The consensus years ago was that REST was suitable for an API call from one endpoint and GraphQL was better for more complex queryjng. Is this still true?

Welcome to the forum @tiff

You don’t need to make two calls to retrieve one endpoint.

Make a random number generator that outputs either 0 or 1.

If the random number generated is 0then retrieve an image. If it is 1 then retrieve a video.

Happy coding

1 Like

Ahhh yes! I was thinking of Math.rand().

Thank you!