Showing posts with label awcli. Show all posts
Showing posts with label awcli. Show all posts

Using AWCLI (AdWords Command Line Interface)

Tuesday, October 04, 2011


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:
awcli:/>

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 [69266990]
    [...]
bash $

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 [2390064350]
    [...]
bash $

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 <campaign_id>/<adgroup_id>/<criterion_id>
    #1 $100 [1]
    #2 50 [2]
bash $
...and even edit them: 'edit #1' will spawn your configured editor. The changes will be automatically applied when you save and exit.


Querying stats

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 <campaign_id>/<adgroup_id> | grep -E "clicks|impressions"
        clicks = 12,
        impressions = 160,
bash $

Getting AWCLI

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.

New demo launch: AdWords Command Line Interface (AWCLI)

Monday, March 07, 2011


Today we’re releasing a new AdWords API sample application: AWCLI (AdWords Command Line Interface) intended to demonstrate a way for using the API. It’s a tool for AdWords interaction which was designed for power users and administrators to be able to inspect AdWords objects from a command line. It could also be used in various scripts and cron jobs.

The current code is work in progress. We’re sharing this code as open source to provide a starting point for new developers and to demonstrate some of the core functionality in the API.

AWCLI features
  • Shell-like command line interface with tab-completion.
  • Ability to list (ls), navigate (cd), retrieve (cat), edit (edit) and delete (rm) AdWords objects (campaigns, ad groups etc).
  • Search (find) function.
  • Local objects cache for easy referencing.
  • Environment (env), history (history) and other utility functions.

Getting AWCLI

AWCLI is available from the Google Code page and is part of AdWords Java API project. It can be obtained from the downloads page: http://code.google.com/p/google-api-adwords-java/downloads/. You can find installation and running instructions as well as usage examples on the project wiki page.

Please join us to discuss the tool and report any bugs on the project page or forum.


Danial Klimkin, AdWords API Team.