WIOpy - Walmart Affiliate API Python wrapper

Overview

WalmartIO Python Wrapper - WIOpy

A python wrapper for the Walmart io API. Only supports the Affiliate API for now. The project is open to contributions

Getting it

To download WIOpy, either fork this github repo or simply use Pypi via pip.

$ pip install WIOpy

To upgrade the package simply run

$ pip install WIOpy --upgrade

How to use

An example of creating a WIOpy connection

from wiopy import WalmartIO

wiopy = WalmartIO(private_key_version='1', private_key_filename='./WM_IO_private_key.pem', consumer_id='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
data = wiopy.product_lookup('33093101')[0]

Response Examples

When making a call to the API, an object will be returned. That object is an object version of returned JSON.
There are two ways to get info from the object:

  • data.name
  • data['name']
    An example of a returned object and one that is not (review/search are variables returned):
  • review.reviewStatistics.averageOverallRating # Nested call
  • search.facets # Gives back a dict that can now be used like a dict and not object
    Some attributes will return a dict and not an object due to a lack of documentation from Walmart.
    When getting an attribute from a WalmartResponse, it will return either response or None. But trying to get an attribute of None will still raise an error. Extra details on calls and responses. However, the docs are inconsistent and lack typical practices such as response schema. That is why something like the search facets response is missing because the docs show it is in the response but not what type of data it will contain.
    While there may be a response missing or a response not being converted to an object, please check WalmartResponse to get an idea of what a response will return. Some properties are not always present in a response.

Examples of calls

Catalog Product

Catalog Product API allows a developer to retrieve the products catalog in a paginated fashion. Catalog can be filtered by category, brand and/or any special offers like rollback, clearance etc.

data = wiopy.catalog_product()

A catalog response contains category, format, nextPage, totalPages, and a list of items

Post Browsed Products

The post browsed products API allows you to recommend products to someone based on their product viewing history.

data = wiopy.post_browsed_products('36904791')

Response gives top 10 relevent items to the given id

Product lookup

There are two ways to lookup a product
The first is to pass a single string in

data = wiopy.product_lookup('33093101')[0]

or you can pass a list of strings

data = wiopy.product_lookup('33093101, 54518466, 516833054')
data = wiopy.product_lookup(['33093101', '54518466', '516833054'])

Remember: product_lookup always returns a list of WalmartProducts

Product Recommendation

Get recommendations based on a given product id

data = wiopy.product_recommendation('36904791')

Response gives a list of related products

Reviews

The Reviews API gives you access to the extensive item reviews on Walmart that have been written by the users of Walmart.com

data = wiopy.reviews('33093101')

Response gives review data

Search

Search API allows text search on the Walmart.com catalogue and returns matching items available for sale online.

# Search for tv within electronics and sort by increasing price:
data = wiopy.search('tv', categoryId='3944', sort='price', order='ascending')

You can also add facets to your search

data = wiopy.search('tv', filter='brand:Samsung')

The search response gives back a list of products and some meta data. It returns a facets element but there is no detail on the API about what it could return. It is a list of some unknown type

Stores

The API can return a list of closest stores near a specified location. Either zip code or lon/lat

data = wiopy.stores(lat=29.735577, lon=-95.511747)

Taxonomy

The taxonomy service exposes the taxonomy used to categorize items on Walmart.com.
Details about params is missing from docs

data = wiopy.taxonomy()

Trending Items

The Trending Items API is designed to give the information on what is bestselling on Walmart.com right now.

data = wiopy.trending()
You might also like...
EpikCord.py - This is an API Wrapper for Discord's API for Python

EpikCord.py - This is an API Wrapper for Discord's API for Python! We've decided not to fork discord.py and start completely from scratch for a new, better structuring system!

A simple Python API wrapper for Cloudflare Stream's API.

python-cloudflare-stream A basic Python API wrapper for working with Cloudflare Stream. Arbington.com started off using Cloudflare Stream. We used the

Discord-Wrapper - Discord Websocket Wrapper in python

This does not currently work and is in development Discord Websocket Wrapper in

An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% api coverage most of the codebase is documented

An API Wrapper for Gofile API

Gofile2 from gofile2 import Gofile g_a = Gofile() print(g_a.upload(file="/home/itz-fork/photo.png")) An API Wrapper for Gofile API. About API Gofile

A simple API wrapper for the Tenor API

Gifpy A simple API wrapper for the Tenor API Installation Python 3.9 or higher is recommended python3 -m pip install gifpy Clone repository: $ git cl

An API wrapper around Discord API.

NeoCord This project is work in progress not for production use. An asynchronous API wrapper around Discord API written in Python. Features Modern API

A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key).

