Dec-17-2023, 11:57 AM
Hi
I'm trying to get product and sales data from woocommerce using python
here is my code
I'm trying to get product and sales data from woocommerce using python
here is my code
import json
from woocommerce import API
wcapi = API(
url="https://abc",
consumer_key="ck_abc",
consumer_secret="cs_abc",
version="wc/v3",
timeout=50
)
response = wcapi.get('products', params={'per_page': 20})
print(response)and I got this errorError:Exception has occurred: JSONDecodeError
Expecting value: line 1 column 1 (char 0)
StopIteration: 0
During handling of the above exception, another exception occurred:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
File "X:\test.py", line 16, in <module>
print(wcapi.get("products", params={"per_page": 20}).json())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)May I know what have i done wrong?
