Stay organized with collections
Save and categorize content based on your preferences.
Cloud Natural Language offers you some control over where the resources for your
project are processed. In particular, you can configure Cloud Natural Language to
perform machine learning processing on your data only in the EU or the US.
By default Cloud Natural Language processes resources in a Global location,
which means that Cloud Natural Language doesn't guarantee that your resources will
remain within a particular location or region. If you choose the
European Union location, Google will perform machine learning with it only
in the EU. If you choose the United States location, Google will
perform machine learning with it only in the US. You and your users
can access the data from any location.
Setting the location using the API
Cloud Natural Language supports a global API endpoint (language.googleapis.com),
a European Union endpoint (eu-language.googleapis.com), and a United States
endpoint (us-language.googleapis.com).
To process your data in the European Union only, use the URI
eu-language.googleapis.com in place of language.googleapis.com for your REST API calls.
To process your data in the United States only, use the URI
us-language.googleapis.com in place of language.googleapis.com for your REST API calls.
The text moderation API is also available in Australia, which can be accessed by using the URI au-language.googleapis.com in place of language.googleapis.com for your REST API calls.
Setting the location using client libraries
The client libraries access the global API endpoint (language.googleapis.com)
by default. To store and process your data in the European Union or United States only, you need to
explicitly set the endpoint. The code samples below show how to configure this setting.
# Imports the Google Cloud client libraryfromgoogle.cloudimportlanguage_v1client_options={"api_endpoint":"eu-language.googleapis.com:443"}# Instantiates a client.client=language_v1.LanguageServiceClient(client_options=client_options)
LanguageServiceSettingssettings=LanguageServiceSettings.newBuilder().setEndpoint("eu-language.googleapis.com:443").build();// Initialize client that will be used to send requests. This client only needs to be created// once, and can be reused for multiple requests. After completing all of your requests, call// the "close" method on the client to safely clean up any remaining background resources.LanguageServiceClientclient=LanguageServiceClient.create(settings);
// Imports the Google Cloud client libraryconstlanguage=require('@google-cloud/language');// Specifies the location of the api endpointconstclientOptions={apiEndpoint:'eu-language.googleapis.com'};// Instantiates a clientconstclient=newlanguage.LanguageServiceClient(clientOptions);
[[["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-28 UTC."],[],[],null,["# Locations\n\nCloud Natural Language offers you some control over where the resources for your\nproject are processed. In particular, you can configure Cloud Natural Language to\nperform machine learning processing on your data only in the EU or the US.\n\nBy default Cloud Natural Language processes resources in a **Global** location,\nwhich means that Cloud Natural Language doesn't guarantee that your resources will\nremain within a particular location or region. If you choose the\n**European Union** location, Google will perform machine learning with it only\nin the EU. If you choose the **United States** location, Google will\nperform machine learning with it only in the US. You and your users\ncan access the data from any location.\n\nSetting the location using the API\n----------------------------------\n\nCloud Natural Language supports a global API endpoint (`language.googleapis.com`),\na European Union endpoint (`eu-language.googleapis.com`), and a United States\nendpoint (`us-language.googleapis.com`).\nTo process your data in the European Union only, use the URI\n`eu-language.googleapis.com` in place of `language.googleapis.com` for your REST API calls.\nTo process your data in the United States only, use the URI\n`us-language.googleapis.com` in place of `language.googleapis.com` for your REST API calls.\n\nThe text moderation API is also available in Australia, which can be accessed by using the URI `au-language.googleapis.com` in place of `language.googleapis.com` for your REST API calls.\n\nSetting the location using client libraries\n-------------------------------------------\n\nThe client libraries access the global API endpoint (`language.googleapis.com`)\nby default. To store and process your data in the European Union or United States only, you need to\nexplicitly set the endpoint. The code samples below show how to configure this setting. \n\n### Python\n\n\nTo learn how to install and use the client library for Natural Language, see\n[Natural Language client libraries](/natural-language/docs/reference/libraries).\n\n\nFor more information, see the\n[Natural Language Python API\nreference documentation](/python/docs/reference/language/latest).\n\n\nTo authenticate to Natural Language, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n # Imports the Google Cloud client library\n from google.cloud import language_v1\n\n client_options = {\"api_endpoint\": \"eu-language.googleapis.com:443\"}\n\n # Instantiates a client.\n client = language_v1.LanguageServiceClient(client_options=client_options)\n\n### Java\n\n\nTo learn how to install and use the client library for Natural Language, see\n[Natural Language client libraries](/natural-language/docs/reference/libraries).\n\n\nFor more information, see the\n[Natural Language Java API\nreference documentation](/java/docs/reference/google-cloud-language/latest/overview).\n\n\nTo authenticate to Natural Language, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n LanguageServiceSettings settings =\n LanguageServiceSettings.newBuilder().setEndpoint(\"eu-language.googleapis.com:443\").build();\n\n // Initialize client that will be used to send requests. This client only needs to be created\n // once, and can be reused for multiple requests. After completing all of your requests, call\n // the \"close\" method on the client to safely clean up any remaining background resources.\n LanguageServiceClient client = LanguageServiceClient.create(settings);\n\n### Node.js\n\n\nTo learn how to install and use the client library for Natural Language, see\n[Natural Language client libraries](/natural-language/docs/reference/libraries).\n\n\nFor more information, see the\n[Natural Language Node.js API\nreference documentation](/nodejs/docs/reference/language/latest).\n\n\nTo authenticate to Natural Language, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n // Imports the Google Cloud client library\n const language = require('https://cloud.google.com/nodejs/docs/reference/language/latest/overview.html');\n\n // Specifies the location of the api endpoint\n const clientOptions = {apiEndpoint: 'eu-language.googleapis.com'};\n\n // Instantiates a client\n const client = new language.https://cloud.google.com/nodejs/docs/reference/language/latest/overview.html(clientOptions);\n\n\u003cbr /\u003e"]]