সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
আমরা কেনাকাটার জন্য সামগ্রী API সেট আপ করতে Google API ক্লায়েন্ট লাইব্রেরি ব্যবহার করার পরামর্শ দিই। এই নির্দেশিকাটি উদাহরণ হিসেবে পাইথন কন্টেন্ট এপিআই ক্লায়েন্ট লাইব্রেরি ব্যবহার করে, কিন্তু সেগুলি অনেক জনপ্রিয় প্রোগ্রামিং ভাষার জন্য উপলব্ধ এবং সাধারণ API কার্যগুলি যেমন প্রমাণীকরণ, অনুরোধ পাঠানো এবং প্রতিক্রিয়া পার্স করার মতো সহজ করে। অন্যান্য ভাষার জন্য ক্লায়েন্ট লাইব্রেরি সেট আপ করতে সাহায্যের জন্য, GitHub-এ googleads/googleads-shopping-samples repo-এর মধ্যে ভাষার জন্য README.md দেখুন।
পাইথনের জন্য Google API ক্লায়েন্ট লাইব্রেরি সেট আপ করতে, নিম্নলিখিত পদক্ষেপগুলি সম্পূর্ণ করুন:
ক্লায়েন্ট লাইব্রেরির কনফিগারেশন এবং প্রমাণীকরণ ফাইলগুলির জন্য একটি ডিরেক্টরি তৈরি করুন। আপনার হোম ডিরেক্টরির মধ্যে, নিম্নলিখিত ডিরেক্টরিগুলি তৈরি করুন:
~/শপিং-নমুনা/সামগ্রী/
আপনার পরিষেবা অ্যাকাউন্টের শংসাপত্রগুলি ডাউনলোড করতে, নিম্নলিখিত পদক্ষেপগুলি সম্পূর্ণ করুন:
পৃষ্ঠার শীর্ষে মেনুতে একটি প্রকল্প নির্বাচন করুন। আপনার যদি এখনও একটি না থাকে, নতুন প্রকল্পে ক্লিক করে একটি তৈরি করুন৷
আপনি যদি ইতিমধ্যে এই প্রকল্পের জন্য কেনাকাটার জন্য সামগ্রী API সক্ষম না করে থাকেন, তাহলে Google API-এর তালিকায় এটি অনুসন্ধান করুন এবং এটি সক্ষম করুন৷
বাম দিকে সাইডবারে, শংসাপত্র নির্বাচন করুন। এটি দেখতে আপনাকে উপরের বাম দিকে বাম-পয়েন্টিং তীরটিতে ক্লিক করতে হতে পারে।
একটি পরিষেবা অ্যাকাউন্ট সেট আপ করতে, শংসাপত্র তৈরি করুন এবং তারপরে পরিষেবা অ্যাকাউন্ট নির্বাচন করুন।
নতুন পরিষেবা অ্যাকাউন্টের নাম দিন। এটি পরিষেবা অ্যাকাউন্ট আইডির জন্য ডিফল্ট ব্যবহারকারীর নাম হিসাবেও কাজ করে। পরে ব্যবহারের জন্য '@' অক্ষরের পরে অংশ সহ পরিষেবা অ্যাকাউন্ট আইডি রেকর্ড করুন। তৈরি করুন ক্লিক করুন, তারপরে প্রকল্প এবং ব্যবহারকারীদের অ্যাক্সেস দেওয়ার ঐচ্ছিক পদক্ষেপগুলি দিয়ে যান এবং সম্পন্ন ক্লিক করুন।
আপনাকে পরিষেবা অ্যাকাউন্ট পৃষ্ঠায় নির্দেশিত করা হবে যেখানে আপনার নতুন পরিষেবা অ্যাকাউন্ট অ্যাক্সেস করা যেতে পারে।
একটি JSON ব্যক্তিগত কী পেতে, পরিষেবা অ্যাকাউন্টে ক্লিক করুন, তারপর কী ট্যাবে। কী যোগ করুন > নতুন কী তৈরি করুন ক্লিক করুন, এবং তারপর কী প্রকার হিসাবে JSON নির্বাচন করুন। আপনার কম্পিউটারে ব্যক্তিগত কী ডাউনলোড করতে তৈরি করুন ক্লিক করুন। নতুন কী স্বয়ংক্রিয়ভাবে ডাউনলোড হয়।
ডাউনলোড করা শংসাপত্র ফাইলের নাম পরিবর্তন করে service-account.json করুন।
service-account.json ফাইলটি আপনার home directory /shopping-samples/content/ এ সরান।
আপনার home directory /shopping-samples/content/ এ , একটি খালি merchant-info.json ফাইল তৈরি করুন।
merchant-info.json এ, নিম্নলিখিত পাঠ্য যোগ করুন:
{"merchantId":yourMerchantCentermerchantID,"accountSampleUser":"the email address associated with your Merchant Center account"}
আপনার Merchant Center অ্যাকাউন্টে ব্যবহারকারী হিসাবে নতুন পরিষেবা অ্যাকাউন্ট যোগ করুন। আপনি যদি তৃতীয় পক্ষের বিকাশকারী হন, তাহলে আপনার ক্লায়েন্টকে আপনার জন্য এই পদক্ষেপটি করতে হবে।
আপনার Merchant Center অ্যাকাউন্টের সেটিংসে, মানুষ নির্বাচন করুন এবং অ্যাক্সেস করুন ।
ক্লিক করুন + ব্যক্তি যোগ করুন এবং নতুন ব্যবহারকারীর জন্য ইমেল ঠিকানা হিসাবে পরিষেবা অ্যাকাউন্ট আইডি ব্যবহার করুন।
Accounts পরিষেবা ব্যবহারের জন্য অ্যাডমিন অ্যাক্সেসের প্রয়োজন, তাই অ্যাডমিন নির্বাচন করুন।
পছন্দগুলি সংরক্ষণ করতে এবং ব্যবহারকারীদের তালিকায় ফিরে যেতে ব্যবহারকারী যুক্ত করুন ক্লিক করুন৷ পরিষেবা অ্যাকাউন্ট আইডি নির্বাচিত ব্যবহারকারীর ভূমিকার সাথে তালিকাভুক্ত করা হয়েছে৷
আপনি যোগ করতে চান অন্য সমস্ত পরিষেবা অ্যাকাউন্টগুলির জন্য প্রক্রিয়াটি পুনরাবৃত্তি করুন৷
আপনার কম্পিউটারের যেকোনো স্থানে googleads/googleads-shopping-samples GitHub রেপো ক্লোন করুন (বা ডাউনলোড করুন এবং আনজিপ করুন); এটি আপনার হোম ডিরেক্টরিতে বা ~/shopping-samples/content/- এ থাকতে হবে না।
আপনি যদি রেপোটি ডাউনলোড করে আনজিপ করেন তবে এটি ক্লোন করার পরিবর্তে আনজিপ করা ডিরেক্টরিটির নাম পরিবর্তন করে googleads-shopping-samples করুন।
প্রয়োজনীয় নমুনা নির্ভরতা ইনস্টল করতে, একটি টার্মিনাল উইন্ডোতে, googleads-shopping-samples/python/ এ নেভিগেট করুন এবং চালান:
pip install -r requirements.txt
আপনার কাছে এখন পাইথনের জন্য Google API ক্লায়েন্ট লাইব্রেরি কনফিগার করা আছে এবং Content API-এর সাথে ব্যবহারের জন্য প্রস্তুত। পরবর্তী বিভাগে, আপনি একটি নতুন পণ্য সন্নিবেশ করার জন্য একটি অনুরোধ তৈরি করবেন এবং পাঠাবেন।
[null,null,["2025-08-13 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Merchant API is the new version of the Content API for Shopping and represents the future of product data integration.\u003c/p\u003e\n"],["\u003cp\u003eTo use the Merchant API, you need to set up the Google API client libraries, which are available for various programming languages and simplify API interactions.\u003c/p\u003e\n"],["\u003cp\u003eSetup involves creating necessary directories, downloading service account credentials, configuring a \u003ccode\u003emerchant-info.json\u003c/code\u003e file, and adding the service account to your Merchant Center account.\u003c/p\u003e\n"],["\u003cp\u003eYou'll need to clone the \u003ccode\u003egoogleads/googleads-shopping-samples\u003c/code\u003e GitHub repo and install the required dependencies using \u003ccode\u003epip install -r requirements.txt\u003c/code\u003e.\u003c/p\u003e\n"]]],["The content details the setup for using the Google API client library with the new Merchant API beta, an evolution of the Content API for Shopping. Key steps include: creating directories for configuration and authentication files; downloading service account credentials (including generating a JSON private key); setting up `merchant-info.json` with Merchant Center ID and email; adding the service account as a Merchant Center user with Admin access; cloning or downloading the `googleads-shopping-samples` repository; and installing required Python dependencies via `pip`.\n"],null,["# Set up a client library\n\nWe recommend using the\n[Google API client libraries](/api-client-library) to set\nup the Content API for Shopping. This guide uses the Python Content API client\nlibraries as an example, but they're available for many popular programming\nlanguages and simplify common API tasks like authentication, sending requests,\nand parsing responses. For help setting up client libraries for\nother languages, see the **README.md** for the language within the\n[googleads/googleads-shopping-samples](//github.com/googleads/googleads-shopping-samples)\nrepo on GitHub.\n| **Note:** You need to install several required libraries to use the sample code in Python. For this reason, we recommend creating a Python virtual environment before you proceed. For more information, see [Installing packages using pip and virtual environments](//packaging.python.org/guides/installing-using-pip-and-virtual-environments/).\n\nTo set up the Google API client library for Python, complete the following steps:\n\n1. Create a directory for the client library's configuration and authentication\n files. Within your home directory, create the following directories:\n\n **\\~/shopping-samples/content/**\n | **Note:** This path, as well as the filename for the **merchant-info.json** file created in step 5, are defined in the **python/shopping/content/common.py** file within the Content API samples directory downloaded in step 7.\n2. To download your service account credentials, complete the following steps:\n\n 1. Go to the [Google API library](//console.cloud.google.com/apis/library).\n 2. Select a project in the menu at the top of the page. If you don't have one yet, create one by clicking **New project**.\n 3. If you haven't already enabled the Content API for Shopping for this project, then search for it in the list of Google APIs and enable it.\n 4. In the sidebar on the left, select **Credentials**. You may need to click the left-pointing arrow at the top left to see this.\n 5. To set up a service account, select **Create credentials** , and then **Service account**.\n 6. Name the new service account. This also serves as the default username for the service account ID. Record the service account ID, including the part after the '@' character, for later use. Click **Create** , then go through the optional steps of granting access to project and users, and click **Done**.\n 7. You will be directed to the Service Accounts page where your new service account can be accessed.\n3. To obtain a JSON private key, click the service account, then the **Keys**\n tab. Click **Add key** \\\u003e **Create new key** , and then select JSON as the\n key type. Click **Create** to download the private key to your computer.\n The new key downloads automatically.\n\n4. Rename the downloaded credentials file to **service-account.json**.\n\n | **Note:** This filename is defined in the **_constants.py** file, which is located in **python/shopping/content/** within the Content API samples directory downloaded in step 7.\n5. Move the **service-account.json** file to your\n **\u003cvar translate=\"no\"\u003ehome directory\u003c/var\u003e/shopping-samples/content/**.\n\n6. In your **\u003cvar translate=\"no\"\u003ehome directory\u003c/var\u003e/shopping-samples/content/** , create an\n empty **merchant-info.json** file.\n\n7. In **merchant-info.json**, add the following text:\n\n {\n \"merchantId\": \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-err\"\u003eyour\u003c/span\u003e\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003e\u003cspan class=\"devsite-syntax-err\"\u003eMercha\u003c/span\u003e\u003cspan class=\"devsite-syntax-kc\"\u003ent\u003c/span\u003e\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003e\u003cspan class=\"devsite-syntax-err\"\u003eCe\u003c/span\u003e\u003cspan class=\"devsite-syntax-kc\"\u003enter\u003c/span\u003e\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003e\u003cspan class=\"devsite-syntax-err\"\u003emercha\u003c/span\u003e\u003cspan class=\"devsite-syntax-kc\"\u003ent\u003c/span\u003e\u003cspan class=\"devsite-syntax-w\"\u003e \u003c/span\u003e\u003cspan class=\"devsite-syntax-err\"\u003eID\u003c/span\u003e\u003c/var\u003e,\n \"accountSampleUser\": \"\u003cvar translate=\"no\"\u003ethe email address associated with your Merchant Center account\u003c/var\u003e\"\n }\n\n8. Add the new service account as a user to your Merchant Center account. If you\n are a third-party developer, you will need to have your client do this step\n for you.\n\n 1. Go to your [Merchant Center account](//merchants.google.com).\n 2. In the settings of your Merchant Center account, select **People and\n access**.\n 3. Click **+ Add person** and use the service account ID as the email address\n for the new user.\n\n | **Note:** If you did not take note of the service account ID earlier, go to the [Service Accounts administration\n | page](//console.developers.google.com/iam-admin/serviceaccounts) and select the project you created.\n 4. The use of the `Accounts` service requires Admin access, so select\n **Admin**.\n\n 5. Click **Add user** to save preferences and be returned to the list of\n users. The service account ID is listed with the chosen user role.\n\n 6. Repeat the process for all other service accounts you want to add.\n\n9. Clone (or download and unzip) the\n [googleads/googleads-shopping-samples](//github.com/googleads/googleads-shopping-samples)\n GitHub repo to any location on your computer; it does not have to be in your\n home directory or in **\\~/shopping-samples/content/**.\n\n10. If you downloaded and unzipped the repo, instead of cloning it, rename the\n unzipped directory to **googleads-shopping-samples**.\n\n11. To install the required sample dependencies, in a terminal window,\n navigate to **googleads-shopping-samples/python/** and run:\n\n pip install -r requirements.txt\n\nYou now have the Google API client library for Python configured and ready to use with the Content API. In the next section, you'll create and send a request to insert a new product."]]