fulltmdb A wrapper for The Movie Database API v3 and v4 that only uses the read access token (not api key). Installation Use the package manager pip t

An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% API coverage Most of the codebase is documented

Comments
  • Error importing WalmartIO

    Error importing WalmartIO

    Trying to run the code, but it gives error on first line. Can you help ?

    from WIOpy import WalmartIO

    wiopy = WalmartIO(private_key_version='1', private_key_filename='./WM_IO_private_key.pem', consumer_id='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') data = wiopy.product_lookup('33093101')[0]


    TypeError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_17576\2346209252.py in ----> 1 from WIOpy import WalmartIO 2 3 wiopy = WalmartIO(private_key_version='1', private_key_filename='./WM_IO_private_key.pem', consumer_id='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX') 4 data = wiopy.product_lookup('33093101')[0]

    ~\Anaconda3\envs\QI_MVP_env\lib\site-packages\WIOpy_init_.py in ----> 1 from .WalmartIO import * 2 from .AsyncWIO import *

    ~\Anaconda3\envs\QI_MVP_env\lib\site-packages\WIOpy\WalmartIO.py in 9 from requests.api import request 10 ---> 11 from .arguments import get_items_ids 12 from .errors import * 13 from .WalmartResponse import *

    ~\Anaconda3\envs\QI_MVP_env\lib\site-packages\WIOpy\arguments.py in 6 7 ----> 8 def get_items_ids(items: Union[str, list[str]]) -> list[str]: 9 if not isinstance(items, str) and not isinstance(items, list): 10 raise InvalidParameterException('Invalid items argument, it should be a string or List of strings')

    TypeError: 'type' object is not subscriptable

    bug 
    opened by shayan-NECX 6
  • Currently only works on python>=3.9

    Currently only works on python>=3.9

    Currently, the API does not work for versions before python 3.9.

    If you try to use an earlier version, you will get a TypeError: 'type' object is not subscriptable.

    The issue comes from wiopy/arguments.py:

    def get_items_ids(items: Union[str, list[str]]) -> list[str]:
        if not isinstance(items, str) and not isinstance(items, list):
            raise InvalidParameterException('Invalid items argument, it should be a string or List of strings')
        ...
    

    list type casting only works for python>=3.9
    To fix, import List


    This issue will be fixed. I (the developer) am a little busy. But I will fix this issue and update pypi

    bug good first issue 
    opened by CoderJoshDK 2
Releases(v_011)
  • v_011(May 28, 2022)

  • v_009_alpha(Feb 9, 2022)

  • v_007_alpha(Feb 8, 2022)

  • v_006_alpha(Feb 2, 2022)

  • v_005_alpha(Feb 1, 2022)

    Added logging module and bulk lookups.

    The bulk lookup allows you to lookup a large number of ids without worrying that an error will break everything.

    Giving the class your publisherId during init, means you do not have to provide it as a kwarg for any call.

    Removed mystery import that should never have been there.

    Source code(tar.gz)
    Source code(zip)
  • v_003_alpha(Jan 25, 2022)

  • v_002-alpha(Jan 20, 2022)

    Setup code and testing. The wrapper is ready to use just not fully tested for all cases yet.

    What is new:

    • Everything lol
    • Affiliate API calls
    Source code(tar.gz)
    Source code(zip)
Owner
A passionate programmer looking to expand my skills in everything I find interesting.
A simple discord bot that generates facts!

fact-bot A simple discord bot that generates facts! How to make a bot Go to https://discord.com/developers/applications Then click on 'New Application

1 Jan 05, 2022
Обертка для мини-игры "рабы" на python

Slaves API Библиотека для игры Рабы на Python. Большая просьба Поставьте звездочку на репозиторий. Это много для меня значит. Версии Т.к. разработчики

Zdorov Philipp 13 Mar 31, 2021
The official Discord Python framework for thenewboston blockchain.

