Feeds
- class sp_api.api.Feeds(marketplace: sp_api.base.marketplaces.Marketplaces = Marketplaces.US, *, refresh_token=None, account='default', credentials=None, restricted_data_token=None)
The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner.
- create_feed(self, feed_type: str, input_feed_document_id: str, **kwargs) ApiResponse
Creates a feed. Call create_feed_document to upload the feed first. submit_feed combines both.
Usage Plan:
Rate (requests per second)
Burst
0.0083
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Feeds().create_feed('POST_PRODUCT_DATA', '3d4e42b5-1d6e-44e8-a89c-2abfca0625bb', marketplaceIds=["ATVPDKIKX0DER", "A1F83G8C2ARO7P"])
- Parameters
feed_type – https://github.com/amzn/selling-partner-api-docs/blob/main/references/feeds-api/feedtype-values.md
input_feed_document_id – str
**kwargs –
- Returns
- Return type
CreateFeedResponse
- create_feed_document(self, file: File or FileLike, content_type='text/tsv', **kwargs) ApiResponse
Creates a feed document for the feed type that you specify. This method also encrypts and uploads the file you specify.
Usage Plan:
Rate (requests per second)
Burst
0.0083
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
- Parameters
file – File or File like object
content_type – str
**kwargs –
- Returns
- Return type
CreateFeedDocumentResponse
- submit_feed(self, feed_type: str, file: File or File like, content_type='text/tsv', **kwargs) [ApiResponse, ApiResponse]
Combines create_feed_document and create_feed, uploads the encrypted file and sends the feed to amazon.
Usage Plan:
Rate (requests per second)
Burst
0.0083
15
- Parameters
feed_type –
file –
content_type –
**kwargs –
- Returns
- Return type
[CreateFeedDocumentResponse, CreateFeedResponse]
- get_feed(self, feed_id: str, **kwargs) ApiResponse
Returns feed details (including the resultDocumentId, if available) for the feed that you specify.
Usage Plan:
Rate (requests per second)
Burst
2
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Feeds().get_feed(feed_id)
- Parameters
feed_id – str
**kwargs –
- Returns
- Return type
GetFeedResponse
- get_feed_result_document(**kwargs)
Returns the decrypted, unpacked FeedResponse
Usage Plan:
Rate (requests per second)
Burst
0.0222
10
- Parameters
feed_id – str
**kwargs –
- Returns
The feed results’ contents
- Return type
str