Page Summary
-
The Google Ads API .NET client library is hosted on GitHub and distributed as a NuGet package, offering features to ease credential management and client creation.
-
The library officially supports .NET Framework 4.7.2+, .NET Standard 2.1, and .NET 8.0, with potential compatibility on other platforms that haven't been officially tested.
-
To get started with the API, follow the quick start guide to set up accounts and make your first call.
-
The library provides detailed guides on basic usage, authentication, configuration, logging, and utility classes for improved API usability.
-
For optimizing application performance, consult the performance tuning guide.
The .NET client library is hosted on GitHub and is distributed as a NuGet package. It offers several features to help you use the API, including easier management of credentials and creation of Google Ads API service clients.
The library supports the following .NET frameworks:
- .NET Framework 4.7.2 and later (
net472) - .NET Standard 2.1 (
netstandard2.1) - .NET 8.0 (
net8.0)
.NET Standard 2.1 is compatible with several other .NET versions and implementations, so the library might work fine on many other platforms. However, we haven't officially tested the compatibility and thus don't officially support these platforms. See the .NET Standard 2.1 documentation to learn more.
The Google Ads API .NET library uses Grpc.Net.Client as the default transport layer,
with a fallback to Grpc.Core on unsupported platforms. While you can force the
use of Grpc.Core by setting UseGrpcCore to true, note that Grpc.Core is
deprecated and intended only for legacy maintenance. See the
basic usage guide to learn more.
Make your first API call
To use the Google Ads API, you need to perform several steps to get access to the API and configure your Google Ads accounts. Follow the quick start guide, which walks you through all the important steps including setting up your Google Ads accounts.
Basic usage
Initialize GoogleAdsClient with your configuration settings and retrieve a
service client to make API calls:
GoogleAdsClient client = new GoogleAdsClient();
GoogleAdsServiceClient googleAdsService =
client.GetService(Services.V25.GoogleAdsService);
Refer to the basic usage guide to learn more about how to use the .NET client library.
Authorization and authentication
The .NET client library supports multiple approaches to authentication and
authorization, including OAuth 2.0 user credentials (for desktop and web
applications), service accounts, Application Default Credentials (v24.1.0 and
later), and manual credential injection (v27.0.0 and later). Refer to the
authorization and authentication guide to learn more.
Configuration and logging
The .NET client library supports multiple configuration
and logging options using runtime objects, App.config files,
JSON configuration files, or environment variables. In case you need to modify
the logging behavior of the client library, refer to the
custom gRPC interceptor guide.
Utilities
The .NET client library includes utility classes to improve API usability,
including media and video upload helpers (UploadVideo in v27.2.0 and later).
Refer to the following guides to learn more:
Fine-tune your application performance
Refer to the performance tuning guide for recommendations on how to fine-tune your application's performance.