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 very basic starter bot based on CryptoKKing with a small balance

starterbot A very basic starter bot based on CryptoKKing with a small balance, use at your own risk. I have since upgraded this script significantly a

Danny Kendrick 2 Dec 05, 2021
A Discord token stealer app written in Python 3.

Discord Token Stealer A Discord token stealer app written in Python 3. This version of the grabber only supports Windows. Features No local caching Tr

cankat 45 Jan 03, 2023
SEP Finder Bot

SEP Finder Bot This is a Telegram bot that will help you find the correct SEP and Baseband files to use for your device with futurerestore. Usage A ho

6 Dec 03, 2022
A bot which provides online/offline and player status for Thicc SMP, using Replit.

AlynaaStatus A bot which provides online/offline and player status for Thicc SMP. Currently being hosted on Replit. How to use? Create a repl on Repli

QuanTrieuPCYT 8 Dec 15, 2022
VaccineAlarm is a simple python script that allows user to get notified when their desired vaccine doses are available at vaccine centers near them.

Introduction VaccineAlarm is a simple python script that allows user to get notified when their desired vaccine doses are available at vaccine centers

Ankit Tripathi 5 Nov 26, 2021
A basic Ubisoft API wrapper created in python.

UbisoftAPI A basic Ubisoft API wrapper created in python. I will be updating this with more endpoints as time goes on. Please note that this is my fir

Ethan 2 Oct 31, 2021
This Telegram bot allows you to create direct links with pre-filled text to WhatsApp Chats

WhatsApp API Bot Telegram bot to create direct links with pre-filled text for WhatsApp Chats You can check our bot here. The bot is based on the API p

RobotTrick • רובוטריק 17 Aug 20, 2022
Davide Gallitelli 3 Dec 21, 2021
Yes, it's true :revolving_hearts: This repository has 301 stars.

Yes, it's true! Inspired by a similar repository from @RealPeha, but implemented using a webhook on AWS Lambda and API Gateway, so it's serv

511 Dec 30, 2022
The unofficial Amazon search CLI & Python API

amzSear The unofficial Amazon Product CLI & API. Easily search the amazon product directory from the command line without the need for an Amazon API k

Asher Silvers 95 Nov 11, 2022
A github actions + python code to extract URLs to code repositories to put into standard form, starting with github

A github actions + python code to extract URLs to code repositories to put into standard form, starting with github ---- NOTE: JUS

Justin Gosses 2 Nov 15, 2021
This repository contains Python code examples using the MoneyMoov API

Python Examples This repository contains Python code examples using the MoneyMoov API. The examples are written to operate in the NoFrixion sandbox en

nofrixion 1 Feb 08, 2022
It's a discord.py simulator.

DiscordPySimulator It's a discord.py simulator. ⚠️ Things to fix Context As you may know, discord py commands provide the context as the first paramet

Juan Sebastián 11 Oct 24, 2022
The best discord.py template with a changeable prefix

Discord.py Bot Template By noma4321#0035 With A Custom Prefix To Every Guild Function Features Has a custom prefix that is changeable for every guild

Noma4321 5 Nov 24, 2022
Cloud-optimized, single-file archive format for pyramids of map tiles

PMTiles PMTiles is a single-file archive format for tiled data. A PMTiles archive can be hosted on a commodity storage platform such as S3, and enable

Protomaps 325 Jan 04, 2023
A youtube videos or channels tag finder python module

A youtube videos or channels tag finder python module

Fayas Noushad 4 Dec 03, 2021
Python Markov Chain chatbot running on Telegram

Hanasubot Hanasubot (Japanese 話すボット, talking bot) is a Python chatbot running on Telegram. The bot is based on Markov Chains so it can learn your word

12 Dec 27, 2022
Crosschat - A bot for cross-server communication

CrossChat A bot for cross-server communication. Running the bot To run the bot y

8 May 15, 2022
A delivery protection and notification system

DeliveryProtect This project builds a delivery protection and notification system, based on integration of Arduino Uno and Raspberry Pi 4. The codes a

2 Dec 13, 2021
An NFTGenerator to generate NFTs and send them to nft.storage

NFTGenerator Table of Contents Overview Installation Introduction Features Reflection Issues & bug reports Show your support Credits Overview The NFTG

3 Mar 14, 2022