I tried to use the list thread method:
GET https://www.googleapis.com/gmail/v1/users/{MyEmailAddress}/threads?labelIds=INBOX&labelIds=UNREAD&key={YOUR_AP
Turn conversation view off in the Gmail UI in order to get an accurate count of the message (not threads) in your inbox.
You can also use:
in:inbox is:unread
as the query in both the UI and API. Remove the labelId parameters.