Implementing the Amazon PA-API using Flask as a webserver and Redis for caching offers.
Report Bug
.
Request Feature
PAAPI Amazon Webserver is a webserver that simplifies operations through api pa.
It allows the caching of offers of the requested categories, for a configurable time, saved in a Redis database. It is possible to use this server as a backend for applications or web pages where offers are displayed.
PAAPI Amazon Server has the automatisms you are looking for for offers and limit the consumption of API requests.
The server use Redis for the cache and Flask as the web server. Use a wrapper for pa api.
It is recommended to use a virtualenv. A Docker is provided that allows the use of Redis, if you want you can use your own Redis database.
- Get AP Amazon credentials.
- Clone the repo
git clone https://github.com/EliaTolin/paapi_amazon_webserver/
- Install dependencies
pip install -r requirements.txt
- Enter your API Credentials in
config.py
AMAZON_ACCESS_KEY = 'YOUR_ACCESS_KEY'
AMAZON_SECRET_KEY = 'YOUR_SECRET_KEY'
AMAZON_PARTNER_ID = 'YOUR_PARTNER_ID'
AMAZON_COUNTRY = 'YOUR_COUNTRY_ID'
- Start webserver.
python main.py
Be sure you have a redis instance.
Otherwise use the Docker-compose for development but before configure the config.py file.
docker-compose up -d
The webserver provides two endpoints, others will be in development if requested.
-
/api/v1/pa_amazon/search_product
Use this to have products returned to you based on the parameters provided.
-
/api/v1/pa_amazon/get_category_offers
Use this to make you return the products on offer or not regarding a certain category, it saves it in the DB with a timeout, if it is requested again it provides the results saved in the cache without re-downloading them. It has systems to handle the TooManyRequest error.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GPL-3.0 License. See LICENSE for more information.
- Elia Tolin - Founder of Aurora Digital - Elia Tolin -