My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
AWCLI  
Information about AWCLI (AdWords Command Line Interface) sample application.
AWCLI
Updated May 4, 2012 by api.dkli...@gmail.com

AdWords Command Line Interface

Note: This project is deprecated and no longer supported.

Introduction

Google's AdWords API service lets developers design computer programs that interact directly with the AdWords platform. With these applications, advertisers and third parties can more efficiently -- and creatively -- manage their large or complex AdWords accounts and campaigns.

The AdWords Command Line Interface (AWCLI) is a command-line tool for power users and administrators to inspect AdWords accounts or for use in scripts, cron jobs and so on. It provides a convenient command line interface similar to popular shell prompts and can be used to visualize the effects of a request on your account and to retrieve information such as IDs that are needed when running examples.

We are 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.
  • Piping support for shell scripting.
  • Environment (env), history (history) and other utility functions.

Downloading and installing

AWCLI is available from the Google Code page and is part of AdWords Java API project. It can be obtained from the downloads page.

The tarball contains all components required to run the tool. All that needed is to unpack the tarball:

$ tar xvzf awcli-1.2.0.tar.gz
$ cd awcli-1.2.0

and specify your AdWords credentials (an example is provided):

$ cp adwords.properties.example ~/adwords.properties                                                                                               
$ nano ~/adwords.properties

Check out the README file for more release-specific details.

Running and querying

Once the properties file is updated, you can run AWCLI and get the command prompt:

$ ./awcli.sh
awcli:/>

Try out the tab completion (TAB-TAB to see all available completions) or help to see available commands. Let’s try querying a single campaign:

# First of all, we need to get a list of campaigns available
awcli:/> ls
  #1 GoogleAdCampaign [48845]
  #2 AnotherCampaign [48846]
# Now we can 'cat' one of them by id:
awcli:/> cat 48845
# or by cached line number:
awcli:/> cat #1
# or you can use TAB completion and  type the full name:
awcli:/> cat G<TAB>     =>>
awcli:/> cat GoogleAdCampaign

In any case you will get a formatted output of text Campaign representation. Try running 'edit' against the same id!

Other features to try

We wrote this tool for power users and expect them to play around, explore and improve the tool on their own. But here is something to start with:

awcli:/> find <campaign name>
awcli:/> cat <campaign id>/<ad group id>
awcli:/> history
awcli:/> rm #1
awcli:/> env
awcli:/> <TAB> <TAB>
awcli:/> quit

Please join us to discuss the tool on the forum.

Comment by si...@olofsson.de, Jan 6, 2012

It's awcli.properties, not adwords.properties.

Comment by ha...@sokrati.com, Apr 27, 2012

getting error :

haiku@haiku:~/awcli-1.2.0$ sh awcli.sh Exception in thread "main" java.lang.NoClassDefFoundError?: org/apache/commons/cli/ParseException?

at com.google.ads.awcli.Awcli.main(Awcli.java:56)
Caused by: java.lang.ClassNotFoundException?: org.apache.commons.cli.ParseException?
at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController?.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader?.loadClass(ClassLoader?.java:307) at sun.misc.Launcher$AppClassLoader?.loadClass(Launcher.java:301) at java.lang.ClassLoader?.loadClass(ClassLoader?.java:248) ... 1 more

I downloaded commons-cli jar and placed it in lib, however the error persists.

Thanks.

Haiku

Comment by ha...@sokrati.com, Apr 27, 2012

Fixed it, had to edit awcli.sh to include the jar in the load path.

Haiku


Sign in to add a comment
Powered by Google Project Hosting