Get channels based on a username - Official Channel List endpoint.
Get the Channel ID from the Username
If you only know the username of a channel, e.g. you want to get the channel ID for this URL:
https://www.youtube.com/user/OfficialRyanSerhant you want to enter the last part of the URL (e.g.
OfficialRyanSerhant) into this endpoint.
Execute the endpoint and then check the
Raw JSON tab to get the channel ID, e.g. the channel ID will be
UCG98giOsUxIlXV0rNUhxLew per the screenshot: