skills$openclaw/google-ads
byungkyu5.7k

by byungkyu

google-ads – OpenClaw Skill

google-ads is an OpenClaw Skills integration for coding workflows. |

5.7k stars5.9k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namegoogle-ads
description| OpenClaw Skills integration.
ownerbyungkyu
repositorybyungkyu/google-ads-api
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @byungkyu/google-ads-api
last updatedFeb 7, 2026

Maintainer

byungkyu

byungkyu

Maintains google-ads in the OpenClaw Skills directory.

View GitHub profile
File Explorer
3 files
.
_meta.json
632 B
LICENSE.txt
1.0 KB
SKILL.md
6.6 KB
SKILL.md

Google Ads

Access the Google Ads API with managed OAuth authentication. Query campaigns, ad groups, keywords, and performance metrics using GAQL.

Quick Start

# List accessible customers
curl -s -X GET "https://gateway.maton.ai/google-ads/v23/customers:listAccessibleCustomers" -H "Authorization: Bearer $MATON_API_KEY"

Base URL

https://gateway.maton.ai/google-ads/{native-api-path}

Replace {native-api-path} with the actual Google Ads API endpoint path. The gateway proxies requests to googleads.googleapis.com and automatically injects OAuth and developer tokens.

Authentication

All requests require the Maton API key in the Authorization header:

Authorization: Bearer $MATON_API_KEY

Environment Variable: Set your API key as MATON_API_KEY:

export MATON_API_KEY="YOUR_API_KEY"

Getting Your API Key

  1. Sign in or create an account at maton.ai
  2. Go to maton.ai/settings
  3. Copy your API key

Connection Management

Manage your Google Ads OAuth connections at https://ctrl.maton.ai.

List Connections

curl -s -X GET "https://ctrl.maton.ai/connections?app=google-ads&status=ACTIVE" -H "Authorization: Bearer $MATON_API_KEY"

Create Connection

curl -s -X POST "https://ctrl.maton.ai/connections" -H "Content-Type: application/json" -H "Authorization: Bearer $MATON_API_KEY" -d '{"app": "google-ads"}'

Get Connection

curl -s -X GET "https://ctrl.maton.ai/connections/{connection_id}" -H "Authorization: Bearer $MATON_API_KEY"

Response:

{
  "connection": {
    "connection_id": "21fd90f9-5935-43cd-b6c8-bde9d915ca80",
    "status": "ACTIVE",
    "creation_time": "2025-12-08T07:20:53.488460Z",
    "last_updated_time": "2026-01-31T20:03:32.593153Z",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "google-ads",
    "metadata": {}
  }
}

Open the returned url in a browser to complete OAuth authorization.

Delete Connection

curl -s -X DELETE "https://ctrl.maton.ai/connections/{connection_id}" -H "Authorization: Bearer $MATON_API_KEY"

Specifying Connection

If you have multiple Google Ads connections, specify which one to use with the Maton-Connection header:

curl -s -X POST "https://gateway.maton.ai/google-ads/v23/customers/1234567890/googleAds:search" -H "Content-Type: application/json" -H "Authorization: Bearer $MATON_API_KEY" -H "Maton-Connection: 21fd90f9-5935-43cd-b6c8-bde9d915ca80" -d '{"query": "SELECT campaign.id, campaign.name FROM campaign"}'

If omitted, the gateway uses the default (oldest) active connection.

API Reference

List Accessible Customers

GET /google-ads/v23/customers:listAccessibleCustomers

Search (GAQL Query)

POST /google-ads/v23/customers/{customerId}/googleAds:search
Content-Type: application/json

{
  "query": "SELECT campaign.id, campaign.name, campaign.status FROM campaign ORDER BY campaign.id"
}

Search Stream (for large results)

POST /google-ads/v23/customers/{customerId}/googleAds:searchStream
Content-Type: application/json

{
  "query": "SELECT campaign.id, campaign.name FROM campaign"
}

Common GAQL Queries

List Campaigns

SELECT campaign.id, campaign.name, campaign.status, campaign.advertising_channel_type
FROM campaign
WHERE campaign.status != 'REMOVED'
ORDER BY campaign.name

Campaign Performance

SELECT campaign.id, campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
ORDER BY metrics.impressions DESC

List Ad Groups

SELECT ad_group.id, ad_group.name, ad_group.status, campaign.id, campaign.name
FROM ad_group
WHERE ad_group.status != 'REMOVED'

List Keywords

SELECT ad_group_criterion.keyword.text, ad_group_criterion.keyword.match_type, metrics.impressions, metrics.clicks
FROM keyword_view
WHERE segments.date DURING LAST_30_DAYS

Code Examples

JavaScript

// Get customer IDs
const customers = await fetch(
  'https://gateway.maton.ai/google-ads/v23/customers:listAccessibleCustomers',
  { headers: { 'Authorization': `Bearer ${process.env.MATON_API_KEY}` } }
).then(r => r.json());

// Query campaigns
const campaigns = await fetch(
  `https://gateway.maton.ai/google-ads/v23/customers/${customerId}/googleAds:search`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${process.env.MATON_API_KEY}`
    },
    body: JSON.stringify({
      query: 'SELECT campaign.id, campaign.name FROM campaign'
    })
  }
).then(r => r.json());

Python

import os
import requests

headers = {'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}

# Query campaigns
response = requests.post(
    f'https://gateway.maton.ai/google-ads/v23/customers/{customer_id}/googleAds:search',
    headers=headers,
    json={'query': 'SELECT campaign.id, campaign.name FROM campaign'}
)

Notes

  • Use listAccessibleCustomers first to get customer IDs
  • Customer IDs are 10-digit numbers (remove dashes)
  • Monetary values are in micros (divide by 1,000,000)
  • Date ranges: LAST_7_DAYS, LAST_30_DAYS, THIS_MONTH
  • Status values: ENABLED, PAUSED, REMOVED
  • IMPORTANT: When using curl commands, use curl -g when URLs contain brackets (fields[], sort[], records[]) to disable glob parsing
  • IMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments. You may get "Invalid API key" errors when piping.

Error Handling

StatusMeaning
400Missing Google Ads connection
401Invalid or missing Maton API key
429Rate limited (10 req/sec per account)
4xx/5xxPassthrough error from Google Ads API

Resources

README.md

No README available.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install google-ads?

Run openclaw add @byungkyu/google-ads-api in your terminal. This installs google-ads into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/byungkyu/google-ads-api. Review commits and README documentation before installing.