Earlier this year we released a demo that allows you to run AdWords API queries from the command line. Today, a new version is available and I’d like to point out some of its features.
Accessing production environment
We’ve made a change to reduce a risk of accidentally running the demo tool against a production environment. Since version 1.2.0, an explicit ‘–prod’ flag is required in order to query billable services. Check out ‘awcli –help’ for all available command-line options.
Automatic batch mode
AWCLI can now run in interactive or batch mode and detects the required mode automatically. In interactive mode, you will get a prompt to type your commands:
In batch mode, any extra input is suppressed and the application exits after a command completes. This makes it easier to use the tool in shell scripts:
bash $ echo ls | ./awcli.sh
#1 Campaign Name 
You can also specify a command and its parameters as extra arguments to the tool itself:
bash $ ./awcli.sh --prod ls 69266990
#1 AdGroup name 
Browsing Ad Parameters
A new CriterionLocation was added which allows you to browse Criteria. This enables you to list and view AdParams associated with your criteria:
bash $ ./awcli.sh [options] ls //
#1 $100 
#2 50 
…and even edit them: ‘edit #1′ will spawn your configured editor. The changes will be automatically applied when you save and exit.
You can combine AWCLI output with other command-line tools to retrieve parts of the information you need. For example, you can use Unix filters to obtain ad group stats:
bash $ ./awcli.sh --prod cat / | grep -E "clicks|impressions"
clicks = 12,
impressions = 160,
AWCLI is available from the Google Code page and is part of the AdWords Java API client libraries project. You can find installation and running instructions as well as usage examples on the wiki page. Please join us to discuss the tool and report any issues on the project page or forum.
Danial Klimkin, AdWords API Team.