我使用谷歌财务api获取股票报价并在我的网站上显示内容.从2017年9月6日起,这突然停止了工作.我以前获取股票报价的网址是https://finance.google.com/finance/info?client=ig&q=SYMBOL&callback= ?.
以前,我使用雅虎财务api,它是不一致的.所以,我切换到谷歌财务api.
你能帮帮我吗?
谢谢,拉姆
javascript stockquotes google-finance-api yahoo-finance google-api-javascript-client
http://api.chan15.info/google-stackoverflow.html
这是我用来让用户通过谷歌JavaScript API登录的示例代码,它的工作原理,下一步是使用用户ID通过PHP登录本地服务器,但是使用JavaScript的用户ID是非常危险的,我想要的真正程序是:
但我不知道如何获得访问令牌.
php oauth youtube-javascript-api google-api-javascript-client
我正在为浏览器使用Google JavaScript API,但间歇性地失败了,但以下异常:gapi.client.Error: API discovery response missing required fields。是什么原因造成的?
我的用于加载API的代码如下所示,我基本上是将脚本节点注入DOM中以加载API,将整个内容包装在Promise链中以便在就绪时进行处理:
new Promise((resolve, reject) => {
const script = document.createElement('script')
script.onload = resolve
script.onerror = reject
document.currentScript.parentNode.insertBefore(script, document.currentScript)
script.src = 'https://apis.google.com/js/api.js'
})
.then(() => {
return new Promise((resolve) => {
gapi.load('client:auth2', resolve)
})
})
.then(() => {
return gapi.client.init({
discoveryDocs: ['https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest',],
apiKey: initialState.googleApiKey,
clientId: initialState.oauthClientId,
scope: 'email profile https://www.googleapis.com/auth/calendar',
})
})
Run Code Online (Sandbox Code Playgroud)
追溯如下:
gapi.client.Error: API discovery response missing required fields.
at new wY (https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.nyHIlPOzvxo.O/m=auth2,client/rt=j/sv=1/d=1/ed=1/am=AQ/rs=AGLTcCNWHYGSUbRcGfoOSnVtpSAoqp5S-Q/cb=gapi.loaded_0:653:491)
at f (https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.nyHIlPOzvxo.O/m=auth2,client/rt=j/sv=1/d=1/ed=1/am=AQ/rs=AGLTcCNWHYGSUbRcGfoOSnVtpSAoqp5S-Q/cb=gapi.loaded_0:696:457)
at …Run Code Online (Sandbox Code Playgroud) javascript google-calendar-api google-api google-api-javascript-client
我正在使用Google One-Tap登录来对用户进行身份验证,并且在对用户进行身份验证后,我会获得访问令牌。我知道我可以使用此访问令牌来与JavaScript的Google API客户端(“ GAPI”)一起使用。但是我找不到使用此访问令牌的GAPI使用任何方法。
假设我已经有一个登录用户,是否可以使用GAPI?
我想要做的是简单地通过一次点击身份验证进行身份验证并对用户日历进行一次同意之后,访问用户日历。
google-api google-api-js-client gapi google-identity google-api-javascript-client
google-api-javascript-client ×4
google-api ×2
javascript ×2
gapi ×1
oauth ×1
php ×1
stockquotes ×1