The topic id is preferable but you make sound like you are not saving the topic id. Given that you don’t have the topic id (which would obviate searching), if your topics have unique names, you can just access the slug (as @falco’s example that points to this topic using the title /slug).