How to identify current user type is integration in Magento 2?

Magento allows API to integrate with a third party system to the interaction between Magento and other platforms.

In Magento, a list of resources that you can access depends on your user type. There are four types of user types available in native out of the box.

List of User types in Magento:
INTEGRATION
ADMIN
CUSTOMER
GUEST

You can access the function using, echo $userType = $this->getUserType();

If Output is 1, user type is integration.

api.xml used to define your resource access integration.
You can define path at etc/integration/api.xml, you can create a custom module using create custom integration

Output:
1