Most API's (e.g. Stripe, Shopify, Hubspot, GA4, etc.) limit the amount of data you can get in one call. They also have rate limits. This means you can't pull all your data from them quickly (e.g. you couldn't pull all your stripe customers in a single API call).
You'd likely need to set up ETL to get this to work reliably.
PS - If you're interested in this sort of thing (an AI data assistant), that's exactly what we do at https://www.definite.app/. We offer a complete data stack + AI data assistant.
Yes, the general principle of it is that you ask it to perform a task and then add materials that help guide it until it gets those tasks done. Once it works it will work forever (or until the APIs change :P)
Google Analytics can be accessed via API, so you can both create a normal text note hinting on what code could access it or you could create Python API material.
You'd likely need to set up ETL to get this to work reliably.
PS - If you're interested in this sort of thing (an AI data assistant), that's exactly what we do at https://www.definite.app/. We offer a complete data stack + AI data assistant.