0

I using Google Vision OCR to get text from image with PHP language. 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.

  • probably you have exceeded your request limit quota and the ip can no longer send requests. You either need to raise the limit or handle requests better. – Gntem Apr 14 '17 at 10:37
  • Hi, are you still using google vision ocr with php? –  Sep 06 '19 at 06:41

1 Answers1

1

Check that you have authorized the API in the Cloud API console and configured your PHP client as described in the sample documentation.

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.

class
  • 8,621
  • 29
  • 30