Since the client credentials flow does not include authorization, only endpoints that do not access user information can be accessed. You can use another authentication flow for getting recently played tracks from a user. Let me know if you have any questions!
Have a great day,
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.