अडैप्टर
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
AdMob API की मदद से, मीडिएशन अडैप्टर की सूची को प्रोग्राम के हिसाब से बनाया जा सकता है. ज़्यादा जानकारी के लिए, accounts.adSources.adapters.list
देखें. अडैप्टर में, तीसरे पक्ष के अडैप्टर के कॉन्फ़िगरेशन की जानकारी शामिल होती है.
उदाहरण
OAuth 2.0 क्रेडेंशियल बनाने के बाद, AdMob API का इस्तेमाल शुरू किया जा सकता है. OAuth 2.0 का इस्तेमाल करके डेटा ऐक्सेस करने का अनुरोध करने के लिए, आपके ऐप्लिकेशन को अनुरोध के तरीके की जानकारी देनी होगी.
यहां OAuth 2.0 के स्कोप के बारे में जानकारी दी गई है:
दायरा |
मतलब |
https://www.googleapis.com/auth/admob.monetization |
AdMob से कमाई करने की सेटिंग देखें, बनाएं, और उनमें बदलाव करें.
|
https://www.googleapis.com/auth/admob.readonly |
AdMob का पूरा डेटा देखना. इसमें खाते की जानकारी, इन्वेंट्री और मीडिएशन सेटिंग, रिपोर्ट, और अन्य डेटा शामिल हो सकता है.
उस डेटा में, पैसे चुकाने या कैंपेन के ब्यौरे जैसी संवेदनशील जानकारी शामिल नहीं होती.
|
curl (कमांड-लाइन)
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 अडैप्टर की जानकारी पाएं. अपना पब्लिशर आईडी ढूंढने का तरीका जानें.
अपनी पसंद के अडैप्टर के लिए, SSSSSSSSSSSSSSSSSSSS की जगह विज्ञापन स्रोत आईडी डालें.
अडैप्टर की सूची पाने के लिए, इस निर्देश का इस्तेमाल करें:
curl --http1.0 -X GET https://admob.googleapis.com/v1beta/accounts/pub-XXXXXXXXXXXXXXXX/adSources/SSSSSSSSSSSSSSSSSSSS/adapters \
-H "$(oauth2l header --json path_to_credentials_json --scope admob.readonly)"
आईडी
5450213213286189855
वाले AdMob नेटवर्क विज्ञापन स्रोत के लिए, रिस्पॉन्स का सैंपल:
{
"adapters": [
{
"name": "accounts/pub-XXXXXXXXXXXXXXXX/adSources/5450213213286189855/adapters/1",
"adapterId": "1",
"title": "AdMob Network Android SDK",
"platform": "ANDROID",
"formats": ["BANNER", "INTERSTITIAL",
"REWARDED", "NATIVE", "REWARDED_INTERSTITIAL", "APP_OPEN"],
"adapterConfigMetadata": [{
"adapterConfigMetadataId": "118",
"adapterConfigMetadataLabel": "Ad unit ID"
}]
},
{
"name": "accounts/pub-XXXXXXXXXXXXXXXX/adSources/5450213213286189855/adapters/2",
"adapterId": "2",
"title": "AdMob Network iOS SDK",
"platform": "ANDROID",
"formats": ["BANNER", "INTERSTITIAL",
"REWARDED", "NATIVE", "REWARDED_INTERSTITIAL", "APP_OPEN"],
"adapterConfigMetadata": [{
"adapterConfigMetadataId": "119",
"adapterConfigMetadataLabel": "Ad unit ID"
}]
}]
}
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को 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 listing of mediation adapters, including details on third-party configurations.\u003c/p\u003e\n"],["\u003cp\u003eTo use the AdMob API, OAuth 2.0 credentials with appropriate scope information (\u003ccode\u003eadmob.monetization\u003c/code\u003e or \u003ccode\u003eadmob.readonly\u003c/code\u003e) are required.\u003c/p\u003e\n"],["\u003cp\u003eYou can utilize \u003ccode\u003ecurl\u003c/code\u003e with OAuth 2.0 authentication to retrieve a list of adapters for a specific AdMob ad source.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides details like adapter name, ID, platform, supported ad formats, and configuration metadata.\u003c/p\u003e\n"]]],["The AdMob API allows programmatic listing of mediation adapters, including third-party configurations. Access requires OAuth 2.0 credentials and specific scopes like `admob.monetization` or `admob.readonly`. To use it with curl, users must first load client secrets and generate authorization credentials, potentially via `oauth2l`. Listing adapters requires the publisher ID and ad source ID in the API request, and will return the adapter information that includes details such as ID, Title, platform, and formats.\n"],null,["# Adapters\n\nThe AdMob API has the ability to list\n[mediation adapters](/admob/api/v1/adapters-reference)\nprogrammatically, see\n[`accounts.adSources.adapters.list`](/admob/api/reference/rest/v1beta/accounts.adSources.adapters/list)\nfor additional information. Adapters include details on third-party adapter\nconfigurations.\n\nExamples\n--------\n\nWith [OAuth 2.0 credentials created](/admob/api/v1/getting-started#credentials),\nyou're ready to start using the AdMob API. To request access using OAuth 2.0,\nyour application will also need the scope information.\n\nHere's the OAuth 2.0 scope information:\n\n\u003cbr /\u003e\n\n| Scope | Meaning |\n|------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `https://www.googleapis.com/auth/admob.monetization` | See, create, and edit your AdMob monetization settings. |\n| `https://www.googleapis.com/auth/admob.readonly` | See all AdMob data. This may include account information, inventory and mediation settings, reports, and other data. This doesn't include sensitive data, such as payments or campaign details. |\n\n\u003cbr /\u003e\n\n### curl (command line)\n\n### Requests 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 the adapters.\n\n Get AdMob adapter information by replacing \u003cvar translate=\"no\"\u003epub-XXXXXXXXXXXXXXXX\u003c/var\u003e\n with your publisher ID, see\n [how to find your publisher ID](//support.google.com/admob/answer/2784578).\n\n Replace \u003cvar translate=\"no\"\u003eSSSSSSSSSSSSSSSSSSSS\u003c/var\u003e with the ad source ID for the\n adapters of interest.\n\n Use the following command to get a list of adapters: \n\n ```\n curl --http1.0 -X GET https://admob.googleapis.com/v1beta/accounts/pub-XXXXXXXXXXXXXXXX/adSources/SSSSSSSSSSSSSSSSSSSS/adapters \\\n -H \"$(oauth2l header --json path_to_credentials_json --scope admob.readonly)\"\n ```\n\n Sample response for the AdMob Network ad source with ID\n `5450213213286189855`: \n\n ```scdoc\n {\n \"adapters\": [\n {\n \"name\": \"accounts/pub-XXXXXXXXXXXXXXXX/adSources/5450213213286189855/adapters/1\",\n \"adapterId\": \"1\",\n \"title\": \"AdMob Network Android SDK\",\n \"platform\": \"ANDROID\",\n \"formats\": [\"BANNER\", \"INTERSTITIAL\",\n \"REWARDED\", \"NATIVE\", \"REWARDED_INTERSTITIAL\", \"APP_OPEN\"],\n \"adapterConfigMetadata\": [{\n \"adapterConfigMetadataId\": \"118\",\n \"adapterConfigMetadataLabel\": \"Ad unit ID\"\n }]\n },\n {\n \"name\": \"accounts/pub-XXXXXXXXXXXXXXXX/adSources/5450213213286189855/adapters/2\",\n \"adapterId\": \"2\",\n \"title\": \"AdMob Network iOS SDK\",\n \"platform\": \"ANDROID\",\n \"formats\": [\"BANNER\", \"INTERSTITIAL\",\n \"REWARDED\", \"NATIVE\", \"REWARDED_INTERSTITIAL\", \"APP_OPEN\"],\n \"adapterConfigMetadata\": [{\n \"adapterConfigMetadataId\": \"119\",\n \"adapterConfigMetadataLabel\": \"Ad unit ID\"\n }]\n }]\n }\n ```"]]