I've done some research and read some of the posts about this topic, but none of them are up to date.
The answer from 8 years ago says that accessing via the API does not count for badges:
Does access via the API count towards Fanatic and Enthusiast badges?
The mobile app uses the API at that time, so accessing Stack Exchange sites using the mobile app also does not count for badges:
Logins through phone app don't count towards enthusiast/fanatic
However, this issue of the mobile app seemed to be resolved in 2013:
Last seen not updating when using Android app
Does this mean that now accessing via the API can count for the badges?
access_token
counts towards those badges. But that's just a SWAG that needs to be tested (by someone else).