विज्ञापन स्रोत
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
AdMob API की मदद से, मीडिएशन विज्ञापन सोर्स देखे जा सकते हैं
प्रोग्रामेटिक रूप से. यहां जाएं:
accounts.adSources.list
पर जाएं.
Curl का इस्तेमाल करके अनुरोध करें
क्लाइंट सीक्रेट फ़ाइल लोड करें और अनुमति देने वाला जनरेट करें
क्रेडेंशियल डालें.
पहली बार इस चरण को पूरा करने पर आपसे
अनुमति देने का अनुरोध दिखेगा. स्वीकार करने से पहले, पक्का करें कि आपने
आपने किसी ऐसे Google खाते से साइन इन किया हो जिसके पास AdMob API का ऐक्सेस हो. आपका
ऐप्लिकेशन को उस खाते की ओर से डेटा ऐक्सेस करने की अनुमति होगी जो
अभी साइन इन किया हुआ है.
हमारा सुझाव है कि पुष्टि करने और अनुमति देने के लिए,
oauth2l, एक आसान कमांड-लाइन टूल है
Google OAuth 2.0 के साथ काम करता है. oauth2l इंस्टॉल करें और
निर्देश नीचे दिया गया है, path_to_credentials_json को पाथ से बदला जा रहा है
को credentials.json
फ़ाइल में डाउनलोड करें जिसे आप अपनी
क्लाउड ऐप्लिकेशन पर चलता है. पहली बार चलाने के लिए, आदेश आपको
OAuth 2.0 के ऑथराइज़ेशन फ़्लो की सेटिंग. बाद में चलने वाले चरण, टोकन को रीफ़्रेश करते हैं
स्वचालित रूप से.
oauth2l header --json path_to_credentials_json --scope admob.readonly
विज्ञापन स्रोतों की सूची बनाएं.
pub-XXXXXXXXXXXXXXXX को बदलकर, AdMob के विज्ञापन स्रोत की जानकारी पाएं
अपने पब्लिशर आईडी से जुड़ी ज़रूरी जानकारी दें. ज़्यादा जानकारी के लिए,
डेटा ढूंढने का तरीका जानने के लिए निर्देश
आपका पब्लिशर आईडी.
curl --http1.0 -X GET https://admob.googleapis.com/v1beta/accounts/pub-XXXXXXXXXXXXXXXX/adSources \
-H "$(oauth2l header --json path_to_credentials_json --scope admob.readonly)"
रिस्पॉन्स का उदाहरण:
{
"adSources": [
{
"name": "accounts/pub-XXXXXXXXXXXXXXXX/adSources/5450213213286189855",
"adSourceId": "5450213213286189855",
"title": "AdMob Network",
}
]
}
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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\u003eThe AdMob API allows programmatic access to view mediation ad sources.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication and authorization are handled using OAuth 2.0, preferably through the \u003ccode\u003eoauth2l\u003c/code\u003e tool.\u003c/p\u003e\n"],["\u003cp\u003eTo list ad sources, a request using \u003ccode\u003ecurl\u003c/code\u003e is made to the AdMob API endpoint, including your publisher ID and authorization credentials.\u003c/p\u003e\n"]]],[],null,["# Ad Sources\n\nThe AdMob API lets you view [mediation ad sources](/admob/api/v1/ad-sources-reference)\nprogrammatically. See\n[`accounts.adSources.list`](/admob/api/reference/rest/v1beta/accounts.adSources/list)\nfor additional information. \n\n### Request using Curl\n\n1. Load the [client secrets file](https://console.cloud.google.com/apis/credentials) and generate authorization\n credentials.\n\n The first time you perform this step you'll be asked to accept an\n authorization prompt in your browser. Before accepting, make sure you're\n signed in with a Google Account that has access to the AdMob API. Your\n app will be authorized to access data on behalf of whichever account is\n currently signed in.\n\n For authentication and authorization, we recommend using\n [oauth2l](//github.com/google/oauth2l), a simple command-line tool for\n working with Google OAuth 2.0. Install oauth2l and run the\n command below, replacing \u003cvar translate=\"no\"\u003epath_to_credentials_json\u003c/var\u003e with a path\n to a `credentials.json` file that you download when registering your\n cloud application. For the first run, the command walks you through the\n OAuth 2.0 authorization flow. Subsequent runs refresh the token\n automatically. \n\n ```\n oauth2l header --json path_to_credentials_json --scope admob.readonly\n ```\n2. List ad sources.\n\n Get AdMob ad source information by replacing \u003cvar translate=\"no\"\u003epub-XXXXXXXXXXXXXXXX\u003c/var\u003e\n with your publisher ID. See the\n [instructions](//support.google.com/admob/answer/2784578) on how to find\n your publisher ID. \n\n ```\n curl --http1.0 -X GET https://admob.googleapis.com/v1beta/accounts/pub-XXXXXXXXXXXXXXXX/adSources \\\n -H \"$(oauth2l header --json path_to_credentials_json --scope admob.readonly)\"\n ```\n\n Sample response: \n\n ```text\n {\n \"adSources\": [\n {\n \"name\": \"accounts/pub-XXXXXXXXXXXXXXXX/adSources/5450213213286189855\",\n \"adSourceId\": \"5450213213286189855\",\n \"title\": \"AdMob Network\",\n }\n ]\n }\n ```"]]