Bing Ads Code Examples

Get started developing Bing Ads applications in any programming language which supports web services. Samples are provided in the docs listed below.

Tip

Begin with the Get Started guide and walkthroughs for your preferred language e.g., C#, Java, Php, and Python.

Supporting files for C#, Java, Php, and Python examples are available at GitHub. You can clone each repository or repurpose snippets as needed.

Title Description Available Languages
Ad Extensions This example shows how to add, get, and delete extensions for an account's ad extension library, set, get, and delete the extension associations with a campaign, and determine why an extension failed editorial reviews. C#, Java, Php, Python
Bulk Ad Extensions This example shows how to add, get, and delete extensions for a campaign with the Bulk service. C#, Java, Python
Bulk Keywords and Ads This example demonstrates how to setup ads and keywords for a search advertising campaign using the Bulk service. C#, Java, Python
Bulk Shopping Campaigns This example demonstrates how to apply product conditions for Bing Shopping Campaigns using the Bulk service. C#, Java, Python
Budget Opportunities This example demonstrates how to get the budget opportunities for each campaign in the current authenticated account. C#, Java, Php, Python
Conversion Goals This example demonstrates how to manage UET tags and conversion goals. C#, Java, Php, Python
Customer Signup This example demonstrates how a reseller can call SignupCustomer to create a new customer and account. C#, Java, Php, Python
Dynamic Search Campaigns This example uses the Bing Ads Campaign Management service to setup a Dynamic Search Ads (DSA) campaign. C#, Java, Php, Python
Geographical Locations This example demonstrates how to download the comma separated value (CSV) file that contains geographical location information that can be used with Bing Ads location targeting. C#, Java, Php, Python
Invite User This example demonstrates how to invite a user to manage Bing Ads accounts. C#, Java, Php, Python
Keyword Planner This example demonstrates how to get keyword ideas and traffic estimates for search advertising campaigns. C#, Java, Php, Python
Keywords and Ads This example demonstrates how to setup ads and keywords for a search advertising campaign. C#, Java, Php, Python
Labels This example demonstrates how to add labels and associate them with campaigns, ad groups, keywords, and ads. C#, Php, Python
Manage Client This example demonstrates how to use agency credentials to invite a client, and use client credentials to accept the invitation. Run this sample multiple times alternating between agency and client credentials to update and observe the status change, for example from LinkPending to LinkAccepted to Active. C#, Java, Php, Python
Negative Keywords This example demonstrates how to associate negative keywords and negative keyword lists with a campaign. C#, Java, Php, Python
Offline Conversions This example demonstrates how to send Bing Ads your offline conversions using the Campaign Management service. C#, Php, Python
Remarketing Lists This example demonstrates how to associate remarketing lists with a new ad group. C#, Java, Php, Python
Report Requests This example demonstrates how to request and retrieve performance reports. C#, Java, Php, Python
Search User Accounts This example demonstrates how to search for accounts that can be managed by the current authenticated user. C#, Java, Php, Python
Shopping Campaigns This example demonstrates how to apply product conditions for Bing Shopping Campaigns. C#, Java, Php, Python
Target Criterions This example demonstrates how to use target criterions with the Campaign Management API. C#, Java, Php, Python

See Also

Get Started with the Bing Ads API
Bing Ads Web Service Addresses
Bing Ads API Reference