Piwik tracks much more visits/searches compared to Apache logs

Hi all.

I have a Piwik instance running, and was surprised to see the huge amount of pageviews and searches Piwik was recording. I’m using a bit of a special setup: the stats are tracking the usage of an API. Every time an event occurs, the API code sends a request to the Piwik server using the piwik/piwik-php-tracker library. This means there’s no Javascript snippets involved. So far, so good. I log this call to Piwik, and can confirm it only calls the doTrackSiteSearch() or doTrackPageView() once for every event.

When I went to check the Apache logs, I saw there is a huge difference in recorded values (period of 1st of September until the 30th; in Apache, I’m simply grep’ing, namely grep -e "/Sep/" access.log.all | grep "/v2/search" | wc -l and grep -e "/Sep/" access.log.all | grep "GET /v2/description" | wc -l; these 2 paths are the only ones that trigger calls to Piwik)

Pageviews: Piwik 89’460; Apache 23’030
Searches: Piwik 227’095; Apache 57’880

That’s roughly 3.9 times more, for both figures (which is reassuring: it means something logical must be going on).

Anyone any ideas of what might be going on? Why is Piwik treating single events as multiple ones?