【问题标题】:Why I get this error message:'This API project was not found'while I'd created API key in console.developers.google.com为什么我在 console.developers.google.com 中创建 API 密钥时收到此错误消息:“未找到此 API 项目”
【发布时间】:2018-01-31 17:01:00
【问题描述】:

我所有的代码都在这里:

const request = require('request');
request({
  url:'https://maps.googleapis.com/maps/api/geocode/json?
key=*myKey*&address=1301%20lombard%20street%20philadelphia',
json: true
}, (error, response, body) => {
console.log(body);
});

我在命令提示符下收到这个:

{

"error_message": "未找到此 API 项目。此 API 项目可能>>已\n被删除。",
“结果”:[],
“状态”:“REQUEST_DENIED”

}

【问题讨论】:

    标签: node.js httprequest google-maps-api-2 api-key


    【解决方案1】:

    遇到了和你类似的问题,后来解决了:

    const request = require('request')
    const key = 'xxxxxxxxxxx'
    request ({
        url: 'https://maps.googleapis.com/maps/api/geocode/json?address=1301%20lombard%20street%20philadelphia%3F&?key=' + key,
        json: true
    }, (error, response, body) => {
        console.log(JSON.stringify(body, undefined, 2))
    })
    

    我认为您在?key 之前缺少&

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多