我的所有代码都在这里:
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": "This API project was not found. This API project may >>have \n been deleted.",
"results": [],
"status": "REQUEST_DENIED"}
block 引用>
最佳答案
遇到了和你类似的问题,并解决了:
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
之前缺少 &
。
关于node.js - 为什么在 console.developers.google.com 中创建 API key 时收到此错误消息 :'This API project was not found',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48547571/