Skip to main content

A very simple and basic cli tool for Matomo API

Project description

Readme

This is a very simple and limited cli tool for Matomo API requests.

Very limited support for anything in general. This was created as a need for a Prometheus exporter for Matomo, and we needed a base to do the calls to Matomo. Hopefully it could be used and developed together with the community.

Environment variables

Many options could be replaced with environment variables.

Environment Variable Description Default
MATOMO_URL URL to Matomo instance -
MATOMO_TOKEN Access token for Matomo -
MATOMO_ID_SITE Site ID 1
MATOMO_ID_SITES Comma separated id's -
MATOMO_PERIOD Period (day, week etc) day
MATOMO_DATE today, yesterday, 2024-10-02 etc. -
MATOMO_OUTPUT_FORMAT json, xml or tsv. tsv
MATOMO_LIMIT Number of results -

Usage

matomo --help
matomo api --help
export MATOMO_URL=https://mymatomo.instance/index.php
export MATOMO_TOKEN=DHJSHGUAGU8383

matomo api --method MultiSites.getAll --period month --date 2024-08-20 --show_columns nb_actions

The method you provide is the API call the tool will do (see your Matomo installation on what API:s you could use)

Installation

pip install matomo-cli

or

pipx install git+https://github.com/Digitalist-Open-Cloud/Matomo-CLI.git

Known supported API methods

The Matomo API has many methods, and could be extended with plugins, here is a list of methods we know this tool is supporting. Please note, that for now, some methods only works well with json and xml output. And for all them, not all possible options is available in the tool yet.

Method
ActivityLog.getEntries
API.getMatomoVersion
API.getPhpVersion
API.getIpFromHeader
API.getSettings
BotTracker.defaultBots
BotTracker.getTop10
MultiSites.getAll
PagePerformance.get
SitesManager.addSite
SitesManager.deleteSite
SitesManager.getAllSites
SitesManager.getAllSitesId
SitesManager.getJavascriptTag
Etc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matomo_cli-0.1.3.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

matomo_cli-0.1.3-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file matomo_cli-0.1.3.tar.gz.

File metadata

  • Download URL: matomo_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0

File hashes

Hashes for matomo_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bc2c850e5fd340ced92a434bee727b88d6849bcfa9ea7022464b2f775dcc4715
MD5 7a0a6a26fdb259928e12fc34ee483394
BLAKE2b-256 d07f5df816eac8ece38338b7e98adc13ae417887399171cb85bcefcd77513135

See more details on using hashes here.

File details

Details for the file matomo_cli-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: matomo_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Darwin/23.6.0

File hashes

Hashes for matomo_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2a0d679a2459fa2c23ae09af2447aeeecf20e4d28d0b7073f1b118c778c2e352
MD5 e11975d0f1fae96088ea6188f94792d0
BLAKE2b-256 457207d8490a2d337a5c5b5970d6cef271107d602c439f4b72e4986ba63239b4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page