In this provided Python code in this quickstart, it using credentials.json such in this line:
flow = InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES)
I have enabled the Sheet and Drive API. I created credentials from the APIs & Services menu, then on the Credentials tab, click on the CREATE CREDENTIALS button, then click on the OAuth client ID, and on the Application type I selected the Desktop app, then I download its JSON file, then set the credentials.json file to the right path, like this:
flow = InstalledAppFlow.from_client_secrets_file('client_secret_274233513361-l7vpffd7g9oree4tg5tledq9keqrevk3.apps.googleusercontent.com.json', SCOPES)
Then, when I run the quickstart code above, it shows a new browser pop-up that requires me to log in. After successfully login, yea, I can run the Python code successfully without any error.
But I don't want a new pop-up that requires me to log in first.
So my question:
Can I use Google Sheet API only with my credentials Client ID and Client secret

or only with API Key
If we can do it, how to do it? is there any documentation on how to achieve that?

/home/myuser/token.jsonofcreds = Credentials.from_authorized_user_file('/home/myuser/token.json', SCOPES). Is my understanding correct? If my understanding is correct, what file did you use atcredentials.jsonofflow = InstalledAppFlow.from_client_secrets_file('credentials.json', SCOPES)? If I misunderstood your situation, I apologize./home/myuser/token.jsonwas created by running the quickstart script. If my understanding is correct, after 2nd run, the access token is retrieved from the refresh token intoken.json. AboutBut I don't want a new pop-up that requires me to log in first., when OAuth2 is used, it is required to authorize the scopes by the browser. If you don't want to use the browser, how about using the service account? When the service account is used, the access token can be retrieved without using the browser.is there any documentation on how to achieve that?, if you need the sample script for using Sheets API with the service account, how about these threads? stackoverflow.com/… I thought that the threads in Stackoverflow will be useful. If my comments were not useful, I apologize.