Depending on either mod_rewrite is turned ON (like on our forums), or it is turned OFF (like in default version), miniBB can produce different types of URLs. Analyzing them, you can always determine topic ID.
For example, URL of this topic is:
In default version, it would look like:
In default version, look at the URL portion saying topic=4217
. 4217 is topic ID. In mod_rewrite (HTML) version, look at the second value of topic URL.