Query the Alexa search engine to search the web for documents that match a query. This action returns XML containing the search results.
| Name | Description | Required |
|---|---|---|
|
Action |
Set the | Yes |
|
Version | Pass in the current version number, 2007-03-15, to ensure that requests succeed even if the API changes in future versions. | Yes |
|
ResponseGroup |
A comma-separated list that selects what data is returned from a search.
| Yes |
Query | A set of search terms. See the Query Syntax chapter for more details. | Yes |
|
PageNumber |
The page of results to show. Default value is 1. Maximum 5000. Note that you can retrieve a maximum of 5000 results total (The PageNumber * MaxNumberOfDocumentsPerPage must be <= 5000). If you need more than 5000 results see the Million Search Results Chapter. | No |
|
MaxNumberOfDocumentsPerPage |
Number of results (maximum) per page to return. Note that the response may contain fewer results than this maximum. Default value is 10. Maximum is 200. | No |
MaxTime | Web Search will return as many results as possible within the specifed number of seconds. The default value is automatically adjusted based on the number of results and the complexity of the query. Maximum value is 180. | No |
|
Unique |
The Unique parameter allows you to choose how to filter duplicate pages from your search results. By default value only 2 results per site are returned. See Uniquing Results for more information. | No |
The following example shows a typical Query-style request and response
http://wsearch.amazonaws.com/?
Action=Search
&Version=2007-03-15
&AWSAccessKeyId=[Your AWS Access Key ID]
&Timestamp=[Current timestamp]
&Signature=[Calculated request signature]
&ResponseGroup=[Valid Response Group, such as Context]
&Query=[Search terms]
&PageNumber=[Page number to show]
<?xml version="1.0"?>
<SearchResponse xmlns:aws="http://wsearch.amazonaws.com/doc/2007-03-15/">
<SearchResult>
<SearchTerms>cars</SearchTerms>
<EstimatedNumberOfDocuments>73226634</EstimatedNumberOfDocuments>
<Document>
<Url>http://www.cars.com/go/index.jsp</Url>
<Title>Buy New & Used Cars, Research Prices, Sell My Car. </Title>
<Bytes>39126</Bytes>
<Checksum>AAAAAAAVNDM=</Checksum>
<Context>We sell lots of cars</Context>
</Document>
</SearchResult>
<ResponseMetadata>
<RequestId>2167c9cb-cf4c-4ebd-82e5-832a7754c0d8</RequestId>
</ResponseMetadata>
</SearchResponse>
The table below describes the main elements in the XML response:
| Element Name | Description |
|---|---|
SearchTerms | The terms from the Query string that are used to get context from the document |
EstimatedNumberOfDocuments | An estimate of the number of matching results |
MaxTimeReached | If this is true if means that the MaxTime has been reached and the search engine returned available results. |
Document | This element wraps the result fields that describe a matching document. |
Url | The URL of the document. You should be able to navigate a browser to this URL (As long as it is still available on the web) |
Title | The title of the document |
Bytes | The size of the document in bytes |
Checksum | A checksum of the document contents |
TrafficRank | The Alexa Traffic Rank of the website hosting the document Url |
QueryCorrection | Suggested alternate search query. Usually this is a spelling correction. |
QueryExpansion/Expansion | Related search query |