statickidz / php-google-translate-free

PHP class to use the Google Translator API for free.
GNU General Public License v3.0
271 stars 91 forks source link

Google detected unusual traffic from your computer network, try again later (2 - 48 hours) #38

Open carlosvaldesweb opened 3 years ago

carlosvaldesweb commented 3 years ago

Hello, i've doing around of 30 requests, but now Google return me that.

"Google detected unusual traffic from your computer network, try again later (2 - 48 hours)""

Exists a way to evade this limitation?

I'm seeing that in the repository you have "Eliminates IP request limitations" should i to do something for the ip limitation?

Jerome-W-90 commented 3 years ago

I have the same issue, I don't know why. Someone has an idea ?

shmateyev commented 3 years ago

I have the same issue. Please help.

mcolominas commented 2 years ago

There is nothing you can do, the only thing you can do to avoid this problem is to change the server's IP or use a proxy to change your IP.

It is not a problem with this package, the problem comes from google, that you are trying to use its services in an "illegal" way, that's why it blocks your IP.

If you're using in your company, contact your boss to use Google Cloud Translate, if I'm not mistaken it's $20 per million characters.

Also, what do you have to know, that if you use this package, you are limited to 5000 characters

In my case, I use 3 things, database, this package, and Google Cloud Translate.

First I check in the database if there is a cached translation, if there is not I use this package to translate, in case of error I use Google Cloud Translate.

In case you want to use Google Cloud Translate, it is really easy, you have to obtain a key and with the following code you can translate

$translate = new Google\Cloud\Translate\V2\TranslateClient([
    'key' => $key
]);

$text_translated = $translate->translate($text, [
       'source' => $from,
       'target' => $to
])['text']

I've tried looking for free alternatives, but haven't found anything.

EDIT: Checking the prices of Google Cloud Translate, having $10 in the account, the first 500,000 characters per month are free, then you have to pay $20 per million characters and if you are not a client, they give you $300.

In my opinion, it is a good alternative, it is really cheap, and if you translate little, you will not have to make any payment, as long as you do not exceed 500,000 characters per month.

More info: https://cloud.google.com/translate/pricing