با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Discovery API فهرستی از APIهای Google را برای بازیابی فراداده «سند کشف» قابل خواندن توسط ماشین برای هر API ارائه میکند.
این سند برای توسعه دهندگانی در نظر گرفته شده است که می خواهند کتابخانه های مشتری، افزونه های IDE و ابزارهای دیگر برای تعامل با Google API بنویسند.
پس زمینه خدمات کشف
مفاهیم
Google APIs Discovery Service بر اساس دو مفهوم اساسی ساخته شده است:
فهرست APIs : فهرستی از تمام APIهایی که توسط سرویس کشف APIs پشتیبانی می شوند. هر ورودی دایرکتوری جزئیات مربوط به یک API پشتیبانی شده را نشان می دهد، از جمله نام آن، شرح مختصری از کاری که انجام می دهد، و پیوند مستندسازی . یک API می تواند چندین ورودی دایرکتوری داشته باشد، یکی برای هر یک از نسخه های پشتیبانی شده آن.
سند کشف : توصیف قابل خواندن توسط ماشین از یک API خاص. سند Discovery سطح یک نسخه خاص از یک API را توصیف می کند. این سند جزئیاتی در مورد نحوه دسترسی به روش های مختلف هر API از طریق تماس های HTTP RESTful ارائه می دهد. یک سند Discovery شامل توضیحاتی از دادهها و روشهای مرتبط با API، و همچنین اطلاعاتی درباره دامنههای OAuth موجود، و توضیحات طرحوارهها، روشها، پارامترها و مقادیر پارامترهای موجود است.
مدل داده
یک منبع یک موجودیت داده منفرد با یک شناسه منحصر به فرد است. Google APIs Discovery Service بر اساس مفاهیم فوق بر روی دو نوع منبع عمل می کند.
فهرست دایرکتوری APIs: لیستی از APIها
هر ورودی دایرکتوری شامل یک جفت نام / نسخه API با اطلاعات زیر است:
اطلاعات شناسایی و توضیحات، : نام، نسخه، عنوان و توضیحات.
اطلاعات مستندات : نمادها و پیوند اسناد.
اطلاعات وضعیت ، از جمله برچسبهای وضعیت، و نشانهای مبنی بر اینکه آیا این نسخه ترجیحی API است یا خیر.
پیوند سند کشف ، URI سند اکتشاف برای این API (بهعنوان یک URL کامل ارائه میشود—مثلاً https://serviceusage.googleapis.com/$discovery/rest?version=v1 ).
منبع سند کشف: توصیف قابل خواندن توسط ماشین از یک API خاص
علاوه بر اطلاعات ارائه شده در فهرست APIs، یک سند Discovery نیز شامل موارد زیر است:
طرحواره ها ، که فهرستی از طرحواره های منبع API است که داده هایی را که در هر API به آنها دسترسی دارید، توصیف می کند. طرحوارههای سرویس کشف APIs Google بر اساس طرحواره JSON هستند.
روشها ، از جمله فهرستی از روشهای API و پارامترهای موجود برای هر روش.
دامنه های OAuth ، که لیستی از محدوده های OAuth موجود برای این API را مشخص می کند.
مستندات درون خطی ، که توضیحات مختصری از طرحواره ها، روش ها، پارامترها و مقادیر پارامترهای موجود ارائه می دهد.
مجموعه دایرکتوری منفرد محفظه مفهومی منبع واحد APIs Directory و منابع سند کشف برای هر API پشتیبانی شده است.
عملیات
همانطور که در جدول زیر توضیح داده شده است، میتوانید دو روش مختلف را در مجموعهها و منابع موجود در Google APIs Discovery Service فراخوانی کنید.
عملیات
توضیحات
REST نگاشت HTTP
فهرست
همه API های پشتیبانی شده را فهرست می کند.
URI منبع دایرکتوری را GET .
سبک تماس
استراحت
عملیات سرویس اکتشاف Google APIs پشتیبانی شده مستقیماً به فعل REST HTTP GET ، همانطور که در عملیات توضیح داده شده است، نگاشت.
فرمت خاص برای URI های سرویس اکتشاف Google APIs عبارتند از:
https://API/$discovery/rest?version=VERSION
که در آن API شناسه منبع سند کشف است و VERSION شناسه نسخه خاص API است.
در اینجا چند نمونه از نحوه عملکرد این کار در Google APIs Discovery Service آورده شده است.
فهرست همه APIهای Google APIs Discovery Service پشتیبانی شده API:
GET https://discovery.googleapis.com/discovery/v1/apis
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\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```"]]