Skip to main content

GAQL CLI

PyPI version PyPI downloads

A CLI for running GoogleAds queries.

Usage

Installing

  • pip install gaql
  • pipx install gaql (recommended)

Querying

The default mode. Runs either as a REPL, or as a one off command

- gaql [ACCOUNT_ID] - run in REPL mode
- gaql [ACCOUNT_ID] [WORDS*] - run a single query. Note depending on your shell you may need to quote some queries if you run like this.

flags:
--help show the help message; basically the below
-f|--format <csv|json|jsonl|proto> specify an output format
-o|--output <file> specify an output file. Based on the extension, format is inferred. Non REPL usage only

Examples, using 1-000-000-000 as our demo account id:

# opens a REPL with json lines as the output format
gaql -f jsonl 1-000-000-000

# runs the query against the given account, outputting to the terminal the results as json lines
gaql -f jsonl 1-000-000-000 'SELECT campaign.id FROM campaign'

# runs the query against the given account, outputting to 'campaigns.jsonl' the result as json lines
gaql -o campaigns.jsonl 1-000-000-000 'SELECT campaign.id FROM campaign'

tip: by default LIMIT 100 will be added to your queries. To override this behavior, simply define your own LIMIT X.

tip: the autocomplete will return only valid fields for the selected entity if you fill out the FROM <entity> part first.

Other tools

Used for useful common queries. Currently only supports getting all accounts under an MCC, to help when managing multiple accounts. The MCC is taken from the login_customer_id field.

  • gaql-tools queries clients

Notes

  • credentials come from the environment > the google .yaml file > a user provided credential file
  • credentials, settings, and history are stored in ./config/gaql/*. The credential file will only be present if you create it through a prompt (i.e you aren't using the ENV, or the YAML file Google specifies)

Ideas / TODO

  • tables as an output format
  • autocomplete for account ids (with caching)

Development

We're using poetry for local development, package management, and publishing. pyenv is recommended for Python version management, and pipx for installation.

Build commands:

make develop - install a development version. run via `poetry run gaql <args>`
make publish - build and distribute to PyPi
make clean   - remove the existing build files
make format  - run black over the code
make lint    - lint and format the code

Security

For sensitive security matters please contact security@getyourguide.com.

Legal

gaql-cli is licensed under the Apache License, Version 2.0. See LICENSE for the full text.

Download files

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

Source Distribution

gaql-1.17.0.tar.gz (131.3 kB view details)

Uploaded Source

Built Distribution

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

gaql-1.17.0-py3-none-any.whl (137.7 kB view details)

Uploaded Python 3

File details

Details for the file gaql-1.17.0.tar.gz.

File metadata

  • Download URL: gaql-1.17.0.tar.gz
  • Upload date:
  • Size: 131.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.6 Darwin/25.5.0

File hashes

Hashes for gaql-1.17.0.tar.gz
Algorithm Hash digest
SHA256 04d646d5ccc167ab8504105f66e5f4d35d546cfcd52f74ab5516d31edb822c05
MD5 463dc7b89e67d267250467fe16833903
BLAKE2b-256 00fdd07dd25636a3e50fcbb231abe76a7751f66bb27fd4c691419219a654170e

See more details on using hashes here.

File details

Details for the file gaql-1.17.0-py3-none-any.whl.

File metadata

  • Download URL: gaql-1.17.0-py3-none-any.whl
  • Upload date:
  • Size: 137.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.6 Darwin/25.5.0

File hashes

Hashes for gaql-1.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 841fe365a1cdbbe223c5feeffad3c3226e03d20d0e66d970e0f96f15d9f87da1
MD5 a2d5f2a027d4ac45d38b5025d27ea3db
BLAKE2b-256 a25dab88ae0ba53efa9308fe6961749939a8c3cc1c548076304320c882abdd3d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.17.0 This release

2 files

1.16.0

2 files

1.15.0

2 files

1.14.0

2 files

1.13.0

2 files

1.12.1

2 files

1.12.0

2 files

1.11.0

2 files

1.10.0

2 files

1.9.0

2 files

1.8.0

2 files

1.7.0

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

Supported by

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