Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python wrapper to access the amazon selling partner API

License

NotificationsYou must be signed in to change notification settings

saleweaver/python-amazon-sp-api

Repository files navigation

DownloadsDownloadsDownloads

PYTHON-AMAZON-SP-API

Amazon Selling-Partner API

A wrapper to accessAmazon's Selling Partner API with an easy-to-use interface.


🚀 Version 2 🚀

Version 2 is currently being built - featuring pydantic, async support and better versioning.Check out v2-alpha here:v2-alpha


🌟 Thank you for using python-amazon-sp-api! 🌟

This tool helps developers and businesses connect seamlessly with Amazon's vast marketplace, enabling powerful automations and data management.

If you appreciate this project and find it useful, please consider supporting its continued development:

  • 🙌GitHub Sponsors
  • 🌐 BTC Address:bc1q6uqgczasmnvnc5upumarugw2mksnwneg0f65ws
  • 🌐 ETH Address:0xf59534F7a7F5410DBCD0c779Ac3bB6503bd32Ae5

Your support helps keep the project alive and evolving, and is greatly appreciated!


Documentation

Documentation is availablehere

Documentation Status

Q & A

If you have questions, please ask them in GitHub discussions

discussions

or

join on slack

Installation

Badge

pip install python-amazon-sp-apipip install "python-amazon-sp-api[aws]" # if you want to use AWS Secret Manager Authentication.pip install "python-amazon-sp-api[aws-caching]" # if you want to use the Cached Secrets from AWS

Usage

fromsp_api.apiimportOrdersfromsp_api.apiimportReportsfromsp_api.apiimportDataKioskfromsp_api.apiimportFeedsfromsp_api.baseimportSellingApiExceptionfromsp_api.base.reportTypesimportReportTypefromdatetimeimportdatetime,timedelta# DATA KIOSK APIclient=DataKiosk()res=client.create_query(query="{analytics_salesAndTraffic_2023_11_15{salesAndTrafficByAsin(startDate:\"2022-09-01\" endDate:\"2022-09-30\" aggregateBy:SKU marketplaceIds:[\"ATVPDKIKX0DER\"]){childAsin endDate marketplaceId parentAsin sales{orderedProductSales{amount currencyCode}totalOrderItems totalOrderItemsB2B}sku startDate traffic{browserPageViews browserPageViewsB2B browserPageViewsPercentage browserPageViewsPercentageB2B browserSessionPercentage unitSessionPercentageB2B unitSessionPercentage}}}}")print(res)# orders APItry:res=Orders().get_orders(CreatedAfter=(datetime.utcnow()-timedelta(days=7)).isoformat())print(res.payload)# json dataexceptSellingApiExceptionasex:print(ex)# report requestcreate_report_response=Reports().create_report(reportType=ReportType.GET_MERCHANT_LISTINGS_ALL_DATA)# submit feed# feeds can be submitted like explained in Amazon's docs, or simply by calling submit_feedFeeds().submit_feed(<feed_type>,<file_or_bytes_io>,content_type='text/tsv',**kwargs)# PII DataOrders(restricted_data_token='<token>').get_orders(CreatedAfter=(datetime.utcnow()-timedelta(days=7)).isoformat())# or use the shortcutorders=Orders().get_orders(LastUpdatedAfter=(datetime.utcnow()-timedelta(days=1)).isoformat())

New endpoints

You can create a new endpoint file by runningmake_endpoint <model_json_url>

make_endpoint https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/listings-restrictions-api-model/listingsRestrictions_2021-08-01.json

This creates a ready to use client. Please consider creating a pull request with the new code.

ADVERTISING API

You can use nearly the same client for the Amazon Advertising API.@denisneuf has builtPython-Amazon-Advertising-API on top of this client.Check it outhere

DISCLAIMER

We are not affiliated with Amazon

LICENSE

License


Base Client

The client is pretty extensible and can be used for any other API. Check it out here:

API Client

Alt

About

Python wrapper to access the amazon selling partner API

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors72


[8]ページ先頭

©2009-2025 Movatter.jp