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.
An Auto-Grinding bot made for Pokemeow. Efficient but not many features yet

PokeGrinder 🤖 This is an Auto-Grinding bot made for Pokemeow. Efficient but not many features yet. Supported features This bot can currently handle :

Xombie 9 Feb 01, 2022
a harbinger of events or things.

Herald: Intrusion Detection System using IR and ML Herald - noun; a harbinger of events or things. Overview Herald is an intrusion detection system us

Muhammad Muzzammil 4 Jun 07, 2021
Cookies is a project inspired by python cookiecutter but used for terraform generation.

Introduction Cookies is a project inspired by python cookiecutter but used for terraform generation. How to run your terraform After you download your

Digger 6 Mar 14, 2022
Check your accounts/tokens fast with our checker!

Discord_Account_Checker How to use? Installing library's pip install -r reqs.txt Loading accounts Load your accounts to accounts.txt file. Launch pyth

1 Jan 11, 2022
Instagram-Reports is a tool made to ban any scam or bad person

ABOUT TOOL : Instagram-Reports is a tool made to ban any scam or bad person. Installation : sudo apt-get update -y sudo apt-get upgrade -y apt insta

Evan Al Mahmud Irfan ථ 1 Dec 20, 2021
A Discord bot to scrape textfiles from messages and put them to Hastebin

A Discord bot to scrape textfiles from messages and put them to Hastebin. Intended to use on support servers to help users read textfiles on mobile.

1 Jan 23, 2022
Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live strams, YouTube videos and telegram media.

Telegram bot to stream videos in telegram voicechat for both groups and channels. Supports live strams, YouTube videos and telegram media.

SUBIN 449 Dec 27, 2022
The most fresh and updateable Telegram userbot. By one of the most active contibutors to GeekTG

Installation Script installation: Simply run this command out of root: . (wget -qO- http://gg.gg/get_hikka) Manual installation: apt update && apt in

Dan Gazizullin 150 Jan 04, 2023
Automatic generation of crypto-arts based on image layers

NFT Generator Автоматическая генерация крипто-артов на основе слоев изображения. Установка pip3 install -r requirements.txt rm -rf result/* Как это ра

Zproger 31 Dec 29, 2022
Basic Discord python bot

#How to Create a Discord Bot Account In order to work with the Python library and the Discord API, we must first create a Discord Bot account. Here ar

Tustus 1 Oct 13, 2021
This script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin.

BOOKING IN BERLINS VACCINATION CENTERS This python script books automatically a slot on Doctolib in one of the public vaccination centers in Berlin. T

17 Jan 13, 2022
Fix Twitter video embeds in Discord

TwitFix very basic flask server that fixes twitter embeds in discord by using youtube-dl to grab the direct link to the MP4 file and embeds the link t

Robin Universe 682 Dec 28, 2022
A Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram

Original Repo mirror-leech-telegram-bot This is a Telegram Bot written in Python for mirroring files on the Internet to your Google Drive or Telegram.

0 Jan 03, 2022
Best DDoS Attack Script Python3, Cyber Attack With 40 Methods

MXDDoS - DDoS Attack Script With 40 Methods (Code Lang - Python 3) Please Don't Attack '.gov' and '.ir' Websites :) Features And Methods 💣 Layer7 GET

7 Mar 07, 2022
A discord bot made by the community (uses python)

discord community bot context: this is a discord bot made by the community by community i mean people adding commands to the bot or changing the bot b

TR ASH 0 Oct 11, 2022
Telegram Bot for everyday raffles

SpinEverydayBot v2 Telegram bot for everyday raffles. HIGHLY EXPERIMENTAL! WORK IN PROGRESS! Setting up Requirements Python 3.9+ PostgreSQL 13+ Older

evgfilim1 18 Dec 20, 2022
Instadev - Crack Instagram IqbalDev

Crack Instagram IqbalDev ⇨ Install Script Di Termux $ pkg update && upgrade $

Dicky Wahyudi 1 Feb 27, 2022
🌶️ Give real chat boosting to your discord server.

Chat-Booster Give real chat boosting to your discord server. ✅ Setup: - Add token to scrape messages on server that you whant. - Put the token in

&! Ѵιchy.#0110 36 Nov 04, 2022
Pythonic wrapper for the Aladhan prayer times API.

aladhan.py is a pythonic wrapper for the Aladhan prayer times API. Installation Python 3.6 or higher is required. To Install aladhan.py with pip: pip

HETHAT 8 Aug 17, 2022