Serving my next cloud media in a basic web-app - best practices, API, & feasibility

I’d like to serve the media files — photos, videos, audio, text — stored in my next cloud data/ directory for use in a gallery style web application, just a little javascript app.

Right now media assets have the following uri: https://nextcloud.site.com/index.php/core/preview?fileId=369&x=1440&y=900&a=true.

How would I go about getting a *.jpg-ending uri?

Is there a sort of basic API for this kind of thing?

If there isn’t, how feasible is this kind of thing?

Is there something I’m missing here?