Re: Access via Python following instructions - Notworking (UnauthorizedAccess, 401 , ...)

Access via Python following instructions - Notworking (UnauthorizedAccess, 401 , ...)

6 0 0



I would like to access my shopify admin via a custom app I have created. I followed the instructions here: 


Which let to this code:




import shopify as shopify

shop_url_simple = ""
api_version = "2022-07"
API_KEY= "..."
PASSWORD = "...."

shop_url = "" % (API_KEY, PASSWORD)

shop = shopify.Shop.current

# Get a specific product
product = shopify.Product.find(179761209)

# Create a new product
new_product = shopify.Product()
new_product.title = "Burton Custom Freestyle 151"
new_product.product_type = "Snowboard"
new_product.vendor = "Burton"
success = #returns false if the record is invalid





When I run this I receive:




pyactiveresource.connection.UnauthorizedAccess: Response(code=401, body="b'{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}'"  (...)





What I am doing wrong?

Reply 1 (1)

Shopify Staff
42 8 13

Hi @Hoobee 👋


I would recommend working through our most up to date instructions here on getting started with the Shopify Admin API Python Library. Hope that helps!

Umiko | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit or the Shopify Web Design and Development Blog