Introduction
You may need to perform a search among the users using WHM API that are assigned a specific package. Below is the method in which this can be done using WHM API
Procedure
whmapi1 listaccts search=default searchtype=package searchmethod=exact want=user
Per the documentation outlined at the following page.
https://api.docs.cpanel.net/openapi/whm/operation/listaccts/
"search=default" Searches for the string default
"searchtype=package" Searches with the defined search string (in this case default)
"searchmethod=exact" Searches only for the word default
"want=user" Only returns the usernames of the matching results.
Further expansion and details can be added to provide more results.