Alexa Top Sites - Batch Requests
A batch request is similar to a regular query request, except that it allows multiple service calls, or sub-requests, to be sent in one request. Batch requests save on network latency time.
![]() |
Note |
---|---|
Batch requests save time, not money -- they are billed as though each sub-request was made separately. |
All parameters except the core Top Sites parameter (Action
) are batched according to the following rules:
-
If a query request contains at least one parameter of the format
[ActionName].[integer].[ParameterName]
, it is a batched request. (example:TopSites.1.CountryCode
). -
The numbers for the request params must be contiguous (i.e. if
TopSites.3.CountryCode
is present,TopSites.1.CountryCode
andTopSites.2.CountryCode
are required as well). -
To save on typing, batched requests are allowed to have shared parameters. These are the parameters that have the same value for all the batch sub-requests. Shared parameters have the form
[ActionName].Shared.[ParameterName]
(example:TopSites.Shared.ResponseGroup
). Short-hand form ofShared.[ParameterName]
is supported as well. -
Up to 5 service calls can be batched at a time in a single request. If more service calls are needed, they must be divided into multiple batch requests.
-
All service calls within a single batch request must be of the same
Action
type. You cannot mix different actions in a single batch request.
Sample Batch Request
https://ats.amazonaws.com/api? Action=TopSites &TopSites.Shared.ResponseGroup=[Country]
&TopSites.1.CountryCode=[query #1]
&TopSites.2.CountryCode=[query #2]
&TopSites.3.CountryCode=[query #3]