I have an api url . I need to fetch the data from api and store in GCS bucket as CSV file using python cloud function.
Can anyone help me on this ?
Hi @NishinThattil,
To fetch data from an API and store it as a CSV file in a Google Cloud Storage (GCS) bucket using a Python Cloud Function, follow these steps:
Storage Object Admin
). The easiest way is often to grant the service account these roles at the bucket level.requirements.txt
file listing the dependencies.Remember to replace placeholders like <YOUR_REGION
>, YOUR_API_URL, YOUR_GCS_BUCKET_NAME
with your actual values. The optional --set-env-vars
avoids hardcoding the API URL directly in the code. You can manage environment variables through the Google Cloud console.
I hope the above information is helpful.