Searching for a specific songs API

I am creating like a guess the song app, I am wondering, what music API allows me to take part of a song? Is that possible with Apple music API? If I had to use an API that only gives full songs, is there a way to partition it programmatically through swift?