Garf implementation for Google Ads API
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file garf_google_ads-1.1.0.tar.gz.
File metadata
- Download URL: garf_google_ads-1.1.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af46c8ae12b8b3719e2b6b0b112a378e300372c4d87fc178a1f4272d5dbd05e0
|
|
| MD5 |
640b14419676edf0490f89ea7a4af64e
|
|
| BLAKE2b-256 |
91454fd9ea1acbb0ffc0e51a7e49684fcbd43a11ec1a08d334b0cf25660d6805
|
File details
Details for the file garf_google_ads-1.1.0-py3-none-any.whl.
File metadata
- Download URL: garf_google_ads-1.1.0-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4246aabd80cd9e1019d319218d035bcaadd7d8544b22738bfb4f468dc43873d1
|
|
| MD5 |
65a45d70ed07316524526475ceb7b01f
|
|
| BLAKE2b-256 |
89b8950707fa337f04135d55ff5f7e5a9f14fe4654292c435d9105a021c6f92b
|