Cloud Natural Language offers you some control over where the resources for your project are stored and processed. In particular, you can configure Cloud Natural Language to store your data at rest and perform machine learning processing on your data only in the European Union or the United States.
By default Cloud Natural Language stores and 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 store your data and perform machine learning with it only in the European Union. If you choose the United States location, Google will store your data and perform machine learning with it only in the United States. 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.
Python
To learn how to install and use the client library for Natural Language, see Natural Language client libraries. For more information, see the Natural Language Python API reference documentation.
To authenticate to Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for Natural Language, see Natural Language client libraries. For more information, see the Natural Language Java API reference documentation.
To authenticate to Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for Natural Language, see Natural Language client libraries. For more information, see the Natural Language Node.js API reference documentation.
To authenticate to Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.