前提条件
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在开始编写您的首个客户端应用之前,您需要做一些准备工作(如果您还没有做的话)。
获取 Google 账号
您需要拥有一个 Google 账号才能在 Google API 控制台中创建项目。如果您已经具有账号,则您已准备就绪。
您可能还需要一个用来测试的单独 Google 账号。
试用 Google 街景
本 API 文档假定您使用过 Google 街景,并且您熟悉网络编程概念和网络数据格式。
如果您还没有用过 Google 街景,请在开始编码之前试用一下界面。
为客户端创建一个项目
在向 Google 街景发送请求之前,您需要告知 Google 您的客户端并激活对 API 的访问权限。为此,您可以使用 Google API 控制台创建一个项目(项目是设置和 API 访问信息的指定集合),然后注册您的应用。
要开始使用 Google Street View Publish API,您需要先
设置工具,它会引导您在
Google API 控制台、启用 API 并创建凭据。
如果您尚未创建应用的 API 密钥,请点击
创建凭据 >API 密钥。接下来,在 API
密钥部分。
了解 REST 基础知识
您可以通过以下两种方式调用 API:
如果您决定不使用客户端库,则将需要了解 REST 的基础知识。
REST 是一种软件架构样式,可提供便利、一致的方法来请求和修改数据。
术语 REST 是“具象状态传输”的简称。在 Google API 的上下文中,指的是使用 HTTP 谓词来检索和修改由 Google 存储的数据的表示法。
在 RESTful 系统中,资源存储在数据存储区中;在客户端发送要求服务器执行特定操作(例如创建、检索、更新或删除资源)的请求之后,服务器便会执行该操作并发送响应,此响应的格式通常为所指定资源的表示法。
在 Google 的 RESTful API 中,客户端使用 HTTP 谓词(例如 POST
、GET
、PUT
或 DELETE
)指定操作。它通过以下格式的全局唯一 URI 来指定资源:
https://www.googleapis.com/apiName/apiVersion/resourcePath?parameters
由于所有 API 资源都具有 HTTP 可访问的唯一 URI,因此 REST 启用了数据缓存,而且经过优化以与网络的分布式基础架构一起使用。
您可能会发现 HTTP 1.1 标准文档中的方法定义十分有用;这些定义中包含了 GET
、POST
、PUT
和 DELETE
的规范。
Google Street View Publish API 中的 REST
Google Street View Publish API 操作会直接映射到 REST HTTP 动词。
Google Street View Publish API URI 的具体格式为:
https://www.googleapis.com/streetviewpublish/v1/resourcePath?parameters
Google Street View Publish API 参考文档中总结了用于 API 中各项受支持操作的全部 URI。
了解 JSON 基础知识
Google Street View Publish API 会以 JSON 格式返回数据。
JSON(JavaScript 对象表示法)是一种与语言无关的常见数据格式,可通过简单的文本来表示任意数据结构。如需了解详情,请参阅 json.org。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eTo use the Google Street View Publish API, you will need a Google Account and a project created in the Google API Console.\u003c/p\u003e\n"],["\u003cp\u003eBefore diving into code, familiarize yourself with Google Street View's user interface and basic REST concepts like HTTP requests and JSON data format.\u003c/p\u003e\n"],["\u003cp\u003eAccess the Google Street View Publish API by sending HTTP requests and parsing JSON responses or by utilizing provided client libraries.\u003c/p\u003e\n"],["\u003cp\u003eWhen working directly with HTTP requests, understanding RESTful principles, including resource identification with URIs and using HTTP verbs for actions, is crucial.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Street View Publish API utilizes specific URI formats for accessing resources and provides comprehensive documentation for all supported operations.\u003c/p\u003e\n"]]],["To prepare for using the Google Street View Publish API, first, obtain a Google Account and try Google Street View. Next, create a project in the Google API Console to register your application and generate an API key. If you are not using client libraries, understand REST basics, which utilize HTTP verbs to manage data. Finally, familiarize yourself with JSON, the data format used by the API, for data retrieval and handling.\n"],null,["Before you can start coding your first client application, there are a few\nthings you need to do, if you haven't done them already.\n\nGet a Google Account\n\nYou need a [Google Account](https://www.google.com/accounts/NewAccount) in order to [create a project](#project) in the Google API Console. If you already have an account, then you're all set.\n\nYou may also want a separate Google Account for testing purposes.\n\nTry out Google Street View\n\nThis API documentation assumes that you've used Google Street View, and that you're familiar with web programming concepts and web data formats.\n\nIf you haven't used Google Street View, then try out the [user interface](http://www.google.com/streetview/) before starting to code.\n\nCreate a project for your client\n\nBefore you can send requests to Google Street View, you need to tell Google about your client and activate access to the API. You do this by using the Google API Console to create a project, which is a named collection of settings and API access information, and register your application.\n\nTo get started using Google Street View Publish API, you need to first\n[use\nthe setup tool](https://console.cloud.google.com/start/api?id=805111954036&credential=client_key), which guides you through creating a project in the\nGoogle API Console, enabling the API, and creating credentials.\n\nIf you haven't done so already, create your application's API key by clicking\n**Create credentials \\\u003e API key** . Next, look for your API key in the **API\nkeys** section.\n\nLearn REST basics\n\nThere are two ways to invoke the API:\n\n- Sending HTTP requests and parsing the responses.\n- Using [client libraries](/streetview/publish/libraries).\n\nIf you decide not to use client libraries, you'll need to understand the basics of REST.\n\nREST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.\n\nThe term REST is short for \"[Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer).\" In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.\n\nIn a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.\n\nIn Google's RESTful APIs, the client specifies an action using an HTTP verb such as `POST`, `GET`, `PUT`, or `DELETE`. It specifies a resource by a globally-unique URI of the following form: \n\n```\nhttps://www.googleapis.com/apiName/apiVersion/resourcePath?parameters\n```\n\nBecause all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.\n\nYou may find the [method definitions](https://tools.ietf.org/html/rfc7231#section-4.3) in the HTTP 1.1 standards documentation useful; they include specifications for `GET`, `POST`, `PUT`, and `DELETE`.\n\nREST in the Google Street View Publish API\n\nThe Google Street View Publish API operations map directly to REST HTTP verbs.\n\nThe specific formats for Google Street View Publish API URIs are: \n\n```\nhttps://www.googleapis.com/streetviewpublish/v1/resourcePath?parameters\n```\n\nThe full set of URIs used for each supported operation in the API is summarized in the [Google Street View Publish API Reference](/streetview/publish/reference/rest) document.\n\nLearn JSON basics\n\nThe Google Street View Publish API returns data in JSON format.\n\n\n[JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see [json.org](http://www.json.org/).\n\n\u003cbr /\u003e"]]