API endpoint for getting data from a module

Hi. Is there an API endpoint for getting data from a custom module besides using component?

i.e I have this component – {%component source: “Drivers”, layout: “List”, object: “collection”, collectionVariable: “drivers”, type: “module” %} and I would like to know if theres an equivalent API endpoint for this.

There is no API for custom modules at the moment in the traditional sense. You could however fake a JSON endpoint for your module by recreating a JSON structure in a list layout of that module and rendering the data with a component tag on an otherwise completely empty html page. I did that here for outputing news items from a Treepl site: https://www.onkologie-lerchenfeld.de/news-api. It’s not completely valid as it doesn’t have the right MIME type but it works, Treepl’s liquid engine also parses that without problems via the JSON data component call (JSON (parsing via Liquid))