Cloud Natural Language API 具有传统的 REST/HTTP 和 gRPC 接口。如果您不想使用我们的客户端库访问 Cloud Natural Language API,可以自行选择编写使用其 REST/HTTP 或 gRPC API 途径的客户端库。仅当我们所提供的客户端库无法满足您的语言或其他需求时,我们才建议您使用此方法。
gRPC API
您可使用以下资源通过 .proto 服务定义,采用任何 gRPC 支持的语言为 Cloud Natural Language API 生成您自己的 gRPC 客户端库:
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-06-12。"],[],[],null,["# Service APIs Overview\n\nCloud Natural Language API has both traditional REST/HTTP and [gRPC](http://grpc.io)\ninterfaces. If you don't want to use our [client\nlibraries](/natural-language/docs/reference/libraries) to access the Cloud Natural Language API, you have the option of writing your own client libraries that use its\nREST/HTTP or gRPC API surface. We recommend this approach only if your language\nor other needs are not met by our provided client libraries.\n\ngRPC API\n--------\n\nYou can generate your own gRPC client libraries in any gRPC-supported language\nfor the Cloud Natural Language API API from its .proto service definition using these\nresources:\n\n- [Cloud Natural Language API service definition](https://github.com/googleapis/googleapis/blob/master/google/cloud/language/v1/language_service.proto)\n- [gRPC documentation](http://www.grpc.io/docs/): Everything you need to generate and use your own gRPC client code\n- [RPC API Reference](/natural-language/docs/reference/rpc): Language-independent overview of the RPC surface\n\nREST/HTTP API\n-------------\n\nThere are a number of possible options for interacting with a service's REST interface.\nUse the following resources to help you create your own clients for the REST API:\n\n- [REST API Reference](/natural-language/docs/reference/rest)\n- [Guidelines for working with Google HTTP APIs](https://cloud.google.com/apis/docs/http)\n- [API\n Discovery Service](https://developers.google.com/discovery/v1/getting_started): Exposes machine readable metadata about the REST/HTTP API surface, useful for creating client libraries, tools, and plugins.\n- [Directory of client samples](https://developers.google.com/discovery/libraries) built with REST/HTTP APIs and the Google API Discovery Service."]]