Find website or idSite from siteName


(Luis Antonio González) #1

Hello,

Is posible for API find a site from SiteName?.

We have a tens of thousands websites in Matomo, get all Websites is not factible, only we wants find one websitsite for your siteName.


Find website or id from SiteName
(Lukas Winkler) #2

Hi,

I can’t seem to find an IP that does exactly that, but what is stopping you from calling SitesManager.getAllSites? Does it time out?

Otherwise you can also make SQL queries of course. That should be quite quick.


(Luis Antonio González) #3

Hi,

Thanks for your quick response :wink:

With the SitesManager.getAllSites method, it only answers 100 websites out of thousands.


(Lukas Winkler) #4

Hi,

You can add &filter_limit=-1 to the API request to get unlimited responses.


(Luis Antonio González) #5

Hi,

Thanks :wink:

The response send 33989 websites, the time response is 28000 ms… is a lot of time.


(Lukas Winkler) #6

That’s quite a lot of sites.

I’d say that unusual use cases allow unusual solutions. I think the cleanest solution is creating a simple plugin that adds the API endpoint you need.
Similar to


and