Download the PHP
package visualappeal/piwik-php-api without Composer
On this page you can find all versions of the php package
visualappeal/piwik-php-api. It is possible to download/install
these versions without Composer. Possible dependencies are resolved
automatically.
Vendor visualappeal Package piwik-php-api Short Description API wrapper for matomo License
MIT
FAQ
After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.
Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.
In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories.
In this case some credentials are needed to access such packages.
Please use the auth.json textarea to insert credentials, if a package is coming from a private repository.
You can look here for more information.
Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
To use Composer is sometimes complicated. Especially for beginners.
Composer needs much resources. Sometimes they are not available on a simple webspace.
If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
This library can be installed via composer: composer require visualappeal/matomo-php-api
Usage
Create an instance of matomo
There are some basic parameters (period, date, range) which you can define at the beginning. They do not change until you reset them with
So you can execute multiple requests without specifying the parameters again.
siteId
The ID of your website, single number, list separated through comma "1,4,7", or "all".
period
The period you request the statistics for
If you set the period to Matomo::PERIOD_RANGE you can specify the range via
If you set it to something other than Matomo::PERIOD_RANGE you can specify the date via:
date
Set the date via
Or use the constants
Report for the last seven weeks including the current week
Report for the last 2 years without the current year
segment, idSubtable, expanded
For some functions you can specify segment, idSubtable and expanded. Please refer to the matomo segment documentation and to the api reference for more information about these parameters.
format
Specify a output format via
JSON is converted with json_decode before returning the request.
Requiresphp Version
>=8.2 ext-json Version
* ext-curl Version
* php-http/guzzle7-adapter Version
^1.0
Composer command for our command line client (download client)This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.Standard composer command
The package visualappeal/piwik-php-api contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.