With Get Chatters, total=14. However, the actual number of viewers is 2. Where does this error come from? I feel that they are too far apart.
WHAT??
↓
^^^^^^^^^^^^^^^^^^^^^^^^
total →Integer The total number of users that are connected to the broadcaster’s chat room. As you page through the list, the number of users may change as users join and leave the chat room.
^^^^^^^^^^^^^^^^^^^^^^^^
It’s possible to connect to chat and not be watching the stream. For example there are many bots that connect to chat on all channels that are currently live, so they would count as a chatter but do not count as a viewer because they’re not viewing the stream.
Also it’s possible for there to be people watching the stream and not connected to chat, so would count as a viewer but not be in the chatters list.
It is not possible for 3rd parties to know who is actually counted as a viewer, that chatters list is the closest you can get.