Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to get coupons from honey in python

import requests
#  By Link-Start
def get_coupons(store:str = 'displate') -> list:
    url=f'https://d.joinhoney.com/v3?operationName=web_getStoreByLabel&variables=%7B%22label%22%3A%22{store}%22%7D'
    data=requests.get(url).json()
    coupons = []
    for code in range(len(data['data']['getStoreByLabel']['publicCoupons'])):
        coupons.append(data['data']['getStoreByLabel']['publicCoupons'][code]['code'])
    return coupons
print(get_coupons(store='displate'))
 
PREVIOUS NEXT
Tagged: #coupons #honey #python
ADD COMMENT
Topic
Name
1+3 =