Project Setup Follow the steps below to set up the project on your environment. Mac Setup Homebrew requires the Xcode command-line tools from Apple's

Bucky Roberts 18 Jul 15, 2022
A simple Discord Bot that uses the free CryptoCompare API to display cryptocurrency prices

What is this? This is a simple Discord Bot coded in Python that uses the free CryptoCompare API to display cryptocurrency prices Download Use git to c

Kevin 10 Apr 17, 2022
cipher bot telegram

cipher-bot-telegram cipher bot telegram Telegram bot that encode/decode your messages To work correctly, you must install the latest version of python

anonim 1 Oct 10, 2021
Cryptocurrency Prices Telegram Bot For Python

Cryptocurrency Prices Telegram Bot How to Run Set your telegram bot token as environment variable TELEGRAM_BOT_TOKEN: export TELEGRAM_BOT_TOKEN=your_

Sina Nazem 3 Oct 31, 2022
I-Spy is a discord and twitter bot 🤖 that keeps a check on usage foul language, hate-speech and NSFW contents

I-Spy is a discord and twitter bot 🤖 that keeps a check on usage foul language, hate-speech and NSFW contents. It is the one stop solution to monitor your discord servers and twitter handles against

Tia Saxena 5 Nov 16, 2022
🤖 Telegram UserBot Untuk Memutar Lagu Dan Video Di Obrolan Suara Telegram.

🤖 Telegram UserBot Untuk Memutar Lagu Dan Video Di Obrolan Suara Telegram.

Fariz 2 Nov 13, 2021
OpenSea Python Bot coded purely in Python3.

OpenSea Python Bot coded purely in Python3. It utilises everything from OpenSea API to continuously monitor NFT's. It can be used to snipe or monitor if something falls below floor value.

OpenSea Elite Sniper 20 Dec 29, 2021
fbchat - Facebook Messenger for Python

A powerful and efficient library to interact with Facebook's Messenger, using just your email and password.

1.1k Dec 23, 2022
Using AWS Batch jobs to bulk copy/sync files in S3

Using AWS Batch jobs to bulk copy/sync files in S3

AWS Samples 14 Sep 19, 2022
A Really Simple and Advanced Google Colab NoteBook to Setup and start using Rclone on Google Colab easily.

Rclone on Google Colab (Advanced!) 🔥 1.Setup and Start using Rclone on Google Colab and Create/Edit/View and delete your Rclone config file and keep

Dr.Caduceus 14 May 24, 2022
Widevine MPD Content Downloader & Decryptor

Widevine-DL Encrypted MPD Manifest Content Downloader + Decryptor (not a Widevine Key Extractor!) Requirements ffmpeg, yt-dlp, aria2, widevine-l3-decr

Vank0n (SJJeon) 170 Dec 30, 2022
Some examples regarding how to use the Twitter APIs for academic research

Twitter Developer Platform: Using Twitter APIs for Academic Research All the scripts require a config.ini file in which the keys are put. There is a t

Federico Bianchi 6 Feb 13, 2022
An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

An Open Source ALL-In-One Telegram RoBot, that can do lot of things.

JOBIN 0 Dec 01, 2021
A free sniper bot built to work with PancakeSwap: Router V2

Pancakeswap Sniper Bot PancakeSwap sniper bot. Automated sniping bot to snipe crypto coin launches. How it works The sniping bot can be used in three

89 Aug 06, 2022
This is an Advanced Calculator maybe with Discord Buttons in python.

Welcome! This is an Advanced Calculator maybe with Discord Buttons in python. This was the first version of the calculator, made for my discord bot, P

Polsulpicien 18 Dec 24, 2022
Python script to backup/convert your Spotify playlists into the XSPF format.

Python script to backup/convert your Spotify playlists into the XSPF format.

Chris Ovenden 4 Jun 09, 2022
Automated AWS account hardening with AWS Control Tower and AWS Step Functions

Automate activities in Control Tower provisioned AWS accounts Table of contents Introduction Architecture Prerequisites Tools and services Usage Clean

AWS Samples 20 Dec 07, 2022
A python script that can send notifications to your phone via SMS text

Discord SMS Notification A python script that help you send text message to your phone one of your desire discord channel have a new message. The proj

2 Apr 25, 2022