Piwik Api and database schema

Hello, I wanted to ask the following question:

I have to get from my database schema information that is in log_action, now I do it with a query from mysql workbench but now should use the API Piwik. Could anyone tell me what methods should be used to obtain the same information?

Thank you so much,
Merrick

I’m going to assume you want to make/modify a plugin to run this query using the API in a php file
The php class you create would start with something like :

class API extends \Piwik\Plugin\API {

And then in a php function the SQL query to be run would look something like this:
SELECT * AS mydata FROM ". \Piwik\Common::prefixTable("log_action") . " WHERE idsite = 1

Hopefully this is in fact what you are trying to do.