garf for Google Ads & Search Ads 360 API
garf-google-ads simplifies fetching data from Google Ads & Search Ads 360 API using SQL-like queries.
Prerequisites
- Google Ads API enabled.
- (Optional) Search Ads 360 API enabled if you want to interact with Search Ads 360 API.
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-executorspackage 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:
PATH_TO_QUERIES- local or remove files containing queriesoutput- output supported bygarf-iolibrary.SOURCE_PARAMETER=VALUE- key-value pairs to refine fetching, check available source parameters.
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.
Metadata
Release files for garf-google-ads 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| garf_google_ads-1.3.1.tar.gz | 32.6 kB | Without provenance | Details for garf_google_ads-1.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| garf_google_ads-1.3.1-py3-none-any.whl | Python 3 | none | any | Details for garf_google_ads-1.3.1-py3-none-any.whl |
Total release size: 95.8 kB
Release files / garf_google_ads-1.3.1.tar.gz
| Download URL | garf_google_ads-1.3.1.tar.gz |
|---|---|
| Size | 32.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a3a754a1e456972f116d37b82a3056f1ffbb128ae68581e9325f26787707779
|
|
BLAKE2b-256 checksum How to use checksums |
fde9d99ceb173b099172c6f11dd462858af1ca8966718a5e4f6713f2a3f36abd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / garf_google_ads-1.3.1-py3-none-any.whl
| Download URL | garf_google_ads-1.3.1-py3-none-any.whl |
|---|---|
| Size | 63.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
675fb8ab50e92ee64a9bb420db575ae6f6c6503a12bf417c805bee698a5de5a3
|
|
BLAKE2b-256 checksum How to use checksums |
b24bf2a0fb4a9c3cf715986e807deab8a502d28927d5a7b976415cc5cb451b59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for garf-google-ads 1.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.