Amazon plugin

Freshness Warning
This article is over 16 years old. It's possible that the information you read below isn't current.

Note: MTAmazon 2.0 has been released. It allows more flexible product display, better performance, and searching for products related to your blog entries. The documentation for the original version of MTAmazon is provided here primarily for reference. It is recommended that you go to the MTAmazon 2.0 page instead.

MTAmazon is a Movable Type plugin that uses your Amazon Associate membership to retreive products from Amazon. It allows flexible searching and display of products from any of Amazon’s product categories.

Download. You can get MTAmazon by downloading

Requirements. In order to use MTAmazon, you’ll need to be running Movable Type 2.21 or later and have three Perl modules installed: XML::Simple, LWP::UserAgent, and HTTP::Request. All three are common modules, so there’s a good chance your server has them installed. If they aren’t already on your server, you can download and install them by copying them to Movable Type’s extlib directory.

Installation. Once you’ve downloaded and unzipped, connect to your FTP server and open the directory where you have Movable Type installed.

Create a directory there called plugins if there isn’t one already and copy to the plugins directory.

Using MTAmazon. Once you’ve installed MTAmazon, You’ll have a set of new Movable Type tags.

<MTAmazon></MTAmazon> is a pair of tags that connect to Amazon, runs your search, and builds a list of products. All of the other MTAmazon plugin tags will go inside this pair of tags.

To build your search, you’ll need an Amazon associate ID. You’ll also need to choose whether you want MTAmazon to search for products or display all of the products from an Amazon product category. Lastly, you’ll need to choose which of Amazon’s product lines you want the products to come from.

Searching. If you want to search for products, all you need to do is create a list of search keywords. You can use multiple keywords separated with spaces.

Using Product Categories. To use product categories, you’ll need Amazon’s Browse ID for the category you wich to display. To get the Browse ID, start browsing for products on Amazon. Once you’ve gotten to the category you want to display, look in the address bar of your browser. You’ll see something like The browse ID for this category (DVD Awards) is highlighted in bold. The portion you’ll need is the number after browse/-/.

Product Line. The product line is the section of the store that you want to retreive products from, like books or software. Amazon has a list of valid product lines listed on their Associates site. Their list shows the line as "mode=books," but all you need is the "books" portion.

Once you have all your information, you are ready to build your product links using the following attributes to <MTAmazon>:

  • associateid
    Your Amazon Associate id

  • method (required)
    How do you want to retreive products? You can use either "search" or "browse."

  • search (required)
    The search terms or browse id you would like to use. Multiple search terms can be separated with spaces.

  • line (required)
    The product line that you are searching or browsing. Valid lines can be found on Amazon’s site.

  • lastn
    The number of products you wish to display. Amazon allows a maximum of 15 products, so setting this number to 1 or above will have no effect. If you don’t include the lastn attribute, 15 products will be returned.

Available tags. Inside the <MTAmazon></MTAmazon> container any of the following tags can be used:

The product’s name or title.

The Amazon product ID.

For books, the author; for movies, the lead actor; for msuic, the artist; for mos everything else, the manufacturer.

The URL for the full-size product image.

The URL for the thumbnail product image.

Amazon’s price. If this is blank, it means that Amazon’s price is so low that it can’t be advertised. A shopper must actually add the product to their shopping cart before seeing it’s price.

The manufacturer’s suggested, or list, price.

The date that the item was released. You can use MT’s date tag formatting to format this the way you would like. None of the dates include times, so if you use any time values in your formatting, the time is treated as 12:00 am. Some Amazon products do not have a day of the month included with the release date, so even if your date format specifies a day, it won’t be shown for those products.

The product availabilty.

The link to the product. This includes your Associate id, so if someone purchases you’ll get credit for the sale.


<MTAmazon associateid="kalsey-20" method="search" search="dogs" line="books" lastn="10">
<p><a href="<MTAmazonLink>">
<img src="<MTAmazonSmallImage>" align="left" border="0"><MTAmazonTitle>
<MTAmazonReleaseDate format="%B %e, %Y"><br>
Price: <MTAmazonSalePrice></p><br clear=all>

See it. Visit these sites to see MTAmazon in action:

License. Like our other freeware, this plugin is released under the open-source MIT License. In plain English, that means you can do whatever you want with the software, including modifying it, selling it, or eating it, but we’re not responsible for anything that goes wrong.

Revision History
1.0 - July 14, 2002
Initial public release

Torgny Bjers
July 25, 2002 5:38 AM

I just tried out the plugin, and I cannot get it to work. It doesn't even return errors when I omit the required fields in the MTAmazon tag. What can I do to test if it actually loads the plugin?

