A simple implementation of API. Deer.io doesn't provide any API for developers, so that flask-server solves that problem.
It parse HTML-page and returns JSON object.
✅ Tested on Python 3.6.5
q: [string] the query string
outofstock: [bool] if true returns "out of stock" items too.
Create virtual environment.
virtualenv venvActivate it. If you're on Linux type:
source venv/bin/activateIf Windows:
venv\scripts\activate
Then install requirements.
pip install -r requirements.txtAnd... Run the server 🙂
python app.pyOpen your browser at http://localhost:8080/, and provide a query: https://localhost:8080/?q=twitter.
The output should look like:
{
"shops": [
{
"id": 0,
"title": "shop title",
"link": "http://site.url/",
"since": 1507161600,
"description": "shop's description"
}
],
"items": [
{
"shop_id": 0,
"title": "product's title",
"count": 1234,
"price": 11.0
}
]
}Have a nice day and thanks for spending time checking my repository.