If you are leaning on our embedding then Discourse maintains a map between embed URL and topic.
So you could use:
To get the list of comment count.
Get comment count could just call that endpoint with the ghost url. Open to possibly making a “batch” endpoint so you can pass it multiple urls. pr-welcome on that.