Professional Documents
Culture Documents
Datafeeds S3 Download Guide
Datafeeds S3 Download Guide
Datafeeds S3 Download Guide
Workflow Overview
The workflow for downloading a Data Feed is:
1. List the Data Feeds that you are permitted to download.
After you register for Data Feeds, the Associates team specifies the Data Feeds you can download.
Listing the Data Feeds you can download is typically a one time event. For more information, go to
Listing Data Feeds.
2. Download the selected Data Feeds in some automated fashion, for example, using crontab to run a
script..
While you can manually download Data Feeds, the more practical solution is to create a script in the
computer language of your choosing and to use an automated scheduler to run the script, such as
crontab. The script should look for Data Feed updates multiple times a day. The information in this
document describes the commands you use to download Data Feeds
3. Optionally, include in the script a report to Amazon Associates that the Data Feed download
succeeded or didn't.
Whether you are listing or downloading Data Feeds, you must include in your request your login name
and password. These values are assigned to you by the Amazon Associates when you sign up to become
a Data Feeds customer. To sign up to receive Data Feeds, contact Customer Support, as listed on the
Associates web site.
Note
1
The new delivery mechanism will not work with login names and passwords that are
linked to older FTP accounts. People with older FTP accounts will be sent new login
names and passwords.
In the real request, substitute your user name and password with a colon in between, as shown within the
brackets. These values are provided by Amazon when you sign up for Data Feeds. These values identify
you and the Data Feeds you are permitted to download.
Note
For UNIX, use Curl version 7.18 or later, For Microsoft Windows, use Curl version 7.18.1
or later.
Here is a sample response.
us_ecs_ce.xml.gz
Thu Feb 21 18:37:00 PST 2008
"ac87f4105c47d5bfecdc7d0c315bf0d8"
764372624
us_ece_software.xml.gz
Thu Apr 17 19:32:43 PDT 2008
"2349e52cfd8beb98fa4d56096e6ddfd4"
2518414
us_ecs_books.xml.gz Fri Apr 18 01:03:11 PDT 2008
"50a9bd8e23b5d45b5704e73ef948fed6"
187255128
This response shows that the user is able to download three Data Feeds. The response format is:
DataFeed_filename Date_generated "MD5_ID" File_size_in_bytes
Note
MD5 is an encrypted value used to determine the integrity of a transferred file. The 128-bit
hash value is calculated, in part, by everything in the file. In this way, the receiver can use
everything in the file to calculate the MD5 value independently. Comparing it's result with
the MD5 value in the response, you can determined if the file is partial, complete, or
corrupt.
Locales
The URL in the request varies slightly by locale, as shown in the following table
Locale
URL
Locale
URL
Europe (eu)
Japan (fe)
The listFeeds command returns one or more files the Associate can download, for example:
us_ecs_ce.xml.gz
As you can tell from the abbreviations, the content of this Data Feed file is in XML and the file is
gzipped.
Data Formats
In listFeeds requests, the final parameter, format, specifies the format of the downloaded content.
The default is text/html. So, if you do not include the format parameter, the content of the files will be
text/html. Other choices include:
textTypically used as a human readable form as opposed to the XML.
text/xml
The complete list of possible requests to list Data Feeds is:
curl --user [username:password] --digest -k
https://assoc-datafeeds-na.amazon.com/
datafeed/listFeeds
curl --user [username:password] --digest -k
https://assoc-datafeeds-na.amazon.com/
datafeed/listFeeds?format=text/html
curl --user [username:password] --digest -k
https://assoc-datafeeds-na.amazon.com/
datafeed/listFeeds?format=text/xml
curl --user [username:password] --digest -k
https://assoc-datafeeds-na.amazon.com/
datafeed/listFeeds?format=text
Now that you have the complete list of all Data Feeds that you are allowed to download, you can select
the ones you want.
Substitute for username:password the Data Feed user name and password. This script uses the "C "
option of curl to continue the download in case it was interrupted on a previous attempt. The URL in the
request varies slightly by locale, as described by the table in the previous section.
The filename parameter is set equal to the Data Feed that you want to download. We recommend that
you retry the download three to five times if the exit status of the curl commands shows an error. In this
request, the results of the command are stored in the file, us_ecs_baby.xml.gz.
--pass myPassword
All of these arguments are required and described in the following table.
Argument
Description
dir <dir>
input <filename>
md5-file <filename>
pass <pass>
region <region>
user <user>
Sample Response
The following is a sample response after the getFeed command completes.
us_ecs_ce.xml.gz
%Total %Received %Xferd Average Speed Time Time TimeCurrent
100
2459k
100
2459k
0
0
453k 0
Dload
0:00:05
Upload
0:00:05
Total
--:
Spent
--:
Left
--
Speed
767k
This result shows that 100% of 2459k bytes were sent, 100% of the 2459k bytes were received, the
average transfer rate was 453k per second and that the download took 5 seconds.
Although including this command in your script is optional, it helps Amazon Associates determine the
health of the service.
Here is a sample response returned upon the report of a success.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><TITLE>Report Status Completed</TITLE></HEAD>
<BODY> status updated </BODY>
</HTML>