ไลบรารีของไคลเอ็นต์
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คุณมีตัวเลือกระหว่างไลบรารีของไคลเอ็นต์ต่างๆ มากมาย โปรดดูรายละเอียดเพิ่มเติมในคำอธิบายไลบรารีของไคลเอ็นต์
ไลบรารีของไคลเอ็นต์ Cloud
เราขอแนะนำให้ใช้ไลบรารีของไคลเอ็นต์ เนื่องจากมีการผสานรวมความปลอดภัยและภาษาที่ดียิ่งขึ้น รวมถึงรองรับการให้สิทธิ์ผู้ใช้ ไลบรารีของไคลเอ็นต์ CSS API ใช้ gRPC และออกแบบมาให้ทำงานร่วมกับตัวอย่างโค้ดในภาษาเดียวกัน
ต่อไปนี้คือไลบรารีของไคลเอ็นต์และตัวอย่างโค้ดล่าสุด
หากต้องการตั้งค่าไลบรารีของไคลเอ็นต์ ให้ดาวน์โหลดและเรียกใช้ตัวอย่างโค้ดรายการใดรายการหนึ่งของเรา
ไลบรารีของไคลเอ็นต์ Google API
คุณยังเข้าถึง CSS API ผ่านไลบรารีของไคลเอ็นต์ Google API ได้อีกด้วย
ซึ่งช่วยให้คุณเชื่อมต่อกับอินเทอร์เฟซ REST ได้โดยตรง
ข้อดีเหนือไลบรารีของไคลเอ็นต์ระบบคลาวด์
- รองรับภาษาเพิ่มเติม ได้แก่ Java, Python, PHP, .NET, JavaScript, Objective-C, Dart, Ruby, Node.js, Go
- รองรับการทำงานแบบกลุ่ม: ดูรายละเอียดในเอกสารประกอบเฉพาะไลบรารีของไคลเอ็นต์
(เช่น Python, Java) อย่างไรก็ตาม ไลบรารีของไคลเอ็นต์ระบบคลาวด์ส่วนใหญ่ใช้การเพิ่มประสิทธิภาพเฉพาะภาษา ซึ่งทำให้การทำงานแบบกลุ่มไม่จำเป็น (ตัวอย่างคำอธิบายเกี่ยวกับการทำงานคือ ปัญหา 675)
- มีอยู่ในไดเรกทอรีแพ็กเกจเริ่มต้นของภาษาโปรแกรมส่วนใหญ่
ข้อเสียของไลบรารีของไคลเอ็นต์ระบบคลาวด์
- ต้องจัดการการโทรและประเภทข้อมูลด้วยตนเอง
โค้ดตัวอย่าง
เรามีโค้ดตัวอย่างสำหรับไคลเอ็นต์ Google API ให้ใช้งาน
ไม่มีไลบรารีของไคลเอ็นต์
คุณยังเชื่อมต่อกับ CSS API โดยไม่ต้องมีไลบรารีของไคลเอ็นต์ได้โดยใช้ความสามารถของ HTTP ในภาษาโปรแกรมโดยตรง โปรดดูข้อมูลอ้างอิง REST API
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eThe Content API for Shopping provides client libraries for easier integration and enhanced security.\u003c/p\u003e\n"],["\u003cp\u003eCloud Client Libraries in Java, PHP, Go, Ruby, .NET, Python, and Node.js are available with corresponding code samples where applicable.\u003c/p\u003e\n"],["\u003cp\u003eGoogle API Client Libraries offer broader language support and batching capabilities but require manual call and data type management.\u003c/p\u003e\n"],["\u003cp\u003eDirect HTTP connection to the REST API is possible without a client library, offering maximum flexibility.\u003c/p\u003e\n"]]],[],null,["# Client libraries\n\nYou have the choice between multiple different client libraries. See also\n[Client libraries explained](https://cloud.google.com/apis/docs/client-libraries-explained)\nfor more details.\n\nCloud Client Libraries\n----------------------\n\nWe recommend using a client library, because they provide improved security and\nlanguage integration, and support user authorization. The CSS API client\nlibraries use gRPC and are designed to work with our [code\nsamples](/comparison-shopping-services/api/code-samples) in the same language.\n\nHere are our most recent client libraries and code samples:\n\n| Client libraries | Code samples |\n|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| [Java](https://central.sonatype.com/artifact/com.google.shopping/google-shopping-css) | [Java](//github.com/googleads/comparison-shopping-service-api-samples/tree/main/java) |\n| [PHP](https://packagist.org/packages/google/shopping-css) | |\n| [Go](https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/css/apiv1/) | |\n| [Ruby](https://rubygems.org/gems/google-shopping-css-v1/) | |\n| [.NET](https://www.nuget.org/packages/Google.Shopping.Css.V1/) | |\n| [Python](https://pypi.org/project/google-shopping-css/) | |\n| [Node.js](https://www.npmjs.com/package/@google-shopping/css) | |\n\nTo set up a client library, download and run one of our code samples.\n\nGoogle API Client Libraries\n---------------------------\n\nYou can also access the CSS API through the [Google API Client\nLibraries](https://developers.google.com/api-client-library/).\nThis lets you to connect to the\n[REST](/comparison-shopping-services/api/reference/rest) interface directly.\n\n### Advantages over the Cloud Client Libraries\n\n- Supports additional languages: Java, Python, PHP, .NET, JavaScript, Objective-C, Dart, Ruby, Node.js, Go\n- Supports batching: see the client library specific documentation for details (examples: [Python](https://github.com/googleapis/google-api-python-client/blob/main/docs/batch.md \"Batching in Python\"), [Java](https://googleapis.github.io/google-api-java-client/batching.html \"Batching in Java\")). That said, most of the Cloud Client libraries implement language specific optimizations that make batching unnecessary (example explanation for go is in [issue\n 675](https://github.com/googleapis/google-cloud-go/issues/675)).\n- Available in the default package directories of most programming languages.\n\n### Disadvantages over the Cloud Client Libraries\n\n- Need to manage calls and data types yourself\n\n### Sample Code\n\nWe have [Sample code for Google API\nclients](/comparison-shopping-services/api/code-samples/gapi) available.\n\nNo client library\n-----------------\n\nYou can also connect to the CSS API without any client library, using the HTTP\ncapabilities of your programming language directly. Refer to the\n[REST API](/comparison-shopping-services/api/reference/rest) reference."]]