Windows File Explorer has a feature when renaming a file where if the new file name is already taken by a file in the same folder, a new name of this form is suggested: "filename (1).ext". If a file with this name is already in use as well, the name "filename (2).ext" is suggested, etc...

I have coded my own version of this functionality but I'm wondering if there's an API which exposes this functionality?