Skip to main content

garf for Google Ads & Search Ads 360 API

PyPI Downloads PyPI

garf-google-ads simplifies fetching data from Google Ads & Search Ads 360 API using SQL-like queries.

Prerequisites

Installation

pip install garf-google-ads

To work with Search Ads 360 API install run pip install garf-google-ads[search-ads-360]

Usage

Run as a library

import os

from garf.io import writer
from garf.community.google.ads import GoogleAdsApiReportFetcher

query = """
SELECT
  campaign.id,
  metrics.clicks AS clicks
FROM campaign
WHERE segments.date DURING LAST_7_DAYS
"""

fetched_report = (
  GoogleAdsApiReportFetcher(
    path_to_config=os.getenv('GOOGLE_ADS_CONFIGURATION_FILE_PATH')
  )
  .fetch(query, account=os.getenv('GOOGLE_ADS_ACCOUNT'))
)

console_writer = writer.create_writer('console')
console_writer.write(fetched_report, 'query')

Run via CLI

Install garf-executors package to run queries via CLI (pip install garf-executors).

garf <PATH_TO_QUERIES> --source google-ads \
  --output <OUTPUT_TYPE> \
  --source.account=GOOGLE_ADS_ACCOUNT \
  --source.path-to-config=./google-ads.yaml

where:

Available source parameters

name values comments
account Account(s) to get data from Can be MCC(s) as well
path-to-config Path to google-ads.yaml file ~/google-ads.yaml is a default location
expand-mcc Whether to force account expansion if MCC is provided False by default
customer-ids-query Optional query to find account satisfying specific condition
version Version of Google Ads API

Documentation

You can find a documentation on garf-google-ads here.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

garf_google_ads-1.2.1.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garf_google_ads-1.2.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file garf_google_ads-1.2.1.tar.gz.

File metadata

  • Download URL: garf_google_ads-1.2.1.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for garf_google_ads-1.2.1.tar.gz
Algorithm Hash digest
SHA256 9e466d99934ef4b593733a12ab4278fd6becbe9361590c0b59e8e2abfd286467
MD5 cb19cf79527671a952040b2e929ffd37
BLAKE2b-256 dad1f2ee296ec8ac6dc291e666c09ce99e651eded22fe276e1d755732a9ff6f0

See more details on using hashes here.

File details

Details for the file garf_google_ads-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: garf_google_ads-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for garf_google_ads-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1e0f4a00814d1737b20a95f04ab10f3cafb2c3b3f20d5ba412e898f52b8d66
MD5 09bbc2096caf76749b336393198063a2
BLAKE2b-256 6717b7488c43130786934b9f3669b05e02174ac539f1bfd568356ad22f63346e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 files

1.2.0

2 files

1.1.9

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.4

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page