Trying to access admin API as private app using Python

I am new to the Shopify API and am trying to access my store information for the first time. I am building an app to synchronize my inventory between Shopify and my Lightspeed store. The built-in integration does not meet my needs. Getting anything successfully returned from an API the first time is always the biggest hurdle. From the documentation, I should be able to create a password for a private app but I only see a secret key, API key and access token. Is there somewhere to create a password?

From Shopify Open Source > shopify_python_api

"For a private App you just need to set the base site url as follows:

python
shop_url = "https://%s:%s@SHOP_NAME.myshopify.com/admin" % (API_KEY, PASSWORD)
shopify.ShopifyResource.set_site(shop_url)

That’s it you’re done, skip to step 6 and start using the API! "

Also, is there an example of a fully coded Python request to get information on a specific product? The snippets don’t seem to get past authorization. Once I can actually get data back from the API, I should be good to go. Thanks!

Hey @SSmythOV

The password is the access token. Here’s some example code: https://github.com/Shopify/shopify_python_api#getting-started

Got this to return results! I am off and running. The exact syntax I used is below, replacing bracketed info with my details:

private_app_password = “{access token}”
shop_url = “{my shop name}.myshopify.com”
api_version = ‘2023-04’ #Note that as of now, the API does not recognize ‘2023-10’ yet. This is the highest api version that was recognized.
session = shopify.Session(shop_url, api_version, private_app_password)
shopify.ShopifyResource.activate_session(session)

product = shopify.Product.find(4826622918788)
print(product)