Torgny Bjers
July 25, 2002 10:13 AM

Oooh! I actually made it work by recoding the entire plugin with some help from your code and the Amazon XML SDK. I will post this code somewhere so that those that cannot use XML::Simple (like me), can use it...

Torgny Bjers
July 25, 2002 10:31 AM

Adam Kalsey
July 25, 2002 11:54 AM

You can install XML::Simple into your extlib directory just like you can with other MT required modules. The next version of the plugin is coming very soon and will provide more help in checking for and installing the required modules.

October 14, 2002 9:48 AM

Hi, Excellent module. Once I copied into the XML folder, it worked fine. I love this stuff!! Many thanks, Andy

October 25, 2002 8:28 AM

Great module, easy to use but the setup can be a little confusing. I got the search working great but I can't get the browse to return any results. Any hints? Thanks for making this software freely available.

Adam Kalsey
October 25, 2002 9:29 AM

First of all, make sure you are using the latest version of the plugin. The most current version is at There's also an email list there where you can post questions about the plugin.

October 31, 2003 6:46 AM

Hello - The Plug In sometimes works but sometimes I get this error message and have to remove the Amazon Tags from the Individual Entry Template to get the site to rebuild. Any ideas? I am using the Entry Title tag to set the browse if that helps. Damian An error occurred: Building entry 'Nu Jazz Days Festival, Bratislava' failed: Build error in template 'Individual Entry Archive': Error in tag: Error reading XML content: syntax error at line 1, column 49, byte 49 at /usr/lib/perl5/site_perl/5.005/i386-linux/XML/ line 185 .

Trackback from Music and Madness
December 5, 2003 11:25 AM

mt amazon it is!

Excerpt: Amazon plugin :: Kalsey Consulting Group amazon plugin homepage, templates and other cool stuff...

Trackback from Mehh? Mehh!
August 2, 2005 1:16 PM

Useful site for MT users

Excerpt: An extremely useful site I came across while installing pluggins for movable type is Adam Kelseys blog which contains such beauties as the related entries plugin which I'm attempting to implement right now (had it working am just trying to...

Your comments:

Text only, no HTML. URLs will automatically be converted to links. Your email address is required, but it will not be displayed on the site.


Not your company or your SEO link. Comments without a real name will be deleted as spam.

Email: (not displayed)

If you don't feel comfortable giving me your real email address, don't expect me to feel comfortable publishing your comment.

Website (optional):

Follow me on Twitter

Best Of

  • How not to apply for a job Applying for a job isn't that hard, but it does take some minimal effort and common sense.
  • Movie marketing on a budget Mark Cuban's looking for more cost effective ways to market movies.
  • California State Fair The California State Fair lets you buy tickets in advance from their Web site. That's good. But the site is a horror house of usability problems.
  • Customer reference questions. Sample questions to ask customer references when choosing a software vendor.
  • Comment Spam Manifesto Spammers are hereby put on notice. Your comments are not welcome. If the purpose behind your comment is to advertise yourself, your Web site, or a product that you are affiliated with, that comment is spam and will not be tolerated. We will hit you where it hurts by attacking your source of income.
  • More of the best »

Recently Read

Get More

Subscribe | Archives


Assumptions and project planning (Feb 18)
When your assumptions change, it's reasonable that your project plans and needs change as well. But too many managers are afraid to go back and re-work a plan that they've already agreed to.
Feature voting is harmful to your product (Feb 7)
There's a lot of problems with using feature voting to drive your product.
Encouraging 1:1s from other managers in your organization (Jan 4)
If you’re managing other managers, encourage them to hold their own 1:1s. It’s such an important tool for managing and leading that everyone needs to be holding them.
One on One Meetings - a collection of posts about 1:1s (Jan 2)
A collection of all my writing on 1:1s
Are 1:1s confidential? (Jan 2)
Is the discussion that occurs in a 1:1 confidential, even if no agreed in the meeting to keep it so?
Skip-level 1:1s are your hidden superpower (Jan 1)
Holding 1:1s with peers and with people far below you on the reporting chain will open your eyes up to what’s really going on in your business.
Do you need a 1:1 if you’re regularly communicating with your team? (Dec 28)
You’re simply not having deep meaningful conversation about the process of work in hallway conversations or in your chat apps.
What agenda items should a manager bring to a 1:1? (Dec 23)
At least 80% of a 1:1 agenda should be driven by your report, but if you also to use this time to work on things with them, then you’ll have better meetings.

Subscribe to this site's feed.


Adam Kalsey

Mobile: 916.600.2497

Email: adam AT

Twitter, etc: akalsey



©1999-2019 Adam Kalsey.