Search code examples
amazon-web-servicesapi

Creating a shorten URL for products using Amazon advertising API


I'm using Amazon's API to browse for some products and I would like to generate an affiliate link for some of them.

I know I can get a normal affiliate link from the DetailPageURL field in the response (and that I can create one manually following the affiliate link format) but I would like to find an automated way to create a shorten URL for a product that contains my tag.

2 technical notes:

  • Shorten URLs are the ones Amazon provides that look like amzn.to/12345
  • I know I create these manually via the associates panel, but I'm looking for a way to get them using an API.

Solution

  • Apparently this can be done using bit.y's API, as every Amazon URL shortened by bit.ly will get the amzn.to/{unique_id} format.