我知道这意味着我超过了每天的请求,但问题是当我每天只做很少的请求时,它就会发生,它一次也没有起作用。
我只是尝试简单地使用API,所以我不可能超过我每天的请求(每24小时2,500个请求)。
也许我错过了什么..。
这是我的代码:--
$loc_array = json_decode( file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.str_replace(" ","+",$address).'&sensor=true') );
if($loc_array->status != 'ZERO_RESULTS'){
$data['lat1'] = $loc_array->results[0]->geometry->location->lat;
$data['lon1'] = $loc_array->results[0]->geometry->location->lng;
$data['status'] = true;
return $data;
}
else
{
$data = array("status"=>false);
return $data;
}我从这个API得到了JSON响应
{
"error_message" : "You have exceeded your daily request quota for this API.",
"results" : [],
"status" : "OVER_QUERY_LIMIT"
}请帮我解决这个问题。给我任何建议。
提前谢谢。
发布于 2016-08-06 21:36:59
当您超过每日2500次请求的限制时,会出现此错误。由于您的请求中没有包含任何API密钥,因此您将无法跟踪您发出了多少API请求。
因此,您应该包含来自Google Developers API控制台的API密钥,并可以检查当天使用的请求数。它将给出API使用情况的所有统计信息。
你可以在这里查看:https://console.developers.google.com/iam-admin/quotas?project=YOUR_PROJECT_NAME
谢谢
https://stackoverflow.com/questions/38804687
复制相似问题