OK - so it looks like it is making a GET request to an API (presumably within the same codebase) by using the URL generated in the first method, so you'll need to pass a topN parameter in the URL like this:
var url = _appSettings.APIBaseUrl + "ContentItemsHierarchy?pageAliasPath=" + strPath + "&siteName=" + _appSettings.SiteName + "&publishedOnly=true&culture=" + _appSettings.Culture + "&topN=3";
Then you need to figure out where the ContentItemsHierarchy
API method lives, and modify the data access within that to use the new topN parameter.