简体   繁体   English

IP地址发出的Google Vision API请求...已被阻止

[英]Google Vision API Requests from IP address … are blocked

I using Google Vision OCR to get text from image with PHP language. 我使用Google Vision OCR使用PHP语言从图像中获取文本。 When i used in a long time. 当我使用了很长时间。 I get error below: 我收到以下错误:

array(1) {
  ["error"]=>
  array(4) {
    ["code"]=>
    int(403)
    ["message"]=>
    string(53) "Requests from IP address ..... are blocked."
    ["status"]=>
    string(17) "PERMISSION_DENIED"
    ["details"]=>
    array(1) {
      [0]=>
      array(2) {
        ["@type"]=>
        string(35) "type.googleapis.com/google.rpc.Help"
        ["links"]=>
        array(1) {
          [0]=>
          array(2) {
            ["description"]=>
            string(32) "Google developer console API key"
            ["url"]=>
            string(75) "https://console.developers.google.com/project/191619933224/apiui/credential"
          }
        }
      }
    }
  }
}

Please show me reason and how to fix it. 请告诉我原因以及解决方法。 Thank all so much. 非常感谢。

Check that you have authorized the API in the Cloud API console and configured your PHP client as described in the sample documentation . 检查您是否已经在Cloud API控制台中授权了API,并按照示例文档中的说明配置了PHP客户端。

Specifically, make sure you download the credentials.json file that is associated with your vision API project and set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the credential path before running the sample. 具体来说,在运行示例之前,请确保下载与您的视觉API项目相关联的credentials.json文件,并将GOOGLE_APPLICATION_CREDENTIALS环境变量设置为凭据路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM