Rather than reinventing the wheel, it’s recommended that you refer to the WordPress REST API Handbook. By using the power of the API, you can programmatically perform comment tasks such as:
The specific section dealing with comments, via API, is at: 1)WordPress Comments
Needless to say, this is for advanced users who are looking to access/admin WordPress comment content via other apps, scripts and methods.