How to get an App ID in LG TV?

How we can get an App ID of YouTube app to launch that app from a different app.

The webOS TV does not provide 3rd party apps’ information. For questions about YouTube, please contact YouTube support. Thank you.

You can use a library on your backend to request a list of installed applications and their IDs. This will allow you to retrieve all the relevant information about the applications installed on the target tv.

exactly what “library”?

there is a websocket message that can be called to obtain the list of the apps installed on your TV, even the running one. For example “PyWebOSTV” is a library for python that used this websocket payload to obtain the list. You can look into the files and identify the websocket message for “app.get_current()”