หากต้องการพูดคุยและแสดงความคิดเห็นเกี่ยวกับผลิตภัณฑ์ของเรา โปรดเข้าร่วมช่อง Discord อย่างเป็นทางการของ Google Ads ในเซิร์ฟเวอร์ชุมชนการโฆษณาและการวัดผลของ Google
สำหรับ Dependencies (โดยเฉพาะอย่างยิ่งแพ็กเกจที่ Google ดูแลรักษาซึ่งระบุว่าจำเป็น โดยไลบรารีของไคลเอ็นต์ Python) เราจะรักษาความเข้ากันได้กับแพ็กเกจที่ Google ดูแลรักษาและถือว่าเป็น "รองรับ" ตามนโยบายการเปลี่ยนแปลงที่ทำให้ใช้งานไม่ได้ของ OSS ของ Google
เมื่อรวมโทเค็น OAuth2 เข้ากับการกำหนดค่าแล้ว คุณก็พร้อมที่จะส่งคำขอ API ดูตัวอย่าง get campaigns เพื่อดูวิธีง่ายๆ ในการทดสอบว่ากำหนดค่าไลบรารีอย่างถูกต้องเพื่อส่งคำขอ API หรือไม่
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-08-26 UTC"],[[["\u003cp\u003eThe Google Ads Python client library requires Python 3.8 or later and is compatible with supported Python runtimes, with new runtime support added by the end of the quarter following a new runtime's release.\u003c/p\u003e\n"],["\u003cp\u003eYou need a developer token and client customer ID before installation, and OAuth2 tokens are generated during the authentication process.\u003c/p\u003e\n"],["\u003cp\u003eConfiguration options are provided, along with guidance on OAuth flows for desktop/web and service accounts to authenticate API requests.\u003c/p\u003e\n"],["\u003cp\u003eA sample \u003ccode\u003eget_campaigns.py\u003c/code\u003e script helps test API request functionality, and resources on logging, field masks, and other library features are available.\u003c/p\u003e\n"],["\u003cp\u003eThe library is hosted on GitHub and available on PyPI for installation.\u003c/p\u003e\n"]]],[],null,["# Overview\n\nThe Python client library is hosted [on GitHub](https://github.com/googleads/google-ads-python),\nand the package is available on [PyPI](//pypi.org/project/google-ads/).\n\n### Requirements\n\nThe library requires Python 3.8 or later.\n\n### Prerequisites\n\nBefore installing the library, you will need a developer token and\nclient customer ID. Instructions on how to obtain them are outlined in the\n[prerequisites](/google-ads/api/docs/get-started/introduction) section.\nNote that you will generate the other required OAuth2 tokens in later steps.\n\n### Runtime and dependency compatibility\n\nThe Python client library maintains compatibility with the Python runtimes in\nthe\n[Supported Versions](https://devguide.python.org/versions/#supported-versions)\nsection published by the\n[Python Software Foundation](https://www.python.org/psf-landing/), except for\nversions with a status of \"feature\" or \"prerelease\".\n\nWhen adopting new versions of the Python runtime, we aim to release a new\nversion of the Python client library that is compatible with the latest runtime\nby the end of the quarter following its release. For example, if a new runtime\nis released in October, a compatible version of the Python client library will\nbe available by the end of March in the following year.\n\nPython runtimes that have reached End of Life (EOL) are not supported past the\nEnd of Life date in the\n[Unsupported Versions](https://www.python.org/psf-landing/) section of\n[python.org](https://www.python.org/).\n\nWe may release a version of the Python client library that is incompatible with\nunsupported Python runtimes at any point after they reach EOL.\n\nFor dependencies, (specifically, any Google-maintained packages that are\n[listed as required](//github.com/googleads/google-ads-python/blob/ef62b42152781ee6dc9081222dca49a758760544/setup.py#L18)\nby the Python client library), we will maintain compatibility with packages that\nare Google-maintained, and considered \"supported\" according to Google's\n[OSS Breaking Change Policy](https://opensource.google/documentation/policies/library-breaking-change).\n\nFor a complete list of supported Python runtimes and dependencies, see the\n[Dependencies](/google-ads/api/docs/client-libs/python/dependencies) page.\n\n### Installation\n\nFollow the instructions in our [installation](/google-ads/api/docs/client-libs/python/installation#install_the_module_from_pypi)\ndocumentation to install the library from PyPi and return to this page.\n\n### Configuration\n\nOnce you have installed the library you will need to set up a configuration for\nit. There are multiple ways to configure the library, which are described in our\n[configuration](/google-ads/api/docs/client-libs/python/configuration) documentation.\n\n### Authentication\n\nOnce you've chosen a configuration type you can proceed with generating the\nremaining OAuth2 tokens needed to make requests to the API. There are multiple\nsupported OAuth2 flows, which are documented in the list below. For details on\nthe differences between the flows and help deciding which is best for your\napplication, see our [OAuth](/google-ads/api/docs/oauth/overview) documentation.\n\n- [OAuth desktop and web application flows](/google-ads/api/docs/client-libs/python/oauth-web)\n- [OAuth service account flow](/google-ads/api/docs/client-libs/python/oauth-service)\n\n### Making an API request\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nOnce you've incorporated your OAuth2 tokens into your configuration, you're\nready to make an API request. Refer to the\n[get campaigns](/google-ads/api/samples/get-campaigns#python) example for\na simple way to test that the library is properly configured to make API\nrequests.\n\nTo run the `get_campaigns.py` sample, in the root directory of your locally\ninstalled `googleads-python` client library, run the following command: \n\n $ python examples/basic_operations/get_campaigns.py -c \\\n INSERT_YOUR_CUSTOMER_ID_HERE\n\n### Additional resources\n\nAfter you're able to make an API request, proceed to these uses of the client\nlibrary:\n\n- [Logging](/google-ads/api/docs/client-libs/python/logging)\n- [Field Masks](/google-ads/api/docs/client-libs/python/field-masks)\n- [Resource Names](/google-ads/api/docs/client-libs/python/resource-names)\n- [Proto Getters](/google-ads/api/docs/client-libs/python/proto-getters)\n- [Setting Empty Message Fields](/google-ads/api/docs/client-libs/python/empty-message-fields)"]]