# Trying to access admin API as private app using Python

**URL:** <https://community.shopify.com/t/trying-to-access-admin-api-as-private-app-using-python/270250>\
**Category:** Authentication\
**Tags:** troubleshooting, Setting-Up\
**Created:** [November 20, 2023, 3:16pm UTC](https://community.shopify.com/t/trying-to-access-admin-api-as-private-app-using-python/270250 "2023-11-20T15:16:43Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

Accessing the Shopify Admin API as a private app in Python; confusion over where to get a “password” and a request for a working example.

Clarification:
- For private apps, the “password” referenced in older docs is the private app access token.
- Official examples were provided via the shopify_python_api getting-started guide.

Outcome (working approach shared):
- Authenticate by creating a session: shop_url = "{shop}.myshopify.com", api_version set, and access token used in shopify.Session(...). Then call ShopifyResource.activate_session(...).
- Data retrieval confirmed by fetching a product via Product.find({product_id}).

Key details:
- Use the private app access token in place of “password.”
- api_version noted as '2023-04' at the time; '2023-10' was not recognized yet.
- The older pattern embedding API_KEY:PASSWORD in the base URL was superseded by using Session with the access token.

Status: Resolved. The user successfully authenticated and retrieved product data; no open questions remain.

<div class="post-metadata">

**Author:** ![SSmythOV](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@SSmythOV](https://community.shopify.com/u/SSmythOV)\
**Post date:** [November 20, 2023, 3:16pm UTC](https://community.shopify.com/t/trying-to-access-admin-api-as-private-app-using-python/270250/1 "2023-11-20T15:16:43Z")

</div>

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](https://shopify.github.io/shopify_python_api/)

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

```auto
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!

---

<div class="post-metadata">

**Author:** ![SBD](https://yyz1.discourse-cdn.com/shopifyforum/user_avatar/community.shopify.com/sbd/32/236211_2.png) [@SBD](https://community.shopify.com/u/SBD)\
**Post date:** [November 21, 2023, 3:09am UTC](https://community.shopify.com/t/trying-to-access-admin-api-as-private-app-using-python/270250/2 "2023-11-21T03:09:51Z")

</div>

Hey @SSmythOV

The password is the access token. Here’s some example code: [https://github.com/Shopify/shopify\_python\_api#getting-started](https://github.com/Shopify/shopify_python_api#getting-started)

---

<div class="post-metadata">

**Author:** ![SSmythOV](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@SSmythOV](https://community.shopify.com/u/SSmythOV)\
**Post date:** [November 23, 2023, 12:00pm UTC](https://community.shopify.com/t/trying-to-access-admin-api-as-private-app-using-python/270250/3 "2023-11-23T12:00:56Z")

</div>

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)
