Skip to main content

Garf implementation for Google Ads API

Project description

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.

Project details


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.1.4.tar.gz (17.8 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.1.4-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: garf_google_ads-1.1.4.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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.1.4.tar.gz
Algorithm Hash digest
SHA256 3678ae30142d14fe185dee60777e8ff88ed74eda8eee1da5516e94aa8d01cae0
MD5 6d6d585e20545461e65e0dfc9265dc31
BLAKE2b-256 18e54913330a9a0b44404698365cfc4064b4acfd1c6d3132af5c4bb64907ff31

See more details on using hashes here.

File details

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

File metadata

  • Download URL: garf_google_ads-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","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.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b5728a685c7a4c981035e426efe528e4e99fb75e2d7ce0f40804b3df3df52f0a
MD5 1dcc381f296147c540a4625d71391ba6
BLAKE2b-256 e4aca845123e3915f6dd8300ea9496fb9ad024c1cf11505bd1e0da48165a76e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page