PHP XML display of shows not all episodes

I’m trying to get a display like the Plex Home screen “Recently Added in TV Shows”

I can use the XML like below, but this will output every episode recently added rather than the show with a count of recent episodes. When adding a whole new season or show with multiple seasons, this XML will just display each episode. I would like to show as Plex does in the screenshot below.

$host/library/sections/3/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=20&X-Plex-Token=$token