Associate Engine : Script Parameters  
Home > Associate Engine > Documentation > Script Parameters   Updated: 17-Apr-2008

Script Parameters

Before reading this section, we recommend that you start with the Quick Tutorial of Parameters.

Browse Script Parameters
  1. GET & POST Methods
  2. Search-Related Parameters
    1. amazon.com Sections
    2. Search Types
    3. Search Parameters
    4. Search Modifier Parameters
    5. Sorting the Results
 
  1. Output-Related Parameters
  2. Run-Related Parameters
  3. Miscellaneous Parameters
  4. ASIN List Searches
  5. PowerSearch (Advanced Search of Books)
 


GET & POST Methods

The Associate Engine script can be called either via a link or via a form. Specifically, parameters can be passed to the script via the GET method or the POST method.


GET Method (Links or Forms)

The GET method means that you can put the parameters into the URL of a clickable link, such as:

Associate Engine uses the internet's standard way of specifying parameters. That is, each parameter is a NAME=VALUE pair and pairs are separated by the & symbol.

Note: If the NAME is specified without a value (e.g.: /cgi-bin/ae.pl?script&type=best&mode=books), then the value defaults to 1 thus script=1 can be abbreviated to script


POST Method (Forms)

The POST method is used in forms (note: the GET method can also be used in forms).

Set the ACTION of your form to be the URL of ae.pl on your webserver, e.g.: <FORM ACTION="/cgi-bin/ae.pl" METHOD="POST">

Form fields are used to specify the parameters. Hidden form fields can be used to specify parameters that you don't want the user to be able to change. For example, the following form does a search of DVD's for the user-specified keywords:

<FORM ACTION="/cgi-bin/ae.pl" METHOD="POST">
    <INPUT TYPE="HIDDEN" NAME="mode" VALUE="dvd">
    <INPUT TYPE="TEXT" NAME="keyword">
    <INPUT TYPE="SUBMIT" VALUE="Search">
</FORM>

Note:If you want the user to be able to bookmark the results page that appears when they submit the form, then change the <FORM> and use METHOD="GET" instead. Web browsers cannot properly bookmark any webpage that was reached from a form that has METHOD="POST" since the resulting URL in the web browser's Location box does not contain any parameters (i.e.: it has no ?PARAMETERS).



Search-Related Parameters

Several types of searches are supported. The type of search to perform is specified by what parameter is used (described below). There are also optional parameters can be used to modify the search, such as what page to start at, how to sort the results, and what price range to filter on.


amazon.com Sections

Most search types (not all) require you to specify what product section of amazon.com to search in, such as the Books section, the DVD section, the Toys section, etc. The mode parameter is used to specify the product section. Its possible values are:

amazon.com Section amazon.com mode amazon.co.uk mode
Apparel apparel apparel
Arts & Crafts not supported n/a
Automotive automotive not supported
Baby baby baby
Beauty beauty beauty
Books books books
Classical Music classical classical
DVD dvd dvd
Electronics electronics electronics
Gourmet Food gourmetfood n/a
Groceries grocery not supported
Health and Personal Care healthpersonalcare healthpersonalcare
Home & Garden homegarden homegarden
Industrial industrial n/a
Jewelry jewelry jewelry
Amazon.com Kindle kindlestore kindlestore
Kitchen kitchen kitchen
Lighting n/a not supported
Magazines magazines n/a
Mobile Apps for Android mobileapps n/a
MP3 Music Downloads mp3downloads not supported
Popular Music music music
Musical Instruments musicalinstruments not supported
Office Products officeproducts not supported
Outdoor Living, Lawn & Patio outdoorliving outdoorliving
Personal Computers pchardware not supported
PetS upplies petsupplies n/a
Cameras & Photography photo n/a
Shoes not supported not supported
Software software software
Sporting Goods sportinggoods sportinggoods
Software Video Games n/a (see videogames) softwarevideogames
Tools & Hardware tools tools
Toys toys toys
Unbox Video Downloads unboxvideo n/a
VHS Videos vhs vhs
DVD & VHS video video
Video Games videogames videogames
Watches watches watches
Wireless Phones & Service wireless n/a
Wireless Accessories wirelessaccessories n/a

Thus mode=books causes the Books section to be searched.

