API Use pageUrl=@ instead of the full url

Hello,
I’m using the matomo API to retrieve visits from my urls but I want to use a part of the url to retrieve the data and not the full url
Here is my current request
https://xxxxxx.yy/infostats/index.php?module=API&method=Actions.getPageUrl&pageUrl=xxxxxx.yy/'.$req_select_posts_donnees['post_name'].'&idSite=2&period=range&date=2011-01-01,'.date('Y-m-d').'&format=json&token_auth=token_auth';
This is what I would like to be able to do
https://xxxxxx.yy/infostats/index.php?module=API&method=Actions.getPageUrl&pageUrl=@/'.$req_select_posts_donnees['post_name'].'&idSite=2&period=range&date=2011-01-01,'.date('Y-m-d').'&format=json&token_auth=token_auth';

Indeed my posts have changed prefix in time and with Google analytics I was able to retrieve all the data thanks to the “contains” operator and not a strict “=”.

How to modify the solution in this sense?

Translated with www.DeepL.com/Translator (free version)

Hi,

You can use the &segment= parameter to apply any segment to any Matomo API request:
https://developer.matomo.org/api-reference/reporting-api
https://developer.matomo.org/api-reference/reporting-api-segmentation

So something like &segment=actionUrl=@the_string might be what you are looking for.