एपीआई कुंजियां
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस दस्तावेज़ में एपीआई कुंजियों के बारे में जानकारी दी गई है. साथ ही, यह भी बताया गया है कि एपीआई कुंजियों का इस्तेमाल कब किया जाए, उन्हें कैसे हासिल किया जाए, और .NET के लिए Google API क्लाइंट लाइब्रेरी के साथ कैसे इस्तेमाल किया जाए.
शुरुआती जानकारी
उपयोगकर्ता का निजी डेटा ऐक्सेस न करने वाले एपीआई को कॉल करते समय,
एक आसान एपीआई पासकोड का इस्तेमाल किया जा सकता है.
इस कुंजी का इस्तेमाल, अकाउंटिंग के मकसद से आपके ऐप्लिकेशन की पुष्टि करने के लिए किया जाता है.
आप कंसोल दस्तावेज़ में एपीआई कुंजियों के बारे में ज़्यादा जानकारी पढ़ सकते हैं.
ध्यान दें:
अगर आपको उपयोगकर्ता का निजी डेटा ऐक्सेस करना है, तो आपको
OAuth 2.0 का इस्तेमाल करना होगा.
एपीआई कुंजियों का इस्तेमाल करना
एपीआई पासकोड का इस्तेमाल करने के लिए, उसे
BaseClientService.Startizer APIKey
प्रॉपर्टी को पास करें. 'शुरू करें' पेज पर दिए गए
आसान एपीआई का उदाहरण
इसमें, एपीआई कुंजियों का इस्तेमाल करने का पूरा उदाहरण दिया गया है.
APIKey
प्रॉपर्टी सेट करके, आप यह पक्का करते हैं कि सेवा को किए जाने वाले हर कॉल में एपीआई पासकोड शामिल हो.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-31 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eAPI keys are used for authenticating applications when accessing public data, not private user data.\u003c/p\u003e\n"],["\u003cp\u003eYou can create and manage API keys through the Credentials page in the Google API Console.\u003c/p\u003e\n"],["\u003cp\u003eTo use an API key with the Google API Client Library for .NET, set the \u003ccode\u003eAPIKey\u003c/code\u003e property within the \u003ccode\u003eBaseClientService.Initializer\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSecurely store and manage your API keys by adhering to Google's best practices.\u003c/p\u003e\n"]]],[],null,["This document describes API Keys, when to use them, how to acquire them,\nand how to use them with the Google API Client Library for .NET.\n\nIntroduction\n\n\nWhen calling an API that does not access private user data,\nyou can use a simple API key.\nThis key is used to authenticate your application for accounting purposes.\nYou can read more on [API keys](/console/help/using-keys) in the Console documentation.\n\n\n**Note** :\nIf you *do* need to access private user data, you must use\n[OAuth 2.0](/api-client-library/dotnet/guide/aaa_oauth).\n\nAcquiring API keys\n\n1. Open the [Credentials page](https://console.cloud.google.com/apis/credentials) in the API Console.\n2. Click **Create credentials \\\u003e API key** and select the appropriate key type.\n\nTo keep your API keys secure, follow the [best practices for\nsecurely using API keys](//cloud.google.com/docs/authentication/api-keys).\n\nUsing API keys\n\n\nTo use an API key, pass it to the\n[BaseClientService.Initializer `APIKey`](https://googleapis.dev/dotnet/Google.Apis/latest/api/Google.Apis.Services.BaseClientService.Initializer.html)\nproperty. The\n[Simple API Example](/api-client-library/dotnet/get_started#simple)\non the Get Started page provides a complete example that uses API keys.\n\n\nBy setting the `APIKey` property, you ensure that every call you make\nto the service will include the API key."]]