I am writing a program in javascript (node.js) that needs to collect some data from some website's api and I've run into a problem regarding google authentication's code. To get the data from the website, they require to paste google's authenticator verification code in the url. I have my google authenticator connected to that website so I have the verification code, but it makes no sense to paste the verification code in the url every time I make my program run. I want to automize the process and somehow get that google verification code in my program and then just use it in the url inside my program.
I've got the totp secret key from the QR google provided to me. However, to encode it I'd have to know google's server time since the code changes every 30 seconds or so.
So basically, is there a way to extract the code from google's authenticator and implement it into my code? I've checked google's apis but so far nothing about the authentication code itself.
Thanks in advance.