google-ads-api-quickstart
Skill này làm gì
Skill này hướng dẫn bạn qua thông tin xác thực Google Ads API, chọn thư viện client hoặc REST trực tiếp, và chạy một script ngắn liệt kê các chiến dịch. Dành cho lập trình viên mới bắt đầu với Google Ads API.
Khi nào nên dùng
- ✓Khi bạn mới với Google Ads API và muốn một yêu cầu đầu tiên hoạt động.
- ✓Khi bạn cần chọn một thư viện client như Python, Java hoặc .NET.
- ✓Khi một lỗi thiết lập như từ chối quyền hoặc developer token chưa được duyệt làm bạn bị chặn.
Liên kết skill
https://github.com/google/skills/blob/main/skills/ads/google-ads-api-quickstart/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Chỉ tôi cách thiết lập Google Ads API bằng Python và lấy các chiến dịch của tôi bằng một script.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill trước tiên tra cứu phiên bản API ổn định hiện tại và phiên bản runtime, hướng dẫn qua thông tin xác thực, cấu hình môi trường và chạy một script lấy các chiến dịch của bạn.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Google Ads API Quickstart
This skill guides you from absolute zero to running your first successful request to retrieve campaigns.
Supported Tracks
You can choose to use this skill with:
- Official Client Libraries: Python, Java, .NET, PHP, Ruby, or Perl.
- Direct REST: Raw HTTP REST requests.
Crucial Requirement: Dynamic Version Resolution & Runtime Resolution
[!IMPORTANT] To ensure the integration is secure, stable, and up-to-date, you must resolve all API and runtime versions dynamically. Do not rely on hardcoded defaults.
Strict Constraints:
- DO NOT Hardcode: Never use hardcoded Google Ads API versions (e.g.,
v24) or language runtime versions (e.g.,Python 3.8+,Java 11+) in generated code or environment setup instructions, unless the user explicitly requests a specific version. - MANDATORY Dynamic Resolution: You must dynamically resolve the latest stable versions at the start of execution before generating any code or configuration, using the procedures detailed below.
A. Dynamic API Version Resolution
To ensure the integration is secure, stable, and up-to-date, you MUST resolve the absolute newest stable major version of the Google Ads API dynamically.
Execution Steps:
Pre-Flight Version Resolution: Use your web search or URL-reading tools to inspect the latest entry in the Google Ads API Release Notes or the highest versioned directory in the Googleapis Github Repository to resolve
RESOLVED_API_VERSION(e.g.,v24). If using Java, you MUST also resolve the latest stable release version of the Google Ads Java Client Library (referred to asRESOLVED_LIBRARY_VERSION, e.g.,34.0.0).Mandatory Response Anchor: You MUST output the following confirmation block as the very first line of your response to the user. Do not output any greeting, pleasantries, or introductory text before this block.
[SYSTEM: Using Google Ads API version: RESOLVED_API_VERSION (Resolved from release notes)]Strict Placeholder Mapping Table: You MUST perform on-the-fly search-and-replace on all code templates and reference files using the mapping table below. Do not leave raw placeholders in the final output.
Target Language / Tech Placeholder in Template Replacement Pattern Example (Assuming API v24)Java (Maven/Gradle) LATEST_LIBRARY_VERSIONSearch & substitute the latest Maven release version of the library. 34.0.0Java (Imports) vXXReplace with lower-case API version. com.google.ads.googleads.v24.NET / C# (Namespaces) VXXReplace with title-case API version. Google.Ads.GoogleAds.V24PHP (Namespaces) VXXReplace with title-case API version. Google\Ads\GoogleAds\V24REST (Endpoint URL) vXXReplace with lower-case API version. https://googleads.googleapis.com/v24/...
[!TIP] Offline Fallback: If the URLs are unreachable or the scrape fails, do not halt execution. Fall back to these last-known stable versions:
- Google Ads API Major Version (
RESOLVED_API_VERSION):v24- Java Client Library Version (
RESOLVED_LIBRARY_VERSION):34.0.0
B. Dynamic Language Runtime Version Resolution
To prevent the generated setup guides from becoming obsolete due to language deprecation cycles, you MUST resolve language requirements dynamically.
Execution Steps:
Fetch Live Requirements: Use your URL-reading tools to inspect the official Google Ads Client Libraries - Supported Versions page.
Extract Minimums: Identify the minimum supported runtime version for the user's chosen language by scanning the Overview page or compatibility tables (e.g., looking for explicit requirements like Python 3.8+, Java 11+, .NET 6.0+, PHP 8.1+, Ruby 3.0+).
Apply On-The-Fly: Substitute all runtime placeholders (e.g.,
<PYTHON_MIN_VERSION>) in your generated setup guides with these resolved versions.
[!TIP] Offline Fallback: If the URL is unreachable or the scrape fails, do not halt execution. Fall back to these last-known safe minimum
Câu hỏi thường gặp
Nó có hỗ trợ các ngôn ngữ khác ngoài Python không?
Có. Nó hỗ trợ Java, .NET, PHP, Ruby, Perl và các yêu cầu REST trực tiếp.
Nó có giúp với các lỗi quyền không?
Có. Nó khắc phục các lỗi như từ chối quyền và các vấn đề về login customer ID.
Nó có dùng số phiên bản cố định không?
Không. Nó được thiết kế để tra cứu phiên bản ổn định hiện tại thay thế.
Chi tiết
Mô tả gốc của tác giả
Guides developers through Google Ads API quickstart: credential setup, choosing from 6 client libraries/REST, configuring environments, and running a "retrieve campaigns" script. Troubleshoots common setup errors: USER_PERMISSION_DENIED, login_customer_id issues, and DEVELOPER_TOKEN_NOT_APPROVED. Use this skill when: - The user asks how to get started with the Google Ads API. - The user needs to set up Google Ads credentials or developer tokens. - The user wants to write a quickstart/example script for Google Ads. - The user encounters errors like USER_PERMISSION_DENIED or DEVELOPER_TOKEN_NOT_
repo: google/skills
Độ phổ biến
- Sao GitHub
- 22k
- Vị trí xếp hạng
- #10187
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
finding-google-skills
22kGiúp agent của bạn tìm hướng dẫn Google phù hợp cho việc thiết lập, như hosting, cơ sở dữ liệu, lưu trữ, đăng nhập hoặc phục vụ mô hình AI.
gcloud
22kGiúp agent của bạn viết và kiểm tra các lệnh gcloud của Google Cloud, tra cứu cú pháp chính xác trước khi chạy bất cứ thứ gì để không đoán các flag.
google-cloud-recipe-auth
22kHướng dẫn agent của bạn qua quản lý danh tính và quyền truy cập của Google Cloud, gồm cách con người và dịch vụ đăng nhập và những quyền họ nhận được.
google-cloud-recipe-onboarding
22kHướng dẫn một lập trình viên mới qua các bước đầu tiên trên Google Cloud, gồm chọn dự án, liên kết thanh toán và triển khai tài nguyên đầu tiên.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.