Data is derived from the back end in an API. The "front end" has nothing to do with how a user deals with the data.
Unless it's a mobile app or an app where they download and install a front end. Like a weather app.
You give users the instructions on the API usage and follow this chapter:
https://laravel.com/docs/10.x/eloquent-resources
Basically the person or system retrieving the data designs the "front end" to loop over and display the data as needed on their system.
Many API's I see people talking about here on the forum should only be web apps and not API's, since dealing with API JSON, CSV, or XML data is not for an average user visiting a web site.