Some sections are combinations of other smaller sections so you can search multiple sections all at once. For example, video is a combation of the dvd and vhs sections. The combinations are:

Combined mode Individual mode's
blended Apparel, Automotive, Books, DVD, Electronics, GourmetFood, HealthPersonalCare, Kitchen, Music, PCHardware, PetSupplies, Shoes, Software, SoftwareVideoGames, SportingGoods, Tools, Toys, VHS, VideoGames

Note: blended does not include all the possible store sections.

music Classical, DigitalMusic, MusicTracks
video dvd, vhs

Note: amazon.co.uk uses different mode values. See: Using Associate Engine with amazon.co.uk.


Search Types

The following table shows what parameters to use for the various search types. Text shown in green (e.g.: MODE) indicates a value that you need to specify. For example, mode=MODE means that you should replace MODE with one of the possible modes (see table above).

Search Type Parameters to Use
Section homepage

type=browse&mode=MODE

Example: type=browse&mode=books

Bestsellers of a section

type=bestsellers&mode=MODE

Example: type=bestsellers&mode=vhs
Note: type=bestsellers can be shortened to type=best

Keyword search of a section

type=search&mode=MODE&keyword=KEYWORDS

Example: type=search&mode=books&keyword=Harry+Potter

Keyword search of all sections (blended search)

type=search&mode=blended&keyword=KEYWORDS

Example: type=search&mode=blended&keyword=Harry+Potter

Section subpage (browse node)

type=browse&mode=NODE

