how to identify device connect type through rest api ?

how to identify device connect type through rest API?

such as remote or local,tcp lan or other else

It’s part of this endpoint: GET /rest/system/connections — Syncthing documentation

Look at the GUI source code for how it is parsed into different categories.