API call using Python: 404 Not found

Topic summary

New user attempts to fetch Shopify Admin API data via Python requests using a private app (API key/password embedded in URL) and receives {‘errors’: ‘Not Found’} (likely HTTP 404) for both orders.json and products.json on API version 2022-07. Host is the shop’s myshopify.com domain, and the app reportedly has full permissions.

Code snippet and endpoint construction are central: [email removed] The user followed a YouTube tutorial but still gets 404.

They suspect a connectivity or shop access issue and ask how to test the connection or resolve the error. No troubleshooting steps from others are provided yet (e.g., verifying shop domain, API version availability, or app access scopes).

Outcome/status: No solution yet; discussion is open with key questions unanswered on why 404 occurs despite permissions and correct-looking URL format.

Summarized with AI on February 8. AI used: gpt-5.

Hi,

I’m new to the Shopify API and am trying to collect the order information from my shop using python.

API_KEY = 'XXXXXXXXXX'
API_SECRET_KEY = 'ZZZZZZZ'
API_PASSWORD = 'YYYYYYY'
HOSTNAME = 'MYDOMAIN.myshopify.com'
VERSION = '2022-07'
RESOURCE = 'orders'

url = f'https://{API_KEY}:{API_PASSWORD}@{HOSTNAME}/admin/api/{VERSION}/{RESOURCE}.json'
r = requests.get(url)
print( r.json() )

This results in the output:

{'errors': 'Not Found'}

I have tried other endpoints such as ‘products.json’ as in this tutorial:
https://www.youtube.com/watch?v=CbsbunnH8Q0&t=387s&ab_channel=JohnWatsonRooney

I still get ‘Not found’ even though I copy his tutorial.

It is a private app, and I have given it all the permissions.

I suspect the call actually works but doesn’t connect to the shop for some reason…
Is there some way to test this?
Or do any of you have any ideas on how to solve this?

Thanks in advance