I couldn't see anything specific, so hopefully someone better versed in this area will pipe in at some point, but this might be one way of getting the info you need.
Get the item in the tooltip
https://wow.gamepedia.com/API_GameTooltip_GetItem
Use the item link return value
https://wow.gamepedia.com/ItemLink
Then see what the different values are in the itemString relating to the item
https://wow.gamepedia.com/ItemString
Hopefully one of those values will be the bag quantity, trial and error will obviously be the key