Wikipedia says that
YMSG is a proprietary protocol, a closed standard aligned only with the Yahoo! messaging service. Rival messaging services have their own protocols, some based on open standards, others proprietary, each effectively fulfilling the same role with different mechanics.
Also If you are interested in building some application then visit this official page. There are also some projects already done using different programming languages like C++, Java. For eg: libyahoo2, OpenYMSG
Here is an interesting study about different instant messaging protocols.