{"id":22998232,"url":"https://github.com/uswitch/adworj","last_synced_at":"2025-08-14T00:31:55.243Z","repository":{"id":26236928,"uuid":"29683762","full_name":"uswitch/adworj","owner":"uswitch","description":"Clojure library to make it easier to interact with Google AdWords","archived":false,"fork":false,"pushed_at":"2019-01-09T05:05:48.000Z","size":97,"stargazers_count":8,"open_issues_count":1,"forks_count":8,"subscribers_count":53,"default_branch":"master","last_synced_at":"2024-11-17T20:55:08.184Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uswitch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-22T14:55:58.000Z","updated_at":"2023-03-14T11:22:52.000Z","dependencies_parsed_at":"2022-08-26T06:12:43.320Z","dependency_job_id":null,"html_url":"https://github.com/uswitch/adworj","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fadworj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fadworj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fadworj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uswitch%2Fadworj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uswitch","download_url":"https://codeload.github.com/uswitch/adworj/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229786999,"owners_count":18124014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-15T06:12:14.879Z","updated_at":"2024-12-15T06:12:15.453Z","avatar_url":"https://github.com/uswitch.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# adworj\n\nClojure library to ease interacting with the Google AdWords API. It is built upon [Google's AdWords API Java Client Library](https://github.com/googleads/googleads-java-lib).\n\n## OAuth 2 Authentication\n\nGoogle's APIs are moving towards requiring OAuth 2 authentication. To do this you need to:\n\n1. Visit [https://console.developers.google.com/](https://console.developers.google.com/) and (if necessary create a project).\n2. Click on **Credentials** in the API \u0026amp; auth menu on the left.\n3. Ceate a new Client ID for a **native application**. The redirect URI should be: `urn:ietf:wg:oauth:2.0:oob`\n4. You'll also need your AdWords API developer token.\n\nOnce you've generated all the tokens and keys you can use `adworj.credentials` namespace to help generate the necessary credentials.\n\nUltimately you need to retrieve the **refresh token** that is provided by the OAuth Credentials. Having retrieved this during the OAuth flow you can either create `offline-credentials` using the refresh token directly, or, store the refresh token in your `ads.properties`.\n\n## ads.properties\n\nThe easiest way to configure Google's client library is via a properties file. This should look something like:\n\n    api.adwords.clientId=(from the developer console above)\n    api.adwords.clientSecret=(from the developer console above)\n    api.adwords.developerToken=(from the adwords console)\n\nOnce you've authenticated you can add an entry for the refresh token:\n\n    api.adwords.refreshToken=(from oauth authentication/authorization flow)\n\n# Reporting API\n\nHaving successfully authenticated, and updated the properties file with your configuration, you can run a report as follows:\n\n```clojure\n(ns reporter\n  (:require [adworj.credentials :as ac]\n             [adworj.reporting :as ar]\n             [clojure.java.io :as io]))\n\n(def client-customer-id \"123-456-7890\")\n(def credentials        (ac/offline-credentials \"./ads.properties\"))\n(def session            (ar/reporting-session \"./ads.properties\" credentials\n                                              :client-customer-id client-customer-id\n                                              :include-zero-impressions false))\n\n(with-open [report (ar/run session ar/paid-and-organic-query \"sample report\" :range (ar/date-range :last-week))]\n  (doseq [record (ar/record-seq report)]\n    (println record)))))\n\n```\n\n## License\n\nCopyright \u0026copy; 2015 uSwitch Limited.\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuswitch%2Fadworj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuswitch%2Fadworj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuswitch%2Fadworj/lists"}