How Finder tracks location of items in the sidebar
I'm not sure if there's an API for it, per se, it's simply the way it operates. Items in the Finder sidebar are actually aliases to the original item.
From What Are Aliases, Symbolic Links, and Hard Links in Mac OS X:

When you create an alias for an object, the system creates a small data file that includes the current path to the object, as well as the object's inode name. Each object's inode name is a long string of numbers, independent of the name you give the object, and guaranteed to be unique to any volume or drive your Mac uses.
...
When you access an alias, the system checks to see if the original item is at the pathname stored in the alias file. If it is, then the system accesses it, and that's that. If the object has been moved, the system searches for a file that has the same inode name as the one stored in the alias file.

(Or do you mean an API that allows you to create aliases from your own application?)