Is there is any open API for getting similar topic in discourse?

I think you should use: so that related articles are related to each other. From title to topic ID can be done using search: