Welcome to the Amazon SP-API Course repository! This repository is part of the Amazon SP-API course available at courses.deltologic.com. It contains examples using the python-amazon-sp-api
library, which simplifies working with Amazon's SP-API in Python.
First, clone the repository and prepare your development environment.
Create a virtual environment:
python3 -m venv venv
Activate the environment:
source venv/bin/activate
Install the required packages:
pip install -r requirements.txt
Set the PYTHONPATH
environment variable:
export PYTHONPATH=$PYTHONPATH:/path/to/amazon-sp-api-course/project/directory
Note: Running the code from a specific directory (e.g.,
FeedsAPI
), add that directory to thePYTHONPATH
as well. Refer to theReadme.md
in that directory for details.
Create a .env
file in the root directory. Copy the contents of .env.example
and fill in your credentials:
lwa_app_id=''
lwa_client_secret=''
refresh_token=''
order_id=''
seller_id=''
# Needed for Notifications API:
AWS_SQS_NAME=''
AWS_EVENTBRIDGE_DESTINATION_NAME=''
AWS_SQS_ARN=''
ACCOUNT_ID=''
We have made an effort to demonstrate the handling of various endpoints on the basis of specific use cases. For example, we use the searchCatalogItems
operation to calculate the average weight of products that appear as search results for selected keywords.
In ReportsAPI, scripts can be run in either 'create report' or 'download report' mode - depending on whether you specify a report identifier or leave it empty. In addition, in the ReportsAPI, you can set the report options to suit your needs (in the ).
In FeedsAPI, there are also two modes of running the script available - either to create the feed or to retrieve the result of the feed creation (to check whether the feed was created successfully). The Feeds API itself offers many possibilities, but currently there are two types of feeds available in the repository:
POST_PRODUCT_PRICING_DATA
(to update product prices)POST_INVENTORY_AVAILABILITY_DATA
(to update product inventory)
To run the app, migrate the database and start the server:
./manage.py migrate
./manage.py runserver
Check out a preview of the course on YouTube:
We invite you to participate in this project! Let's work together to create the most useful tools for Amazon SP-API developers.
- Issues: Have questions or suggestions? Feel free to open an issue.
- Pull Requests: Found a bug or have improvements? Submit a pull request.
Together, we can make this project better every day! 😊
If you find this project helpful, please consider:
- Giving us a star on GitHub.
- Sharing the course with your peers.
- Following us on LinkedIn.