Is there a way to find out what branch a commit comes from given its SHA-1 hash value?

Is there any API to find the branch in which a commit in originally committed?