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

I need a api that give me similar topics.
My requirement - If i have a topic title then i will get the similar topics.

You will see that if you request the JSON for a topic, it has a section called suggested_topics.


From title to topic ID can be done using search:



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

Its working on meta.discourse but not on my forum. Our forum is
If i will then no result was there

That seems like a private community so unauthenticated requests will not return any data. It works on Meta using because the content is publicly viewable.

See Discourse API Documentation and Using the Discourse API Ruby Gem for more info on authenticating your requests with an api_key and api_username.

1 Like

That specific topic only has one post so there is no post 2.
It needs to be

You can always use t/<topic_id>/1.json

And indeed, you need to use an API key since you have a closed community.