shortern url

FREEMIUM
By solocoding | Updated a month ago | Advertising
Health Check

N/A

Back to All Tutorials (1)

Create a new short URL and get the visits count

To create a new short URL you have to use the following endpoint:

curl --request POST
–url https://shortern-url.p.rapidapi.com/url
–header ‘content-type: application/json’
–data ‘{
“fullUrl”: “https://rapidapi.com/solocoding/api/shortern-url/tutorials
}’

And make sure to put the long URL in the body, the URL must be a valid one and under 350 chars. The response will contain the short URL.

Then to save statics like visits count and the source country, the redirect endpoint must be used:
curl --request GET
–url https://shortern-url.p.rapidapi.com/redirect/{shortUrl}

To view the satics about the visits count and countery source, you can use the following endnpoint:
curl --request GET \
--url https://shortern-url.p.rapidapi.com/url/{shortUrl}