This is not a replacement for someone else conveniently creating an API for you but if you're interested in running your own version of this you can probably recreate this with a combination of youtube-dl[1] (Python) and ffmpeg[2] and build an API around that. Youtube-dl handles A LOT more sites than just Youtube[3]
1. http://ytdl-org.github.io/youtube-dl/download.html
2. https://engineering.giphy.com/how-to-make-gifs-with-ffmpeg/
3. http://ytdl-org.github.io/youtube-dl/supportedsites.html
I wouldn't be surprised if this site was doing exactly this.