Get the Result of a Catalog Upload
Buy with Prime API is now available for early access
Sign up for early access to the Buy with Prime API using the 'Sign Up' button below. The API may change as Amazon receives feedback and iterates on it.
After you upload your catalog and start feed processing, you can retrieve the feed file processing results in the following two ways:
- By downloading a CSV result file: You most often use this method when you manually load product data into the catalog from an alternate source. To use this method, you get a catalog result file link and then download the result file from that link. In this case, you perform the steps in the following order:
- By getting a list of specific signals: You most often use this method when a system is loading product data into the catalog from an alternate system. If this is your use case, follow the instructions for Get catalog feed signals.
This topic shows both methods.
For an overview of catalog terminology, see Create and Manage Catalogs. To learn how to call the Buy with Prime API, see Call the Buy with Prime API.
Sample data
The examples in this topic use the following sample data.
Sample catalog data
let inSearchOfLostTime = {
title: "In Search of Lost Time",
isbn: "12345",
isPrimeIntended: true,
sku: "12345",
mSku: "12345",
imageUrl: "https://example.com/image-12345.jpg",
detailPageUrl: "https://www.amazon.com/dp/12345"
};
let prideAndPrejudice = {
title: "Pride and Prejudice",
isbn: "678910",
isPrimeIntended: true,
sku: "678910",
mSku: "678910",
imageUrl: "https://example.com/image-678910.jpg",
detailPageUrl: "https://www.amazon.com/dp/678910"
};
Get the file ID of a catalog feed result
Before you can get a link to download the catalog feed result, you must perform a catalogFeed
query to get the associated file ID. In the query, use the id
from the CreateCatalogFeedResponse
you received when you started feed processing.
The response contains a fileId
that you use to get a link to the catalog feed result.
The following example shows how to get the fileId
of a catalog feed result.
Request
// GraphQL query to get the catalog feed result
query CatalogFeed($catalogFeedId: ID) {
catalogFeed(catalogFeedId: $catalogFeedId) {
result {
resultReport {
fileId
}
}
}
}
}
// Query variables
{
catalogFeedId: createCatalogFeedResponseJson.data.createCatalogFeed.id
}
Response
{
"data": {
"catalogFeed": {
"id": "example-catalog-feed-id",
"status": "COMPLETED",
"result": {
"resultReport": {
"fileId": "example-file-id"
}
}
}
}
}
Get a link to a catalog feed result
To get a link to a catalog feed result, perform a downloadLink
query with the fileId
that you received when you performed a catalogFeed
query in the previous step.
Request
// GraphQL query to get a download link
query DownloadLink($fileId: String!) {
downloadLink(fileId: $fileId) {
downloadUrl
}
}
}
// Query variables
{
fileId: catalogFeedReportResponseJson.data.result.resultReport.fileId
}
Response
{
"data": {
"downloadLink": {
"downloadUrl": "https://example.com/download-url"
}
}
}
Download a catalog feed result file
After you get a link to the catalog feed result, you can download the CSV file by using a standard interface in your chosen programming language. For a description of the fields in the catalog feed result file, see Catalog feed processing result file.
The following example shows how to use the download link to create a stream of the catalog feed result file.
Request
// Using the download link, create a stream of the catalog feed report file
const stream = fs.createWriteStream('./book_library_processing_signals.csv');
const { body } = await fetch(catalogFeedReportDownloadLinkResponseJson.data.downloadUrl);
await finished(Readable.fromWeb(body).pipe(stream));
Get catalog feed signals
You can get a list of global signals that pertain to a catalog feed. If you choose to do so, you should still download a catalog feed result file.
The following example shows how to get a list of signals related to a catalog feed. For a description of the fields, see Signal
.
Request
// GraphQL query
query catalogFeed($catalogFeedId: String!) {
catalogFeed(catalogFeedId: $catalogFeedId) {
id
status
result {
issues {
id
status
localizedMessage {
language
content
}
}
}
}
}
// Query variables
{
catalogFeedId: createCatalogFeedResponseJson.data.id
}
Response
{
"data": {
"catalogFeed": {
"id": "example-id",
"status": "COMPLETED",
"result": {
"issues": []
}
}
}
}
Related topics
Updated 3 days ago