Existing Wi-Fi analyzers often show channel bandwidth information. I am unable to find API that could provide such information.
Chatgpt suggests to simply calculate approximate channel bandwidth based on a frequency information, but it looks like these apps somehow read exact values.
As I understand, it is possible by capturing Wi-Fi beacon frame and parsing corresponding value but I am not sure if this is optimal approach.