PHP 5 has reached end of support and will be
deprecated
on January 31, 2026. After deprecation, you won't be able to deploy PHP 5
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing PHP
5 applications will continue to run and receive traffic after their
deprecation date. We recommend that
you migrate to the latest supported version of PHP.
Stay organized with collections
Save and categorize content based on your preferences.
Outbound services, such as the URL Fetch, Sockets, and Mail APIs, make use of
a large pool of IP addresses. The IP address ranges in this pool are subject to
routine changes. In fact, two sequential API calls from the same application may
appear to originate from two different IP addresses.
You can find the current IP address ranges for your App Engine services
based on IP range information that Google publishes:
Google publishes the complete list of IP ranges that it makes available to
users on the internet in goog.json.
Google also publishes a list of global and regional external IP addresses
ranges available for customers' Google Cloud resources in
cloud.json.
The IP addresses used by Google APIs and services fit
within the list of ranges computed by taking away all ranges in cloud.json
from those in goog.json. These lists are updated frequently.
You can use the following Python script to create a list of IP address ranges
that include those used by Google APIs and services.
For information about running this script, see How to
run.
from__future__importprint_functionimportjsontry:fromurllibimporturlopenexceptImportError:fromurllib.requestimporturlopenfromurllib.errorimportHTTPErrorimportnetaddrIPRANGE_URLS={"goog":"https://www.gstatic.com/ipranges/goog.json","cloud":"https://www.gstatic.com/ipranges/cloud.json",}defread_url(url):try:returnjson.loads(urlopen(url).read())except(IOError,HTTPError):print("ERROR: Invalid HTTP response from %s"%url)exceptjson.decoder.JSONDecodeError:print("ERROR: Could not parse HTTP response from %s"%url)defget_data(link):data=read_url(link)ifdata:print("{} published: {}".format(link,data.get("creationTime")))cidrs=netaddr.IPSet()foreindata["prefixes"]:if"ipv4Prefix"ine:cidrs.add(e.get("ipv4Prefix"))if"ipv6Prefix"ine:cidrs.add(e.get("ipv6Prefix"))returncidrsdefmain():cidrs={group:get_data(link)forgroup,linkinIPRANGE_URLS.items()}iflen(cidrs)!=2:raiseValueError("ERROR: Could process data from Google")print("IP ranges for Google APIs and services default domains:")foripin(cidrs["goog"]-cidrs["cloud"]).iter_cidrs():print(ip)if__name__=="__main__":main()
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eOutbound services use a large pool of IP addresses that are subject to frequent changes, meaning sequential API calls from the same application may originate from different IP addresses.\u003c/p\u003e\n"],["\u003cp\u003eGoogle publishes two JSON files, \u003ccode\u003egoog.json\u003c/code\u003e and \u003ccode\u003ecloud.json\u003c/code\u003e, containing lists of IP ranges available to internet users and Google Cloud resources, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe IP addresses used by Google APIs and services can be found by subtracting the IP ranges in \u003ccode\u003ecloud.json\u003c/code\u003e from those in \u003ccode\u003egoog.json\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eA Python script is provided to compute the list of IP address ranges that include those used by Google APIs and services, and instructions are available on how to run it.\u003c/p\u003e\n"],["\u003cp\u003eThe previously used \u003ccode\u003e_spf.google.com\u003c/code\u003e DNS TXT record is no longer a complete representation of all possible IP ranges used by Google APIs and services, although it is still accurate for SPF purposes.\u003c/p\u003e\n"]]],[],null,["# Outbound IP addresses for App Engine services\n\nOutbound services, such as the URL Fetch, Sockets, and Mail APIs, make use of\na large pool of IP addresses. The IP address ranges in this pool are subject to\nroutine changes. In fact, two sequential API calls from the same application may\nappear to originate from two different IP addresses.\n\n\u003cbr /\u003e\n\nYou can find the current IP address ranges for your App Engine services\nbased on IP range information that Google publishes:\n\n- Google publishes the complete list of IP ranges that it makes available to\n users on the internet in [goog.json](https://www.gstatic.com/ipranges/goog.json).\n\n- Google also publishes a list of global and regional external IP addresses\n ranges available for customers' Google Cloud resources in\n [cloud.json](https://www.gstatic.com/ipranges/cloud.json).\n\nThe IP addresses used by Google APIs and services fit\nwithin the list of ranges computed by taking away all ranges in `cloud.json`\nfrom those in `goog.json`. These lists are updated frequently.\n\nYou can use the following Python script to create a list of IP address ranges\nthat include those used by Google APIs and services.\n\nFor information about running this script, see [How to\nrun](https://github.com/GoogleCloudPlatform/networking-tools-python/tree/main/tools/cidr#how-to-run). \n\n from __future__ import print_function\n\n import json\n\n try:\n from urllib import urlopen\n except ImportError:\n from urllib.request import urlopen\n from urllib.error import HTTPError\n\n import netaddr\n\n IPRANGE_URLS = {\n \"goog\": \"https://www.gstatic.com/ipranges/goog.json\",\n \"cloud\": \"https://www.gstatic.com/ipranges/cloud.json\",\n }\n\n\n def read_url(url):\n try:\n return json.loads(urlopen(url).read())\n except (IOError, HTTPError):\n print(\"ERROR: Invalid HTTP response from %s\" % url)\n except json.decoder.JSONDecodeError:\n print(\"ERROR: Could not parse HTTP response from %s\" % url)\n\n\n def get_data(link):\n data = read_url(link)\n if data:\n print(\"{} published: {}\".format(link, data.get(\"creationTime\")))\n cidrs = netaddr.IPSet()\n for e in data[\"prefixes\"]:\n if \"ipv4Prefix\" in e:\n cidrs.add(e.get(\"ipv4Prefix\"))\n if \"ipv6Prefix\" in e:\n cidrs.add(e.get(\"ipv6Prefix\"))\n return cidrs\n\n\n def main():\n cidrs = {group: get_data(link) for group, link in IPRANGE_URLS.items()}\n if len(cidrs) != 2:\n raise ValueError(\"ERROR: Could process data from Google\")\n print(\"IP ranges for Google APIs and services default domains:\")\n for ip in (cidrs[\"goog\"] - cidrs[\"cloud\"]).iter_cidrs():\n print(ip)\n\n\n if __name__ == \"__main__\":\n main()\n\n| **Note:** In the past, Google Cloud published a list of IP address ranges in the `_spf.google.com` DNS TXT record (and the records it referenced). While this DNS TXT record continues to be accurate for [SPF\n| purposes](https://support.google.com/a/answer/33786), it does not contain the complete set of possible IP address ranges used by Google APIs and services.\n\n\u003cbr /\u003e"]]