URL Shortener API: How to Integrate With a Link Shortener


If you’re a product manager, engineer or even just a techie you may be considering integrating your product with a URL shortener API to shrink down the links that your product creates. (In this article, I’m going to make my life easier by referring to any tool, app or platform as a “product”.)

Maybe your product already uses generic short URLs, or maybe it’s a functionality you’re interested in adding. Either way, you can provide even more value to your users by integrating with a branded link tool.

What is a branded link you ask?

Products that create generic short URLs produce something that looks like: ow.ly/Y8KsdsH (depending on which link shortening tool you use.)

Branded links, on the other hand, allow you to use a custom domain, a relevant TLD and a specific keyword. So you’re creating a link that looks more like: App.Tech/Integrations.

Why Don’t I Just Build My Own?

In short, why re-invent the wheel?

Initially, you might be tempted to go about building your own URL shortener directly into your product. This sounds great at first but let’s face it, it’s a lot of work.

As your user base grows it’ll become more and more difficult to scale your product and ensure that every element remains reliable.

When you use Rebrandly’s URL shortener API you don’t need to think about things like scalability or reliability, it’s already taken care of. We’re hosted on Amazon Web Services and have a 99% certified uptime so don’t worry, we’ve got your back.

But besides that Rebrandly has a ton of awesome features!

Our API allows you to more easily report on link clicks, showcase your brand name on the links you share (which has been shown to increase CTR by up to 39%) and even give your users the ability to create links with their own custom domain.

Our documentation covers jQuery, Nodejs, PHP, Python, HTTP or cURL so no matter what programming language you use you’ve got a handy guide to follow.

Using the Rebrandly URL Shortener API

URL Shortener API

For this article, I’m not going to go into the ins and outs of every technical detail of using our API because it’s all there in the developer docs anyway. Instead, I’m going to walk you through two different ways to use our API to get the best functionality for the product you work so hard on. If you want to dive into our APIs right now you can check out Rebrandly’s developer documentation.

Option 1. All Links Created In Your Product Use Your Domain:

A lot of products now use their own branded links for the URLs created on their site. On Twitter, for example, links become shortened with their t.co domain or on Buffer links appear as buff.ly by default unless changed. With our API you can do the exact same thing with yours!

This is a really cool way to increase your brand awareness with minimal effort on your part.

To give you an example, one of our users generates branded links to send invoices so each of their customers gets a customized, clean and succinct link.

To get started building an API with this feature all you need is a Rebrandly account and your API key found in the API Settings of your Rebrandly Dashboard.

Option 2. Allow Users to Create Links With Their Own Custom Domain:

The second way to use Rebrandly’s URL shortener API that I want to highlight can really help you add some value for your users. With this functionality, your users can create branded links using their own custom domains. (Think social media management apps, blogging platforms, content creation tools- basically anything that uses links.)

Once your users connect their Rebrandly account with your product the links they create will help them showcase their brand, increase click through rate and even track link click performance. (If you want to read more about the benefits of using branded links check out our blog post Branded Links vs Short Links)

There are tons of use cases for going down this route. We already have integrations with various social media sharing platforms that allow their users to do this. You can take a look at some of the products that already integrate with Rebrandly if you want to get some inspiration.

So you might be asking yourself how does this set up work? Well, we use a very secure and powerful authentication method known as OAuth. This allows your product to create branded links with your users Rebrandly account on their behalf. They’ll be able to see the links created both in your tool and in their Rebrandly accounts.

You can read our OAuth documentation to get a better idea of how this works.

Some products that have integrated with us in the past actually do a combination of both of the options above. By default, their users share branded links with their products’ domain name like t.co but they give their users the option to change to their own custom domain in-app.

Best of Luck!

URl Shortener API

Remember we’re here to help so if you need any assistance from Rebrandly’s development team to get your integration working feel free to reach out to support [at] Rebrandly dot com.

There are so many potential use cases for our APIs that we haven’t heard them all yet. We’re always really interested to know how you’re using our URL Shortener API so let us know in the comments below what you’re working on.


Further Reading:

This Article is About:

  • URL Shortener API
  • Link Shortener API
  • URL Shortener Integration

Originally published: July 11th, 2017.
Updated: October 24th, 2018.


Try Rebrandly for Free



Maurizio Tiberi
COO at Rebrandly. Directing, administering, and coordinating internal operational activities of the organization in accordance with policies, goals, and objectives established by the CEO.