Amazon Products Feed Variables
Required Changes:
- @associate_ids = ("freewarfrommrrat"); - your Amazon affiliate id(s)
Basic Options:
- $show_search_options = "no"; - show link under search box to AllSearches page
- $sort_type = "+salesrank"; - set the default sort method
The only methods that work with all modes are: +titlerank (Alphabetical), +salesrank (Bestselling), and +pmrank (Featured Items).
- $locale = "us"; - set the locale as "us" for Amazon.com or as "uk" for Amazon.co.uk
- @uk_associate_ids = ("mrratcom-21"); - when you use $locale="uk" or input_locale=uk you MUST put your uk associate id here
- $max_results = 10; - maximum results per page
Amazon usually returns a maximum of 10 results per page
- $submit_button_style - change the look of all of the buttons in the script using CSS.
- $cart_text3_style - change the look of the style for the %%shopping_cart_link%% using CSS.
Advanced Options:
- @featured_products = ("055358135X","0764112082"); - list of items to feature
Either all of them on a page (FeaturedProducts) or one picked randomly on all pages (apf_featured_product).
- $use_cache = "yes"; - turns cache on and off
Set to "no" if you get "500" errors.
- $cache_file = "apf_xml_cache"; - location of the cache
- $cache_max_size = "78"; - size of the cache
As a rough guess you can estimate that each XML request will use 6.5k of disk space so the default setting of 78 should use 1/2 meg of disk space.
- $review_length = 500; - length of shortened reviews
- @page_templates = ("page_1.template", "page_2.template"); - location of page templates
If blank or non-existent will use embedded HTML
- @products_templates = ("products_1.template", "products_2.template"); "
- @item_templates = ("item_1.template", "item_2.template"); "
- @larger_image_templates = ("image_1.template"); "
- @sellersearch_templates = ("sellersearch_1.template"); "
- @sellerprofile_templates = ("sellerprofile_1.template"); "
- @thirdparty_products_templates = ("thirdpartyproducts_1.template"); "
- @browse_menu_templates = ("browse_menu_1.template"); "
- @featured_product_templates = ("featured_product_1.template"); "
- @blended_templates = (); "
- @shopping_cart_templates = (); "
- @customer_reviews_templates = (); "
- @language_templates = ("apf_dutch.language", "apf_english.language"); - location of optional language files
If blank or non-existent will use embedded English
- input_mode - the mode
- input_string - the search subject
- input_templates - which set of templates to use
- input_link_templates - which set of templates to use for all subsequent pages
- input_language - which language file to use
- input_id - the number of the category to browse
- input_max - maximum results per page - Amazon only sends back 10 results per page
- input_link_max - maximum results per page for all subsequent pages
- input_page - which page of results - Amazon sends 10 results for page 1, 10 for page 2, etc.
- input_item - specific product(s) to display by ASIN (for books ASIN = ISBN)
- input_sort - sort method
- input_search_type - type of search
- input_locale - allows you to change between us for Amazon.com and uk for Amazon.co.uk
- input_cart_action - manipulate the shopping cart
- input_pricerange - limit search to a single price or a range of prices (in US pennies, i.e. pricerange=1000-2000)
- input_keywords - add keyword search to other searches
Store | US mode | UK mode |
All Products | blended | blended |
Baby | baby | |
Books | books | books_uk |
Classical Music | classical | classical |
DVD | dvd | dvd_uk |
Electronics | electronics | electronics_uk |
Outdoor Living | garden | |
Kitchen & Housewares | kitchen | kitchen_uk |
Magazines | magazines | |
Popular Music | music | music |
Computers | pc_hardware | |
Camera & Photo | photo | |
Software | software | software_uk |
Toys & Games | toys | toys_uk |
Tools & Hardware | universal | |
Video | vhs | vhs_uk |
Computer & Video Games | videogames | video_games_uk |
- AllSearches - displays a page with search boxes for all types
- AsinSearch - search by ASIN or ISBN
- ActorSearch - search by Actor or Actress in DVD or Video
- ArtistSearch - search by Artist in Music
- AuthorSearch - search by Author in Books
- DirectorSearch - search by Director in DVD or Video
- ListManiaSearch - search by ListMania list id
- ManufacturerSearch - search by Manufactuer in electronics, kitchen, videogames, software, photo, or pc-hardware
- PowerSearch - advanced search capabilities in Books
- SimilaritySearch - search for products Similar to a specific ASIN
- Collectible - search third-party Collectible products by ASIN
- ThirdPartyNew - search third-party New products by ASIN
- Refurbished - search third-party Refurbished products by ASIN
- Used - search third-party Used products by ASIN
- ExchangeSearch - search for a specific third-party product by it's Exchange id
- SellerSearch - search for a list of products by a third-party Seller's id
- UpcSearch - search by UPC in Music
- WishlistSearch - search by WishList id
- FeaturedProducts - displays the items in @featured_products
- CustomerReviews - displays full reviews
- +pmrank - Featured Items: all modes
- +salesrank - Bestselling: all modes
- +reviewrank - Average Customer Review: books, electronics
- +pricerank - Price (Low to High): books
- +inverse-pricerank - Price (High to Low): books
- +price - Price (Low to High): software, garden, universal, videogames, kitchen
- -price - Price (High to Low): software, garden, universal, videogames, kitchen
- +daterank - Publication Date: books
- +titlerank - Alphabetical (A-Z): all modes
- -titlerank - Alphabetical (Z-A): books, garden, universal, photo, pc_hardware, kitchen
- +manufactrank - Manufacturer (A-Z): garden, universal, kitchen
- -manufactrank - Manufacturer (Z-A): garden, universal, kitchen
- +artistrank - Artist Name: music, classical
- +orig-rel-date - Original Release Date: music, classical
Variables for use in the Templates
All of the XML elements returned from Amazon are converted into variables for use in the script. These elements are listed on the AWS Request Results page. You can use any of those elements as variable by placing %% before and after the element name. The variables listed below are additional variables generated by the script from those results.
page_templates - the overall page HTML (<head>, <meta>, <body>, etc.) - sample
- %%store%% - a more descriptive form of mode
- %%subject%% - what was searched for or the browse category
- %%header%% - either "store : subject" or the linked browse path (i.e. Bestsellers > store > subject) when applicable
- %%in_association%% - the standard Amazon.com disclaimer
- %%search_box%% - the search box
- %%sort_box%% - the sort box
- %%chat_link%% - link to Amazon.com's chat rooms using your associate id
- %%shopping_cart_link%% - a link to the shopping cart
- %%see_next%% - a link to the next page of results when applicable
- %%see_prev%% - a link to the previous page of results when applicable
- %%see_back%% - a javascript link to the previous page, works just like a browser's back button
- %%see_index%% - for a "Google" style index of results pages
- %%see_total%% - displays "page x of x" when there are multiple pages of results
- %%shopping_cart_link%% - link to the shopping cart when applicable
- %%products_html%% - the results wrapped in the HTML from the other templates
(you MUST have this on the page template)
- %%international_links%% - provides links to other locales
products_templates - the HTML to display each item for multiple results - sample
- %%item_url%% - URL to display the item page
- %%pda_item_url%% - URL to display the item page at Amazon on a PDA
- %%rim_item_url%% - URL to display the item page at Amazon on a RIM Blackberry
- %%my_artists%% - either the manufacturer or a comma separated list of authors, actors, or artists
- %%my_prices%% - formated version of the list price, Amazon.com's price, and discount when available
- %%see_back%% - a javascript link to the previous page, works just like a browser's back button
- %%result_number%% - the number of the result
item_templates - the HTML to display a single item result - sample
- All of the variables from the product template
- %%old_product_url%% - a link to the item on Amazon.com's site using the old method of linking
- %%shopping_cart_button%% - button to add the item to the script's shopping cart
(only works with items that are available for immediate purchase)
- %%buy_button%% - button to add the item directly to Amazon.com's shopping cart
- %%oneclick_button%% - button to pop-up window asking if you would like to use one-click to buy the item
- %%wishlist_button%% - button to add the item directly to the person's wish list at Amazon.com
- %%wedding_button%% - button to add the item directly to the person's wedding registry at Amazon.com
- %%baby_button%% - button to add the item directly to the person's baby registry at Amazon.com
- %%my_large_image_url%% - URL to display the larger image page
- %%my_used%% - formated version of the used price when available
- %%my_collectible%% - formated version of the collectible price when available
- %%my_thirdpartynew%% - formated version of the marketplace new price when available
- %%my_refurbished%% - formated version of the refurbished price when available
- %%my_prices%% - formatted version of ListPrice, OurPrice, and discount
- %%my_artists%% - link to Artist, Actor, Director, or Manufacturer search when applicable
- %%my_features%% - formated list of features
- %%my_similar_products%% - formated list of similar items
(aka Customers who bought this also bought ...)
- %%my_similar_products_images%% - just like %%my_similar_products%% but using images instead of text
- %%my_accessories%% - formated list of accessories
- %%my_accessories_images%% - just like %%my_accessories%% but using images instead of text
- %%my_tracks%% - formated list of music tracks
- %%my_comments%% - formated full version of customer comments
- %%my_shortened_comments%% - formatted shortened version of comments
- %%my_descriptors%% - comma separated list of item descriptors
(kind of a catch all for a bunch of small item details)
- %%my_browse_list%% - my best attempt at cross linking this item
- %%my_availability%% - formatted version of Availability
- %%first_review_rating_display%% - first customer review rating
- %%first_review_summary%% - first customer review title
- %%first_review_comment%% - first customer review full comment
- %%first_review_shortened_comment%% - first customer review shortened comment
larger_image_templates - the HTML to display the large product image - sample
- %%store%% - a more descriptive form of mode
- %%subject%% - what was searched for or the browse category
- %%see_back%% - a javascript link to the previous page works just like a browser's back button
sellersearch_templates - the HTML to display SellerSearch results - sample
- %%ExchangeSellerNickname%% - seller nickname
- %%ExchangeTitle%% - product title
- %%ExchangeCondition%% - usually a description of product or seller
- %%ExchangeQuantity%% - quantity
- %%ExchangeOfferingType%% - type of product; new, used, collectible, refurbished
- %%ExchangeConditionType%% - condition of product
- %%ExchangeAvailability%% - availability
- %%ExchangeSellerState%% - state
- %%ExchangeSellerCountry%% - country
- %%ExchangeEndDate%% - nonsense usually, probably would apply to auctions
- %%ExchangePrice%% - price
- %%item_url%% - URL to display the item page
- %%buy_button%% - button to add the item directly to Amazon.com's shopping cart
sellerprofile_templates - the HTML to display seller profile - sample
- %%SellerNickname%% - seller nickname
- %%OverallFeedbackRating%% - they're rather self-descriptive aren't they
- %%NumberOfFeedback%% - you don't actually need me saying something here
- %%NumberOfCanceledAuctions%% - well, maybe something about the llamas
- %%FeedbackRating%% - the llama comment above was a vague reference to Monty Python
- %%FeedbackDate%% - those people responsible for the comments have been sacked
- %%FeedbackComments%% - wait a minute, that was a Python reference too
thirdparty_products_templates - the HTML to display third-party products - sample
- %%SellerNickname%% - seller nickname
- %%SellerRating%% - here we go again, with the self descriptive variable names
- %%Condition%% - note to self, never write docs in the middle of the night
- %%ConditionType%% - lack of sleep causes visions of llamas
- %%ExchangeAvailability%% - and the moose, can't forget the moose
- %%SellerState%% - those responsible for sacking the people writing the comments have been sacked
- %%SellerCountry%% - country of seller
- %%ShipComments%% - shipping comments
- %%OfferingPrice%% - the fjords are beautiful this time of year
- %%sellersearch_url%% - URL to display the SellerSearch page
- %%buy_button%% - button to add the item directly to Amazon.com's shopping cart
featured_product_templates - the HTML to display a featured product - sample
- %%my_featured_item_url%% - just like item_url
- %%featured_ImageUrlSmall%% - just like ImageUrlSmall
- %%featured_ProductName%% - figure it out for your own bloody self
- %%featured_OurPrice%% - Amazon.com's price
blended_templates - the HTML to display blended (All Products) results - sample
- %%blended_mode%% - the mode that the next results are for
- %%blended_see_more_url%% - link to a more results for that mode
- %%blended_mode_totalresults%% - total number of results for that mode
shopping_cart_templates - the HTML to display the shopping cart - sample
this is really complicated and you're asking for trouble if you change anything more than just the colors
- %%script_name%% - the URL of the script
- %%form_options%% - stuff from the URL, all the input_whatevers you might be using
- %%my_cart_item_price%% - product price * quantity
- %%cart_qty_total%% - total quantity of all products
- %%cart_price_total%% - oh, take a guess
- %%continue_shopping%% - back button
- %%checkout%% - button to transfer the shopping cart from AWS to a real Amazon shopping cart
Sample page_apf.template and products_apf.template
- apf_include - include a text file or nav_menu
(like SSI but only works with text files)
- apf_start - product to start using HTML at
(if not specified apf_start=1)
- apf_end - last product use HTML at
(you can use the word last to specify the last product)
- apf_repeat - how often to repeat the HTML
(if 1 use with every product, 2 every other product, 3 every third, etc.)
- apf_featured_product - used to feature a product, see the Advanced Guide
baby: - 540988 - General
- 735502 - Outlet
- 542460 - Activity
- 541586 - Bath & Potty
- 541564 - Feeding
- 541558 - Gear
- 541580 - Health & Safety
- 738468 - Layette
- 541572 - Nursery
books: - 1000 - General
- 733804 - Outlet
- 1 - Arts & Photography
- 2 - Biographies & Memoirs
- 3 - Business & Investing
- 4 - Children's Books
- 6 - Cooking, Food & Wine
- 13643 - Engineering
- 86 - Entertainment
- 301889 - Gay & Lesbian
- 10 - Health, Mind & Body
- 9 - History
- 48 - Home & Garden
- 49 - Horror
- 10777 - Law
- 17 - Literature & Fiction
- 13996 - Medicine
- 18 - Mystery & Thrillers
- 53 - Nonfiction
- 290060 - Outdoors & Nature
- 20 - Parenting & Families
- 173507 - Professional & Technical
- 21 - Reference
- 22 - Religion & Spirituality
- 23 - Romance
- 75 - Science
- 25 - Science Fiction & Fantasy
- 26 - Sports
- 28 - Teens
- 27 - Travel
classical: - 85 - General
- 5260 - Ballets & Dances
- 5318 - Chamber Music
- 5338 - Featured Composers, A-Z
- 38472 - Featured Performers, A-Z
- 36632 - Forms & Genres
- 36712 - Historical Periods
- 38374 - Instruments
- 63654 - Sacred & Religious
- 63681 - Symphonies
dvd: - 404276 - General
- 734006 - Outlet
- 163296 - Action & Adventure
- 538708 - African American Cinema
- 712256 - Animation
- 517956 - Anime & Manga
- 163313 - Art House & International
- 163345 - Classics
- 163357 - Comedy
- 466674 - Cult Movies
- 508532 - Documentary
- 163379 - Drama
- 301667 - Gay & Lesbian
- 163396 - Horror
- 163414 - Kids & Family
- 586156 - Military & War
- 508528 - Musicals & Performing Arts
- 163420 - Music Video & Concerts
- 512030 - Mystery & Suspense
- 163431 - Science Fiction & Fantasy
- 163448 - Special Interests
- 163450 - Television
- 163312 - Westerns
electronics: - 493964 - General
- 734050 - Outlet
- 281407 - Accessories & Supplies
- 1065836 - Audio & Video
- 172455 - Computer Add-Ons
- 172517 - Gadgets
- 172526 - GPS & Navigation
- 172594 - Handhelds & PDAs
- 172574 - Office Electronics
- 172635 - Printers
- 172606 - Telephones
garden: - 468250 - General
- 734346 - Outlet
- 553632 - Backyard Birding
- 553648 - Gifts
- 553760 - Grills & Fryers
- 553778 - Heating & Lighting
- 1063918 - Leisure & Fitness
- 553788 - Outdoor Decor
- 553824 - Patio Furniture
- 553844 - Pest Control
kitchen: - 491864 - General
- 734070 - Outlet
- 289668 - Baking
- 289728 - Bar Tools & Glasses
- 289742 - Coffee, Tea & Espresso
- 289814 - Cookware
- 289851 - Cutlery
- 510080 - Housewares
- 289913 - Small Appliances
- 289891 - Tableware
magazines: - 599872 - General
- 700580 - Outlet
- 602320 - Business & Finance
music: - 301668 - General
- 734368 - Outlet
- 30 - Alternative Rock
- 31 - Blues
- 265640 - Broadway & Vocalists
- 173425 - Children's Music
- 173429 - Christian & Gospel
- 85 - Classical
- 67204 - Classic Rock
- 16 - Country
- 7 - Dance & DJ
- 32 - Folk
- 67207 - Hard Rock & Metal
- 33 - International
- 289122 - Latin Music
- 35 - Miscellaneous
- 36 - New Age
- 84 - Opera & Vocal
- 37 - Pop
- 38 - Rap & Hip-Hop
- 39 - R&B
- 40 - Rock
- 42 - Soundtracks
pc_hardware: - 542030 - General
- 565098 - Desktops
- 565108 - Notebooks
photo: - 508048 - General
- 733952 - Outlet
- 172435 - Accessories
- 499320 - Binoculars
- 172421 - Camcorders
- 499106 - Film Cameras
- 499176 - Frames & Albums
- 499328 - Printers & Scanners
- 525462 - Projectors
- 524136 - Surveillance Systems
software: - 491286 - General
- 735326 - Outlet
- 229535 - Business & Office
- 229548 - Children's Software
- 229614 - Graphics
- 229624 - Home & Hobbies
- 497026 - Language & Travel
- 290562 - Linux
- 229637 - Networking
- 229653 - Operating Systems
- 229540 - Personal Finance
- 229667 - Programming
- 229663 - Software for Handhelds
- 229672 - Utilities
- 497022 - Video & Music
toys: - 491290 - General
- 735410 - Outlet
- 171662 - Action Figures
- 171859 - Arts & Crafts
- 171814 - Building Sets, Blocks & Models
- 171569 - Dolls
- 720366 - Electronics
- 171689 - Games
- 171960 - Sports & Outdoor Play
- 171992 - Stuffed Animals
universal: - 468240 - General
- 735342 - Outlet
- 553294 - Automotive Supplies
- 495266 - Electrical
- 551238 - Hand Tools
- 511228 - Hardware
- 495346 - Heating & Cooling
- 551240 - Job Site Equipment
- 551242 - Lawn & Garden Tools
- 495224 - Lighting
- 551236 - Power Tools
vhs: - 404274 - General
- 735448 - Outlet
- 141 - Action & Adventure
- 301597 - African American Cinema
- 712260 - Animation
- 281300 - Anime & Manga
- 126 - Art House & International
- 127 - Classics
- 128 - Comedy
- 162482 - Cult Movies
- 129 - Drama
- 301665 - Gay & Lesbian
- 131 - Horror
- 132 - Kids & Family
- 586154 - Military & War
- 508526 - Musicals & Performing Arts
- 133 - Music Video & Concerts
- 512026 - Mystery & Suspense
- 144 - Science Fiction & Fantasy
- 135 - Special Interests
- 169798 - Sports
- 136 - Television
- 139725 - Westerns
videogames: - 471280 - General
- 733954 - Outlet
- 229783 - Game Boy
- 541020 - Game Boy Advance
- 229647 - Mac Games
- 294940 - More Systems
- 229763 - Nintendo 64
- 229575 - PC Games
- 229773 - PlayStation
- 301712 - PlayStation2
- 229793 - Sega Dreamcast