Check if a route is in panel or api

Is there a way to check if a current route is in a panel, api or on the site? I want to log data on a ‘route:after’ hook, but only when the route is on the site.

For now i can guess the route on the route prefix ‘api/’ or ‘panel/’. But is there a better way?

I’m not aware of anything apart from checking the strings…