Google 缩短器 API:列入白名单的 IP 不起作用

Google Shortener API: whitelisted IP not working

我在 Developers Console 上设置了 Google Shortener API 凭据。我为密钥创建了一个 Public API access,允许的 IP 为 199.180.250.40

但是当我调用 API 时,我得到这个 Google 错误:

There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.

我确定我的服务器是 199.180.250.40,并且脚本是 运行 离开那个服务器。我已经三重检查,包括使用 lynx 访问 whatismyip。

我正在使用此代码:https://github.com/sebi/googl-php

使用此代码:

        $googl = new Googl("my-key");
        $short = $googl->shorten($url);
        unset($googl);

即使那是我的服务器的确切 IP,为什么它仍会拒绝?

我没有发送 userIp 但 Google 说:

If the userIp parameter is missing, your machine's IP address will be used instead.

Google 那边是否有我可以查看的访问日志?

如评论中所述,服务器使用的是 IPv6,因此与我输入的 IPv4 不匹配。我输入了我的 IPv6,它起作用了。

还有一个 "requests per second limit" 设置为 5 左右。这有点低,所以我把它提高到 30。