1,678 questions
1
vote
1
answer
105
views
Google Cloud Monitoring API: How to query Distance Matrix "elements" instead of "requests"?
I'm trying to audit my Google Distance Matrix API usage to calculate costs per month.
Since billing is based on elements, counting the HTTP requests is not enough. I'm using the google.cloud....
0
votes
1
answer
59
views
How do I call domainAliases.list with the discovery API?
Looking at the docs this is the only perm I should need to grant my service account: https://www.googleapis.com/auth/admin.directory.domain.readonly
The service account I'm using has domain ...
1
vote
0
answers
186
views
Google Docs API - 403 - googleapiclient.errors.HttpError: 403
Problem:
I am facing this error-
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://docs.googleapis.com/v1/documents?alt=json returned "The caller does not have ...
0
votes
1
answer
72
views
403 Forbidden Error when updating caption track via captions.update
I’m using the Python client library (google-api-python-client) to call captions.update, but I keep getting a 403 forbidden even though I’ve granted all the obvious scopes. I’d appreciate any insight ...
0
votes
0
answers
178
views
Google gmail api not working when using pyinstaller
So I am making this spam email filter in python so I tested it in vscode and it works as intended but when I use pyinstaller to package it it give me the error:
"Error accessing Gmail: ('...
0
votes
0
answers
159
views
Google OAuth2 Refresh Token Expires Quickly Despite “offline” Access (Unverified Published App)
Problem:
Even after requesting “offline” access and saving the refresh token, the refresh token stops working after 1 day or sometimes just a few hours.
Actual error: Reauthentication is needed. ...
0
votes
1
answer
50
views
Remove resource from event where caller is not the organizer using Google Calendar API?
I'm trying to remove resources (conference rooms) that have declined events. It works as expected for events where the caller is the event organizer, but not if another person is the organizer. The ...
0
votes
2
answers
101
views
Can't create a monthly recurring google calendar event with python
I am using a python script to import calendar entries from one tool to google calendar. I have no problems with events that repeat weekly, but the monthly repeating events get created incorrectly.
I ...
0
votes
2
answers
195
views
Correct way to use GKE Connect Gateway client?
I'm trying to use the Connect Gateway client in python to connect to GKE but I keep getting 400, even if everything seemingly is correct.
Example
from google.cloud.gkeconnect import gateway_v1
client ...
0
votes
0
answers
161
views
Problem authenticating users' youtube brand accounts
An issue appeared today on my app where when users try to link their youtube brand accounts through the google oauth flow, they get stuck after agreeing to the terms and conditions. They are not ...
1
vote
0
answers
227
views
Unable to Query Google Calendar API due to Authentication Issues; Error 400 and 403: "Method does not allow unregistered callers"
I'm trying to integrate Google Calendar API in my python script, but I keep getting authentication errors, and I'm not sure why.
Errors:
(running the python script in the terminal):
An error occurred: ...
2
votes
1
answer
222
views
google-api-python-client random timeout error
I have project that involves taking a picture every one hour with a Raspberry and saving it to Google Drive. I'm using the google-api-python-client to connect to a Google Drive and apscheduler to ...
1
vote
1
answer
121
views
Google Sheets API - Create empty sheet - Slow performance
Using the Python example taken directly from the "Google Sheets API documentation > Create a spreadsheet" and changing only the credentials, I am experiencing poor performance. It's ...
0
votes
2
answers
168
views
Listing Google Drive files returning empty list (Python)
I am testing my python connection to Google Drive using Python Google API Client. I am able to establish a connection, but I am not getting back a list of objects from Google Drive. I wonder if a lack ...
0
votes
0
answers
269
views
Issue with redirect URI mismatch for Google OAuth 2.0
I am creating a Python script to generate a token from the user and store the generated token. While testing locally, everything worked fine when I used http://localhost:8000/ as the redirect URI in ...
0
votes
1
answer
85
views
Deleting Personal Emails from Gmail Efficiently
My Gmail reached the 15 GB limit, so I archived old emails with Thunderbird and I want to delete all the emails that are older than two weeks. Using the GUI is cumbersome because it seems like I can ...
0
votes
1
answer
112
views
Google Play Developer API create user always returns error code 500
I'm trying to create some automation to add users to a Google Play Developer account using the API. I wrote a python script using the google-api-python-client library. The service account I'm using ...
0
votes
0
answers
91
views
How can I host a Python Web API built with Flask on IIS?
I have developed a Python-based Web API using frameworks such as Flask or FastAPI and need to deploy it on an IIS (Internet Information Services) server. The goal is to make the API accessible within ...
2
votes
1
answer
216
views
Google DV360 Reporting - Error while fetching performance metrics
I am trying to extract and download reports from DV360 API using python. I have gone through the documentation https://developers.google.com/bid-manager/guides/get-started/send-request ,but not able ...
0
votes
1
answer
787
views
Access data on my google drive using service account [duplicate]
I can't read the files that I saved on "Google Drive" using the code that You can see below.
I've yet enabled the "Google Drive API" in the GCP project.
I've yet created the "...
1
vote
1
answer
144
views
Getting Google site reviews with Python
I need to be able to get Google site reviews by their API do put them in our data warehouse.
I tried with the following code:
from googleapiclient.discovery import build
API_KEY = '...
1
vote
0
answers
55
views
Invalid Value when using the subscriptionv2 api
The Purchase token i used for testing is like : GPA.3376-9095-7476-99xxx
I'm not sure if it a purchase token as i use adapty and this is the transaction ID i got from it.
def ...
4
votes
1
answer
7k
views
Parse Table data from a public google doc using Python
I have a URL to a public google doc which is published (It says published using Google Docs at the top). It has a URL in the form of
https://docs.google.com/document/d/e/<Some long random string, I ...
0
votes
0
answers
90
views
Google books API giving a 401 error that makes no sense to me
I must mention all of this was working perfectly and then stopped working suddenly. I was using a python script to upload epub files from my google drive to my google playbooks library.
This is my ...
1
vote
1
answer
77
views
How to search specific columns and return specific values in python using Google spreadsheet?
I’m having trouble getting this to work. Essentially I want a user to input a keyword and then get a question and answer pair as a return. The first, second, and third columns in the the spreadsheet ...
1
vote
1
answer
476
views
Google's Meeting API does not seem to work for server to server calls
I am trying to fetch details and artifacts from the google meet recording by using the recently released Google Meet APIs. I want to make a server to server API call, so have created a service account ...
1
vote
0
answers
82
views
Google service python API fails: is it a bad parameter (400) or a failed authentication (401)?
I'm working with the mybusinessbusinessinformation API, attempting to get a list of locations.
The documentation for this API is here.
I have already taken the following steps:
Filled out the form ...
1
vote
1
answer
323
views
Issues passing params to BetaAnalyticsDataClient() function in Python (google.analytics.data_v1beta library) - Service Account
I have written a very simple piece of code in python for use in an azure function. It is meant to use my service account creds to run a report in google analytics 4 and return the results in JSON.
As ...
0
votes
1
answer
391
views
Google pubsub SubscriberClient AttributeError: 'generator' object has no attribute 'add_done_callback'
I'm working on a project and must consume some messages from my GCP Pubsub subscription. Locally I can consume messages normally.
But when I release the changes to a container in the cloud (something ...
1
vote
1
answer
2k
views
How to properly refresh Google Cloud Python API credentials?
I'll re-formulate this question based on the feedback.
First, a few base facts:
I'm writing a GUI application that talks to google cloud services using the google.cloud Python SDK.
I'm using google ...
2
votes
1
answer
554
views
Google Drive API Get file metedata
Does anyone know how to use the GoggleDrive API to get files that are in the Shared Drives category.
I have a API call that I can use to get metadata via FileID which
works for files that are shared ...
0
votes
2
answers
2k
views
Sending PDF to gemini-1.5-pro-latest fail with 500 error
Below is a snippet that sends a prompt and a pdf file to gemini.
def runGemini(prompt, model, document=None):
model = genai.GenerativeModel(model)
content = prompt
if document:
...
0
votes
0
answers
106
views
Google Authentication with Python to Google Cloud resources
I am developing an application with Python which consumes resources from Google Cloud. I would like to automate the authentication process (right now what I have is the authentication via an API Key ...
1
vote
1
answer
4k
views
How to JSON formatted big data send to GEMINI to ask for analysis?
import pathlib
import json
import textwrap
import google.generativeai as genai
from IPython.display import display
from IPython.display import Markdown
def to_markdown(text):
text = text.replace('•...
1
vote
1
answer
134
views
How to fix error in get doc from Google API?
from google.oauth2.service_account import Credentials
from googleapiclient.discovery import build
import random
import msvcrt
import json
credentials_doc = 'service_account.json'
...
1
vote
1
answer
67
views
Specify keyType when "searching_all_resources" for SA keys with asset_v1 Python client in GCP
I am attempting to utilize python to retrieve all the user-managed service account keys in my organization, with the below snippet from this documentation.
from google.cloud import asset_v1
import ...
0
votes
1
answer
127
views
MWAA: Timeout on googleapiclient Connection
We are experiencing timeout issue when connecting to Google Sheets, specifically using googleapiclient. The code has been working, but after some new deployment, we start getting this error. Even we ...
0
votes
1
answer
2k
views
Connecting to Gemini Web Chat using Selenium in Python
I'm trying to connect to the Gemini web chat using Selenium in Python to replicate the functionality described in this Medium article.
I've attempted to use the following code:
from selenium import ...
1
vote
1
answer
216
views
Getting FolderID and folder name inside a particular folder in Google Drive
I am using Colab in Python to get the folder ID and folder name inside a particular folder called myProject from Google Drive.
Folder structure is like this:
Google Drive (When I open drive.google.com ...
0
votes
2
answers
192
views
Troubleshooting Google Drive API Issue: Google cloud python function Fails to Detect PDF Files in Shared Folder
I developed a Python script that operates on the Google Cloud Platform. The script utilizes the Google Drive API and Google Sheet API to access a folder in Google Drive belong to a company , extract ...
1
vote
1
answer
246
views
Why Does Google API Not Connect and Times Out
I am trying to use the API Key and it does take the picture on the Raspi but then gets stuck trying to send it to the Drive and I am unsure why.
Note: I took out the key and ID for privacy but I do ...
0
votes
1
answer
328
views
Deploy functions to Cloud Functions using Python
Is there a way to deploy scripts from a repository as GitHub to Cloud Functions with python without using docker or subprocess commands?
I tried this sample code that uses the CreateFunctionRequest ...
0
votes
1
answer
106
views
Created Event Not Visible in Google Calendar Google Api Client Python
i am using service account auth2client.service_account and googleapiclient to connect to google calendars and create events, my issue is my events are creating and also confirmed using list events, ...
0
votes
0
answers
119
views
I cannot get Gmail to Base64decode correctly
UPDATE
Thank you Tuppitappi (https://stackoverflow.com/users/10129894/tuppitappi)
Your answer on this question: Gmail api python encode/decode error and using urlsafe_b64decode was EXACTLY what I ...
2
votes
2
answers
8k
views
ModuleNotFoundError: No module named 'google' with Python
I have a very simply program that I copied from Google's workspaces, the import statements are as follows
import os.path
from google.auth.transport.requests import Request
from google.oauth2....
1
vote
1
answer
715
views
Increase timeout of API call to Cloud Run
I am triggering a cloud run job in GCP through airflow DAG. The job takes 30 minutes to execute, but the request timeout is 900 seconds so the DAG task fails.
The error is:
"Operation did not ...
2
votes
1
answer
2k
views
Google calendar API - Appointment schedule
In Google calendar you can add "Appointment schedule"
These are events that repeat periodically. But they are not created from ordinary events. They are created precisely by the schedule.
...
2
votes
2
answers
745
views
YouTube Playlist API does not return all videos in a channel
We are trying to get all videos in a channel, like this. This list has 291k videos, we figured out the channel id of this channel (and replaced the second alphabet "C" in the id by "U&...
15
votes
2
answers
37k
views
Encountering 503 Error When Calling Gemini API from Google Colab
I'm working on a project using Google Colab to run Python code that interacts with the Gemini API (a part of Google's Cloud AI tools). The goal is to automate call transcript categorization into ...
0
votes
1
answer
30
views
Difference between SCOPE and DATA_SOURCE in Fitness API
I'm working on fetching heart rate data from Google Fitness API using python and I would like to know what is the difference between hear rate SCOPE "https://www.googleapis.com/auth/fitness....