Example: type=browse&mode=578324
(browse node 578324 is "Fitness & Yoga" DVD's).

See: FAQ "How do I determine the browse number to use in type=browse&mode=NUMBER ?"

Keyword search of section subpage (browse node with keyword)

type=bestsellers&mode=NODE&keyword=KEYWORDS

Example: type=bestsellers&mode=578324&keyword=abs
(browse node 578324 is "Fitness & Yoga" DVD's).

Note: Since browse node 578324 is a top-level section page, you need to use type=bestsellers rather than type=browse.

ASIN Search

asinsearch=ASIN
asinsearch=ASIN,ASIN,ASIN,...

One or more ASIN's can be specified separated by comma. A list of ASIN's can also be put into an ASIN file. ASIN's and ASIN list names can be mixed together in the parameter value. This parameter supports Clock Codes.

Examples:
asinsearch=0439567629
asinsearch=0439567629,mylist:3

ISBN Search of books

asinsearch=ISBN
asinsearch=ISBN,ISBN,ISBN,...

One or more ISBN's can be specified separated by comma. A list of ISBN's can also be put into an ASIN file (ISBN's and ASIN's are equivalent for books). ISBN's and ASIN list names can be mixed together in the parameter value. This parameter supports Clock Codes.

Example: asinsearch=0439567629

UPC Search of popular music or classical music

upcsearch=UPC&mode=MODE
upcsearch=UPC,UPC,UPC,...&mode=MODE

Possible values for MODE are music and classical. The default mode is music.

One or more UPC's can be specified separated by comma. A list of UPC's can also be put into a UPC list text file. UPC's and UPC list names can be mixed together in the parameter value. This parameter supports Clock Codes.

Example: upcsearch=696998718524&mode=music

Book Author Search

authorsearch=NAME

Example: authorsearch=Wayne+Dyer

Power Search (advanced search of books)

powersearch=QUERY
See PowerSearch for description of QUERY.

Musical Artist Search in popular music or classical music

artistsearch=NAME&mode=MODE

Possible values for MODE are music and classical. The default mode is music.

Example: artistsearch=Celine+Dion&mode=music

Actor/Actress Search in VHS or DVD's

artistsearch=NAME&mode=MODE

Possible values for MODE are vhs, dvd, and video (both VHS and DVD's). The default mode is video.

Example: actorsearch=Harrison+Ford&mode=dvd

Director Search in VHS or DVD's

directorsearch=NAME&mode=MODE

Possible values for MODE are vhs, dvd, and video (both VHS and DVD's). The default mode is video.

Example: directorsearch=Alfred+Hitchcock&mode=video

Manufacturer Search

manufacturersearch=NAME&mode=MODE

Possible values for MODE are electronics, kitchen, videogames, software, photo, and pc-hardware. The default mode is electronics.

Example: manufacturersearch=Palm&mode=electronics

Listmania! Search

listmaniasearch=LISTID

Example: listmaniasearch=34TRCFE5HC23M

Note: If you create a new ListMania list at amazon.com, it may take up to 24 hours for amazon.com to make that list available through its Amazon.com Web Services (AWS) servers. The www.amazon.com website servers are separate from amazon.com's AWS servers. Until amazon.com copies your ListMania list to their AWS servers, your ListMania list will show up as "no results found". Try again in 24 hours.

WishList Search

wishlistsearch=WISHLISTID

Example: wishlistsearch=BUWBWH9K2H77

For more examples, see the "Overview" section and the "Sample HTML" section.


Search Parameters

Parameter Default Description (default shown in red)
type bestsellers

The "type" parameter indicates what type of page at amazon.com you want to display. The "type" parameter is used in conjunction with the "mode" and "search" parameters. Possible values are:

  • bestsellers = "Bestsellers" pages.
  • browse = a "browse" page.
  • search = keywords search.
mode books

The "mode" parameter indicates what subtype of page at amazon.com you want to display. The "mode" parameter is used in conjunction with the "type" parameter. Possible values for the "mode" parameter depend upon the value used for the "type" parameter as indicated below. These values for "mode" are the same values that amazon.com uses for its own "mode " parameter.

The links below are live working examples. Try them out. The "show as grid" link shows what happens when the grid script parameter is also specified (in these examples it is set to "grid=c:3,r:4,v").

For more examples, see the "Overview" section and the "Sample HTML" section.

keyword (empty)

Optional parameter that specifies keywords used to do a search. If used as part of a URL, separate keywords with a plus sign (+) character; this is converted to a space character (e.g.: "harrison+ford"). Keywords are used only if the "type" parameter is "search".

search (empty)

Optional parameter that specifies a search that was pre-defined in the configuration file. See search.* configuration variables.


Search Modifier Parameters

The following optional parameters modify the search.

Parameter Default Description (default shown in red)
first 1

Optional parameter that specifies what result number to start at. The default is 1. The number of results on the page is specified via the pagesize script parameter or the pagesize configuration variable.

page 1

Optional parameter that specifies what page to start the results at. The default is page 1. The number of results on the page is specified via the pagesize script parameter or the pagesize configuration variable.

price (empty)

Optional parameter that specifies the price range to filter products with. Only products within the specified price range will be displayed. The minimum and maximum prices are specified as price=MINPRICE-MAXPRICE For example, price=2000-5000 would cause products in the price range $20.00 through $50.00 (inclusive) to be shown.

sort (empty)

Optional parameter that specifies the sort order of results. The default is to sort by decreasing sales rank. The possible values of this parameter vary depending upon the type of search being performed. See Sorting the Results.


Sorting the Results

The results can be sorted in various ways by using the sort parameter. The possible values of the Associate Engine sort parameter vary depending upon the type of search being performed.

The following tables are based on the AWS API Guide documentation (version 9-Feb-2004). The Associate Engine sort parameter is passed directly to Amazon Web Services (AWS) as is. The values of the sort parameter shown below were choosen by Amazon.com as part of AWS; comments about inconsistencies should be address to Amazon.com Associates management :)

NOTE: The order of results returned by AWS may not exactly match the order of results displayed on the amazon.com website. This is due to the sort algorithm used by AWS (Associate Engine does not do the sorting; AWS does the sorting); comments about differences in results between AWS and the amazon.com website should be addressed to Amazon.com Associates management :)

Sorting Books Results
(US: mode=books) (UK: mode=books-uk)
Sort Type sort Parameter
Featured Items +pmrank
Bestselling +salesrank
Average Customer Review +reviewrank
Price (Low to High) +pricerank
Price (High to Low) +inverse-pricerank
Publication Date +daterank
Alphabetical (A-Z) +titlerank
Alphabetical (Z-A) -titlerank


Sorting Camera and Photo Results
(US: mode=photo)
Sort Type sort Parameter
Featured Items +pmrank
Bestselling +salesrank
Alphabetical (A-Z) +titlerank
Alphabetical (Z-A) -titlerank


Sorting Computers Results
(US: mode=pc-hardware)
Sort Type sort Parameter
Featured Items +psrank
Bestselling +salesrank
Alphabetical (A-Z) +titlerank
Alphabetical (Z-A) -titlerank


Sorting DVDs Results
(US: mode=dvd) (UK: mode=dvd-uk)
Sort Type sort Parameter
Bestselling +salesrank
Alphabetical +titlerank


Sorting Electronics Results
(US: mode=electronics) (UK: mode=electronics-uk)
Sort Type sort Parameter
Featured Items +pmrank
Bestselling +salesrank
Alphabetical +titlerank
Review +reviewrank


Sorting Kitchen Results
(US: mode=kitchen) (UK: mode=kitchen-uk)
Sort Type sort Parameter
Featured Items +pmrank
Bestselling +salesrank
Alphabetical (A-Z) +titlerank
Alphabetical (Z-A) -titlerank
Manufacturer (A-Z) +manufactrank
Manufacturer (Z-A) -manufactrank
Price (Low to High) +price
Price (High to Low) -price


Sorting Music & Classical Music Results
(US: mode=music or classical) (UK: mode=music or classical)
Sort Type sort Parameter
Featured Items +psrank
Bestselling +salesrank
Artist Name +artistrank
Original Release Date +orig-rel-date
Alphabetical +titlerank


Sorting Outdoor Living Results
(US: mode=garden)
Sort Type sort Parameter
Featured Items +psrank
Bestselling +salesrank
Alphabetical (A-Z) +titlerank
Alphabetical (Z-A) -titlerank
Manufacturer (A-Z) +manufactrank
Manufacturer (Z-A) -manufactrank
Price (Low to High) +price
Price (High to Low) -price


Sorting Software Results
(US: mode=software) (UK: mode=sw-vg-uk)
Sort Type sort Parameter
Featured items +pmrank
Bestselling +salesrank
Alphabetical +titlerank
Price (High to Low) +price
Price (Low to High) -price


Sorting Tools Results
(US: mode=tools)
Sort Type sort Parameter
Featured Items +psrank
Bestselling +salesrank
Alphabetical (A-Z) +titlerank
Alphabetical (Z-A) -titlerank
Manufacturer (A-Z) +manufactrank
Manufacturer (Z-A) -manufactrank
Price (Low to High) +price
Price (High to Low) -price


Sorting Toys Results
(US: mode=toys) (UK: mode=toys-uk)
Sort Type sort Parameter
Featured Items +pmrank
Bestselling +salesrank
Price (Low to High) +pricerank
Price (High to Low) +inverse-pricerank
Alphabetical (A-Z) +titlerank


Sorting Video Results
(US: mode=vhs) (UK: mode=vhs-uk)
Sort Type sort Parameter
Featured Items +psrank
Bestselling +salesrank
Alphabetical +titlerank


Sorting Video Games Results
(US: mode=videogames) (UK: mode=video-games-uk)
Sort Type sort Parameter
Featured Items +pmrank
Bestselling +salesrank
Alphabetical +titlerank
Price (Low to High) +price
Price (High to Low) -price



Output-Related Parameters

Parameter Default Description (default shown in red)
format (empty)

Optional parameter that specifies the name of the formatting file to be used. See: Format Templates. This parameter can contain Clock Codes.

grid (empty)

Optional parameter that specifies format used to reformat results into a grid. Each product in the grid shows a product name (linked), a subtitle of more information (if available), and a product thumbnail image (if available; otherwise "[no image]" is shown).

The format of this parameter is one or more options separated by commas, that is, "grid=OPTION1,OPTION2,OPTION3,...". The order of the OPTION's does not matter.

This parameter can also be set based on the value of a user defined configuration variable. If "grid=xNAME", then the script uses the value of the configuration variable "xgridNAME" (NAME is optional, in which case, variable "xgrid" is used). This is similar to the concept of styles in a word processor program. By changing the value of the configuration variable xgridNAME, all your grids that use the xNAME style thus change without you having to change all your HTML files. This is particularly useful if you have a lot of grids in your website that use the same format and you want to change them all at once.

The possible OPTION's are:

Option Meaning
at Align the top of images with the top of text. Not applicable if grid u (underneath) option is selected.
b Make the title of each item bold, e.g.: "Britney Spears Biography". Default is plain text.
br Add <BR> tag before the grid. Useful with the "e" option (see below) and when you have several <SCRIPT> tags one after the other and when you want them to have a blank line between them.
c:NUMBER Set # of columns to NUMBER. Possible values are 1 through 4. Default value is 1.
e If there are no products to show, then shows absolutely nothing ({results}=""). ("e" is short for "empty"). This is useful if you have several <SCRIPT> tags one after the other and want empty results to "collapse". See "br" option above.
if Reorganize the contents of the grid so that products with images go first ("if" means "images first").
ifa Similar to if ("images first") option except that all the products up to the pageSize are checked for images rather than just the first N products (where N=# of columns multiplied by # of rows in grid). ("ifa" means "images first all").
h:BCOLOR:TCOLOR:TEXT Add a header row with specified background color (BCOLOR), and use specified color (TCOLOR) for the text (TEXT). Default is "gray:black:{mode}". BCOLOR and TCOLOR can be standard color names (red, green, blue, gray) or in RGB hexadecimal format (000000 through FFFFFF. Do not prefix with #). If BCOLOR, TCOLOR, or TEXT are empty then the default value is used -- trailing :'s can be left out. Thus "h:yellow" simply changes the background color and leaves TCOLOR and TEXT as default. And, "h::red:Harry%20Potter" changes the text color to red and uses "Harry Potter" as the text (use %20 for a space).
m Include a "Click here for more..." link if there are more items than displayed.
m:TEXT Include a "Click here for TEXT..." link if there are more items than displayed. If TEXT starts with a symbol (e.g.: "!"), then the link will just be "TEXT" (excluding the initial symbol). Note: TEXT cannot include a comma (",") or an ampersand ("&").
n Number each item, e.g.: "1. Harry Potter". Default is no numbering.
p Show prices. The color of the prices is green (RGB color #339900). Note: The showPrices configuration variable must be set to yes otherwise prices will not be shown regardless of the grid p option.
p:COLOR Show prices. COLOR can be a standard color name (red, green, blue, gray) or in RGB hexadecimal format (000000 through FFFFFF. Do not prefix with #). Thus "p" causes prices to be shown with the default color while "p:red" causes prices to be shown in red. Note: The showPrices configuration variable must be set to yes otherwise prices will not be shown regardless of the grid p option.
r:NUMBER Set # of rows to NUMBER. Possible values are 1 through 25. Default value is 10.
u Causes the product description in the grid to be displayed underneath a larger product image. If this option is not specified, then a small thumbnail image is shown at the left and the product description is shown at the right.
v Use vertical fill, that is, fill the first column from top-to-bottom then fill the next column and so on. Default is horizontal fill, that is, fill the first row from left-to-right then fill the next row and so on.
xNAME The value of the configuration variable "xgridNAME" is used wherever option "xNAME" appears. This feature is similar in concept to styles in word processing programs. For example, set a configuration variable "xgrid1=c:2,r:4" (i.e.: 2-column x 4-row grid) then in your script URL's use "grid=x1". If you subsequently change the value of configuration variable xgrid1, the change would show up everywhere where you used "grid=x1" in the URL. You can use xNAME anywhere in the "grid=" value and you can use more than one xNAME, e.g.: "grid=xSize,xHeader,p" (this example uses configuration variables xgridSize and xgridHeader). You can use xNAME in the grid configuration parameter.

Some examples are:

  • grid=c:1,r:4
    1-column by 4-row grid. Example.

  • grid=c:2,r:3
    2-column by 3-row grid, filled horizontally. Example.

  • grid=c:2,r:3,v
    2-column by 3-row grid, filled vertically. Example.

  • grid=c:2,r:3,v,n,b
    2-column by 3-row grid, filled vertically, with numbered and bold titles. Example.

  • grid=1
    grid with default size (1-column by 10-row grid). Example.

Empty rows and empty columns are automatically removed. If vertical fill is selected and there are not enough items to fill the grid, the number of rows is automatically reduced so more columns are filled.

Note: Blended search does not support the grid parameter.

list 0 (zero)

If this script parameter is specified, then the results are shown in list format (non-grid) even if the grid configuration parameter is set or if the grid script parameter is specified. You would use this list script parameter in the situation where you have the grid configuration parameter set (since you want most results to default to a grid mode) and you want certain pages to be shown in list format. The list script parameter lets you override the grid configuration parameter and the grid script parameter. E.g.: Harry Potter books (as grid), Harry Potter books (as list) -- note the difference between these two URL's.

Note: If you include "list" in the URL, then the value 1 is implied so you can simply say: /cgi-bin/ae.pl?list&...

nocredit 0 (zero)

If specified then the "Powered by..." credit line is not included in the results.

Note: If you include "nocredit" in the URL, then the value 1 is implied so you can simply say: /cgi-bin/ae.pl?nocredit&...

Note: Set the credit configuration variable to no to turn off the credit line so you don't have to specify the nocredit parameter in all your links.

pagesize pagesize configuration variable

Optional parameter that specifies the number of results to show per page. If not specified, then the default is based on the pagesize configuration variable (which is typically 10).

template (empty)

Optional parameter that specifies the name of the Page Template file to be used. The name can be one or more letters/numbers (e.g.: mybooks, topvideos, music2). Note: Maximum length of name is 32 letters/numbers, and uppercase letters are converted to lowercase. See the "Page Templates" section for details. This parameter can contain Clock Codes.

title (empty)

The page title can be specified via the title script parameter, for example: /cgi-bin/ae.pl?type=browse&mode=dvd&title=My+Favorite+DVD's   If title is not specified, Associate Engine picks a reasonable value for the title. The title appears in the template where you have {title} or where it is indirectly specified such as {cfg.store.pagetitle.text} typically used in <TITLE></TITLE> (see store.pagetitle.text configuration variable).

xNAME (empty)

User defined Page Template variable xNAME. The NAME is one or more letters/numbers, such as "xtitle". Uppercase/lowercase in the name does not matter. For example, if the script is called with "xtitle=My+Favorites" (+ use for spaces), then the variable <!--xtitle--> will be replaced by the text My Favorites. If the Page Template contains a variable that was not specified when calling the script and was not defined in the configuration file, then the value "(undefined variable: NAME)" is used. When the script substitutes in the value of a user-defined substitution variable, the value is automatically HTML encoded ("<" becomes "&lt;", ">" becomes "&gt;", quotation mark becomes "&quot;", " &" becomes "&amp;").




Run-Related Parameters

You can run the script in various ways. If you run it using a Server-Side-Include (SSI) statement, a PHP virtual() function call, a PHP file_get_contents() function call, or using a <SCRIPT> tag, or using an <IFRAME> tag, then one of the following parameters must be specified.

See Quick Tutorial for a tutorial on using <SCRIPT> tags and SSI statement.

Parameter Default Description (default shown in red)
script 0 (zero)
  • 0 = don't format for <SCRIPT>
  • 1 = format for <SCRIPT>

Optional parameter that specifies that output is to be formatted for inclusion in an HTML page using a <SCRIPT> tag. This parameter causes the template script parameter to be ignored and the output is just "{results}". For better looking results, try also using the grid script parameter. See <SCRIPT> in the Sample HTML section for an example.

Note: If you include "script" in the URL, then the value 1 is implied so you can simply say: /cgi-bin/ae.pl?script&...

iframe 0 (zero)
  • 0 = don't format for <IFRAME>
  • 1 = format for <IFRAME>

Optional parameter that specifies that output is to be formatted for inclusion in an HTML page using an <IFRAME> tag. This parameter causes the template script parameter to be ignored and the output is just "{results}". For better looking results, try also using the grid script parameter. See <IFRAME> in the Sample HTML section for an example.

Note: If you include "iframe" in the URL, then the value 1 is implied so you can simply say: /cgi-bin/ae.pl?iframe&...

ssi 0 (zero)

Optional parameter that specifies that output is to be formatted for inclusion in an HTML page using a Server-Side-Include (SSI) statement, such as:

<!--#include virtual="/cgi-bin/ae.pl?ssi&type=best&mode=books"-->

Also, use this parameter for inclusion in a PHP page using a virtual() function call or a file_get_contents() function call, such as:

virtual("/cgi-bin/ae.pl?ssi&type=best&mode=books");

print file_get_contents("http://www.mydomain.com/cgi-bin/ae.pl?ssi&type=best&mode=books");

Note: The PHP virtual() function uses a partial URL without a domain name, whereas the PHP file_get_contents() function uses a full URL with a domain name.




Miscellaneous Parameters

Parameter Default Description (default shown in red)
log 0 (zero)
0 = do not log ae.pl calls
1 = log ae.pl calls

If set to 1, causes the current search request to be logged in the ae-log.txt file (located in the same directory where ae.pl is located). Logging stops if log file reaches 1MB in size; delete the file to continue logging.

Tip: To log only keyword search forms, add a hidden variable to your form instead: <input type=hidden name="log" value="1">

Note: To log all search request (not just the current one) then set the log configuration variable instead.

Note: If you include "log" in the URL, then the value 1 is implied so you can simply say: /cgi-bin/ae.pl?log&...

See the log.* configuration variables for further details.

noredirect 0 (zero)
0 = if the script can't handle the request, allow the script to redirect the user to an appropriate page at the amazon.com website. The redirection does contain your amazon.com associate ID. See FAQ.
1 = if the script can't handle the request, do not allow the script to redirect the user to the amazon.com website. Instead, show a "Click here to continue" link that links to an appropriate page at the amazon.com website. You can use the noredirect to confirm to yourself that the redirection/link does contain your amazon.com associate ID. See FAQ.

Note: If you include "noredirect" in the URL, then the value 1 is implied so you can simply say: /cgi-bin/ae.pl?noredirect&...

Note: The noredirect parameter no effect when the script, iframe, or ssi parameters are used since redirection is then not possible.

virtual
virtual.dir
(empty)

For internal use only to specify a Virtual Directory as script parameters. virtual.dir contains the initial part of the path, and virtual contains the remainder of the path. For example, for www.domain.com/amazon/type_best/mode_books then virtual.dir=amazon and virtual=type_best/mode_books

virtual.noredir (empty)

When the virtual.redir configuration variable is yes, Associate Engine automatically redirects a non-virtual URLto the equivalent virtual URL. For example, /cgi-bin/ae.pl?type=best&mode=musicautomatically redirects to /amazon/mode_music/type_best.html

This feature can be turned off on a case-by-case basis by adding the parameter virtual.noredir to the URL, e.g.: /cgi-bin/ae.pl?type=best&mode=music&virtual.noredir




ASIN List Searches

Random Selection

Note: See Bug section below regarding a limitation.

Searching for random ASIN's based on a file of ASIN's is supported. Create a text file containing the ASIN's and save it in the ae-asin directory as mylist.txt (you can use any filename, such as cookbooks.txt).

There is no limit to the number of ASIN's that you can put in an ASIN list file.

On our webserver, we created a file ae-asin/mylist.txt that contains the following lines: (they are the ASIN's of 6 books about the artist Salvator Dali)

0486274543
0486282864
0821224808
3822812099
3822827401
3822872059

Then do a search:

  1. asinsearch=mylist
    Searches for one random ASIN from mylist.txt file.

  2. asinsearch=mylist:3
    Searches for 3 random ASIN's from mylist.txt file, preserving order of ASIN's. Use any number after the colon to specify how many ASIN's to use. To show all the ASIN's, use a large number (maximum is 30).

  3. asinsearch=mylist:-3
    Searches for 3 random ASIN's from mylist.txt file, scrambling the ASIN's so the order is not preserved. Use any number after the colon to specify how many ASIN's to use. To show all the ASIN's, use a large number (maximum is 30).


Pre-Defined Searches

You could also use search.* configuration variables to pre-define searches. For example, you could define the following configuration variable:

search.artbooks "asinsearch=mylist:3&grid=c:3"

The above line defines a search called artbooks as being equivalent to the search asinsearch=mylist:3 and formatted as a 3-column grid. As indicated above, this would do a search of 3 random ASIN's from the mylist ASIN file. You could then use this pre-defined search via:

/cgi-bin/ae.pl?search=artbooks

With the above definition of search.artbooks, this URL is equivalent to:

/cgi-bin/ae.pl?asinsearch=mylist:3&grid=c:3

"No results found" Error

If any of the ASIN's in a multi-ASIN request do not exist, then Amazon.com's AWS server reports an error response back to Associate Engine. In that case, AWS does not returned data for any of the ASIN's that do exist. Associate Engine therefore reports "No results found" message. Manually test each of the ASIN's until you determine which one is causing the error, e.g.: to test ASIN 1234567890, use something like: /cgi-bin/ae.pl?asinsearch=1234567890


Timed Selection

The asinsearch parameter supports Clock Codes. Thus you could have ASIN lists week01.txt, week02.txt, ... week52.txt for each week of the year and use asinsearch=week%W:3 to display 3 random ASIN's from the current week's file.


Bug

Currently, at most 9 ASIN's can be selected otherwise the first 10 results will be repeated. So select at most 9 results, such as: /cgi-bin/ae.pl?asinsearch=mylist:9

For more than 9 products, use a different type of search, such as a keyword search or a browse node # search.




PowerSearch (Advanced Search of Books)

The PowerSearch (power search) parameter allows searching books against a variety of specific product fields such as publisher name and format (see table below for fields). Power Search is basically equivalent to amazon.com's "Power Search" search feature.

The format is:

powersearch=QUERY

If necessary, you can also break the fields of the QUERY into separate parameters: (see "Seperate Parameters" section below)

powersearch.OPTION1=VALUE1&powersearch.OPTION2=VALUE2&...

Note: If there are any spaces in the QUERY, then type them as either + or as %20 (the ASCII value of a space character).

Field Query VALUE
Title title: VALUE
title-words-begin: VALUE
title-begins: VALUE
any text
Subject subject: VALUE
subject-words-begin: VALUE
subject-begins: VALUE
any text
Author author: VALUE
author-exact: VALUE
author-begins: VALUE
any text
Keyword keywords: VALUE
keywords-begin: VALUE
any text
ISBN asin: VALUE an ISBN number
Publisher publisher: VALUE any text
Language language: VALUE spanish
Publication Date pubdate: VALUE before YEAR
during YEAR
after YEAR
(e.g.: during 2003)
Format binding: VALUE hardcover
paperback
digital
abridged
large print
calendar

(*for audiobooks, see note below)
Browse node browse: VALUE any amazon.com browse node number

*Note: To search for audiobooks, use "browse:44" (audiobooks is amazon.com browse node 44). For example, "harry potter" audiobooks would be: powersearch=title:harry+potter+and+browse:44

You can use the words and, or, and not to link different queries together. You can also group queries or values together using parentheses ( and ).

Some sample queries:


Separate Parameters

If necessary, you can break the fields of the QUERY into separate parameters:

powersearch.FIELD1=VALUE1&powersearch.FIELD2=VALUE2&...

Associate Engine will "glue" the separate parameters together to internally make one PowerSearch parameter. When Associate Engine glues the parameters together, a boolean AND is put between each parameter and parentheses are added around each field/value. The internal processing is effectively:

(FIELD1: VALUE1) and (FIELD2: VALUE2) and ...

Using separate parameters is useful in a situation where you want the user to select one or more field values (e.g.: keyword) and you want other field values to be set by you the webmaster. For example, the following is a form that would search for audiobooks (browse node 44) from the author that the user types in.

<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
   <INPUT TYPE="HIDDEN" NAME="powersearch.browse" VALUE="44">
   Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
   <INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>


Author: (try: dyer)

You can mix a powersearch parameter with powersearch.* parameters. They will all be glued together. For example, the above example could also be written as:

<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
   <INPUT TYPE="HIDDEN" NAME="powersearch" VALUE="browse:44">
   Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
   <INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>


Author: (try: dyer)

If necessary, you can use an expression as a parameter value. For example, the following searches for books about Spanish or Mexican history from the author that the user specifies:

<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
   <INPUT TYPE="HIDDEN" NAME="powersearch"
      VALUE="subject: history and (spain or mexico)">
   Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
   <INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>


Author: (try: parker)

When the user submits the above form, the PowerSearch query gets processed internally as:

(subject: history and (spain or mexico)) and (author: VALUE)

As with any form, you can use a drop-down menu to let the user pick from a list of pre-defined values. For example, the following form is similar to the above form yet the user is given the choice of whether to search for books about Spanish history, or Mexican history, or both (Spanish or Mexican history).

<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
   Subject:
   <SELECT NAME="powersearch.subject" SIZE="1">
      <OPTION VALUE="history and spain">Spanish History</OPTION>
      <OPTION VALUE="history and mexico">Mexican History</OPTION>
      <OPTION VALUE="history and (spain or mexico)">both</OPTION>
   </SELECT>
   <BR>
   Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
   <INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>


Subject:
Author: (try: parker)




< Previous Table of Contents Next >




E.&O.E.; © Cusimano.Com Corporation; www.c3scripts.com