Google Ads API client library for Node.js
You're probably looking for our easy-to-use Google Ads API client library google-ads-api.
This library (google-ads-node) is the compiled output of the experimental Google Ads API Bazel build files, and will require some work to use as a standalone library, for which we currently provide no documentation.
npm install google-ads-node
Requires Node.js 22 or newer.
- Update to the latest
gapic-toolsversion in/package/googleads-nodejs/package.json(re-apply aftermake protos, which regenerates this file). - Update to the latest
google-gaxversion in/package/googleads-nodejs/package.json&/package.json. - Update
GOOGLE_ADS_VERSIONin the Makefile to the latest version (if required). - Run
make protosto pull in the new protos and compile them. This command will take around 10 minutes. There are often errors here that need to be fixed due to changes in bazel, the docker image, or the protos themselves. Fix these errors as they come up. - Check for request parameters that the Dockerfile's
sedrules do not convert to snake_case:grep -hE 'request\.[a-z]+[A-Z][A-Za-z]*' package/googleads-nodejs/src/v*/*.ts | grep -vE '^\s*\*'should print nothing (the second grep drops JSDoc lines, which legitimately contain camelCase names). Add asedrule to the Dockerfile for anything it prints. - If upgrading to a new major version delete the old version folders from
package/googleads-nodejs/protos/google/ads/googleads/{OLD_VERSION},package/googleads-nodejs/src/{OLD_VERSION}andpackage/googleads-nodejs/samples/generated/{OLD_VERSION}. - Run
yarnto prepare the package and install the latest dependencies. - You may find that the tsc build fails because of camelcase issues. If so, make sure that the
compile-protoscommand in/package/googleads-nodejs/package.jsonincludes all required arguments, like so:compileProtos --keep-case --force-number src - Update any references to old version numbers in
tests/protos.jsandtests/esm.mjs. - Run
yarn testto make sure everything worked. - Double check that any files that should have been updated have been.
- Update the readme to reflect the new Google Ads API version number
- Make a pull request, get it approved and merged into
master. - Publish to npm.
This library is developed and maintained by Opteo, the Advertising Efficiency Manager (AEM) for paid media teams working across Google Ads, Meta Ads, Microsoft Advertising, LinkedIn Ads and TikTok Ads.
Opteo brings together live account data, business context, skills, and specialist marketing tools in one workspace. Connect your marketing accounts, analyse your data with professional-grade tools, build expert marketing agents, and implement changes that increase ROAS.
Learn more about Opteo.