Get ChannelID from Youtube Custom URL

Is there any way that I can get the channel ID of a Youtube Channel by having its custom url (using the Youtube API) ?

Example:

A custom url is like:

https://www.youtube.com/onepiece

I want to get its channelID, so that I have the link like:

www.youtube.com/user/OnePieceUK