Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Die Discovery API stellt eine Liste von Google APIs bereit, über die für jede API maschinenlesbare Metadaten für „Discovery-Dokumente“ abgerufen werden können.
Dieses Dokument richtet sich an Entwickler, die Clientbibliotheken, IDE-Plug-ins und andere Tools zur Interaktion mit Google APIs schreiben möchten.
Hintergrund für Discovery Service
Konzepte
Der Google APIs Discovery Service basiert auf zwei grundlegenden Konzepten:
API-Verzeichnis: Eine Liste aller APIs, die vom APIs Discovery Service unterstützt werden. Jeder Verzeichniseintrag enthält Details zu einer unterstützten API, einschließlich Name, einer kurzen Beschreibung der API und eines Dokumentationslinks. Eine API kann mehrere Verzeichniseinträge enthalten, einen für jede unterstützte Version.
Discovery-Dokument: Eine maschinenlesbare Beschreibung einer bestimmten API.
Das Discovery-Dokument beschreibt die Oberfläche für eine bestimmte API-Version. Das Dokument enthält Details dazu, wie Sie über RESTful-HTTP-Aufrufe auf die verschiedenen Methoden der einzelnen APIs zugreifen. Ein Discovery-Dokument enthält Beschreibungen der mit der API verknüpften Daten und Methoden sowie Informationen zu verfügbaren OAuth-Bereichen und Beschreibungen von Schemas, Methoden, Parametern und verfügbaren Parameterwerten.
Datenmodell
Eine Ressource ist ein individuelles Datenobjekt mit einer eindeutigen ID. Der Google APIs Discovery Service arbeitet basierend auf den oben genannten Konzepten mit zwei Arten von Ressourcen.
APIs Directory List: Eine Liste von APIs
Jeder Verzeichniseintrag enthält ein API-Paar name/version mit den folgenden Informationen:
Identifikations- und Beschreibungsinformationen: Name, Version, Titel und Beschreibung.
Dokumentationsinformationen: Symbole und ein Link zur Dokumentation.
Statusinformationen: einschließlich Statuslabels, und eine Angabe dazu, ob dies die bevorzugte Version der API ist.
Link zum Discovery-Dokument: Der URI des Discovery-Dokuments für diese API (als vollständige URL angegeben, z. B. https://serviceusage.googleapis.com/$discovery/rest?version=v1).
Discovery-Dokumentressource: Eine maschinenlesbare Beschreibung einer bestimmten API
Neben den Informationen im APIs-Verzeichnis enthält ein Discovery-Dokument Folgendes:
Schemas: Eine Liste von API-Ressourcenschemata, die die Daten beschreiben, auf die Sie in jeder API zugreifen können. Die Schemas des Google APIs Discovery Service basieren auf dem JSON Schema.
Methoden, einschließlich einer Liste der API-Methoden und der verfügbaren Parameter für jede Methode.
OAuth-Bereiche: Die Liste der für diese API verfügbaren OAuth-Bereiche.
Inline-Dokumentation mit kurzen Beschreibungen von Schemas, Methoden, Parametern und verfügbaren Parameterwerten.
Die einzelne Verzeichnissammlung ist der konzeptionelle Container der einzelnen API-Verzeichnisressource und der Discovery-Dokumentressourcen für jede unterstützte API.
Abläufe
Sie können zwei verschiedene Methoden für Sammlungen und Ressourcen im Google APIs Discovery Service aufrufen, wie in der folgenden Tabelle beschrieben.
Vorgang
Beschreibung
REST-HTTP-Zuordnungen
list
Liste aller unterstützten APIs.
GET für den URI der Verzeichnisressource.
Aufrufstil
REST
Die unterstützten Vorgänge des Google APIs Discovery Service sind dem REST-HTTP-GET-Verb direkt zugeordnet, wie unter Vorgänge beschrieben.
Für URIs des Google APIs Discovery Service gelten folgende spezielle Formate:
https://API/$discovery/rest?version=VERSION
Dabei ist API die Kennung für eine Discovery-Dokumentressource und VERSION die Kennung der jeweiligen API-Version.
Hier einige Beispiele dafür, wie das im Google APIs Discovery Service funktioniert.
Listen Sie alle von Google APIs Discovery Service unterstützten APIs auf:
GET https://discovery.googleapis.com/discovery/v1/apis
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-25 (UTC)."],[[["\u003cp\u003eThe Google Discovery API provides machine-readable metadata ("Discovery documents") for various Google APIs, aiding developers in building client libraries and tools.\u003c/p\u003e\n"],["\u003cp\u003eThe service relies on an APIs Directory, listing available APIs, and Discovery documents detailing each API's structure, methods, and schemas.\u003c/p\u003e\n"],["\u003cp\u003eDiscovery documents employ JSON Schema to describe data structures and offer inline documentation for better understanding.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve the APIs Directory or a specific API's Discovery document through simple RESTful HTTP GET requests.\u003c/p\u003e\n"],["\u003cp\u003eThe service is publicly accessible for general API discovery, though private APIs may require authentication.\u003c/p\u003e\n"]]],[],null,["# Overview of the Discovery API\n\nThe Discovery API provides a list of Google APIs for retrieving a machine-readable \"Discovery\ndocument\" metadata for each API.\n\n\nThis document is intended for developers who want to write client libraries, IDE plugins, and\nother tools for interacting with Google APIs.\n\nDiscovery Service Background\n----------------------------\n\n### Concepts\n\nThe Google APIs Discovery Service is built upon two basic concepts:\n\n- **APIs Directory** : A list of all APIs that are supported by the APIs Discovery Service. Each directory entry shows details about a supported API, including its *name* , a brief *description* of what it does, and a *documentation\n link*. An API can have multiple Directory entries, one for each of its supported versions.\n- **Discovery document**: A machine-readable description of a particular API. The Discovery document describes the surface for a particular version of an API. The document provides details on how to access the various methods of each API via RESTful HTTP calls. A Discovery document includes descriptions of the data and methods associated with the API, as well as information about available OAuth scopes, and descriptions of schemas, methods, parameters and available parameter values.\n\n### Data model\n\n\nA resource is an individual data entity with a unique identifier. The Google APIs Discovery Service operates on\ntwo types of resources, based on the above concepts.\n\n#### APIs Directory List: A list of APIs\n\n\nEach directory entry contains an API **name** /**version** pair with the\nfollowing information:\n\n- **Identification and description information,**: name, version, title, and description.\n- **Documentation information**: icons and a documentation link.\n- **Status information**, including status labels, and an indication as to whether or not this is the preferred version of the API.\n- **Discovery document link** , the URI of the discovery document for this API (given as a full URL---for example, `https://serviceusage.googleapis.com/$discovery/rest?version=v1`).\n\n#### Discovery Document resource: A machine-readable description of a particular API\n\n\nIn addition to the information provided in the APIs Directory, a Discovery document also\nincludes:\n\n- **Schemas** , which is a list of API resource schemas that describe the data you have access to in each API; the Google APIs Discovery Service schemas are based on [JSON Schema](https://json-schema.org/).\n- **Methods**, including a list of API methods and available parameters for each method.\n- **OAuth scopes**, which identifies the list of OAuth scopes available for this API.\n- **Inline documentation**, which provides brief descriptions of schemas, methods, parameters and available parameter values.\n\n\nThe single Directory Collection is the conceptual container of the single APIs Directory\nresource, and the Discovery Document resources for each supported API.\n\n### Operations\n\n\nYou can invoke two different methods on collections and resources in the Google APIs Discovery Service, as\ndescribed in the following table.\n\n| Operation | Description | REST HTTP mappings |\n|-----------|---------------------------|--------------------------------------|\n| list | Lists all supported APIs. | `GET` on the Directory resource URI. |\n\nCalling style\n-------------\n\n| **Note:** Public APIs *do not* need authentication. Private APIs require an [API key](https://cloud.google.com/docs/authentication/api-keys).\n\n### REST\n\n\nThe supported Google APIs Discovery Service operations map directly to the [REST](https://en.wikipedia.org/wiki/Representational_State_Transfer) HTTP\n`GET` verb, as described in [Operations](#background-operations).\n\nThe specific format for Google APIs Discovery Service URIs are: \n\n```\nhttps://API/$discovery/rest?version=VERSION\n```\n\n\nwhere \u003cvar translate=\"no\"\u003eAPI\u003c/var\u003e is the identifier for a Discovery Document resource, and\n\u003cvar translate=\"no\"\u003eVERSION\u003c/var\u003e is the identifier of the particular version of the API.\n\nHere are a couple of examples of how this works in the Google APIs Discovery Service.\n\nList all the Google APIs Discovery Service supported APIs: \n\n```\nGET https://discovery.googleapis.com/discovery/v1/apis\n```\n\n\n[Try it now in APIs Explorer!](//developers.google.com/apis-explorer/#p/discovery/v1/discovery.apis.list)\n\nGet the Discovery document for Service Usage API, version 1: \n\n```\nGET https://serviceusage.googleapis.com/$discovery/rest?version=v1\n```"]]