In this tutorial we will see how we can shorten URL using R programming language. APIs used in the tutorial are free and do not require any registration or sign-up before using them. This is especially useful when you need to share some links with the team. Long URLs do not look attractive and error prone in copy paste.
In the code below, we are using is.gd and v.gd API services. The only difference between them is that v.gd shows link preview and does not redirect automatically to the original long URL. Whereas is.gd will take you to the original automatically without showing any preview. By default linkPreview is set FALSE in the below user defined R function.
api query request content result
Test if shortened URL is working