How to fetch campaigns with metrics using REST API (Python)

santosh sakre 0 Reputation points
2025-10-28T05:32:26.5533333+00:00

Hi Microsoft Ads Support Team,

I’m integrating the Microsoft Advertising API using REST + Python, and I need to fetch campaigns along with their performance metrics (like impressions, clicks, CTR, spend, conversions, and currency code) — similar to what we see in the Microsoft Ads UI or via the Google Ads API.

Here’s what I’ve done so far:

  • Successfully called the CampaignManagement/v13/GetCampaignsByAccountId endpoint using REST to retrieve campaign names and IDs.

I also tried using the Reporting/v13/SubmitGenerateReport endpoint to fetch performance data, but it only returns CSV data, not JSON.

My questions are:

Is there a REST endpoint that directly returns campaigns with metrics in a single API response?

If not, what is the recommended Python + REST workflow to combine campaign data with metrics (for example, which report type to use, and how to correlate results by CampaignId)?

Could you please share a working REST + Python example to fetch campaign metrics, ideally in JSON format?

I want to achieve functionality similar to the Microsoft Ads UI’s “Campaigns” table — showing campaign name, ID, spend, impressions, clicks, CTR, conversions, and currency.

Thank you for your help! Santosh SakreHi Microsoft Ads Support Team,

I’m integrating the Microsoft Advertising API using REST + Python, and I need to fetch campaigns along with their performance metrics (like impressions, clicks, CTR, spend, conversions, and currency code) — similar to what we see in the Microsoft Ads UI or via the Google Ads API.

Here’s what I’ve done so far:

Successfully called the CampaignManagement/v13/GetCampaignsByAccountId endpoint using REST to retrieve campaign names and IDs.

I also tried using the Reporting/v13/SubmitGenerateReport endpoint to fetch performance data, but it only returns CSV data, not JSON.

My questions are:

Is there a REST endpoint that directly returns campaigns with metrics in a single API response?

If not, what is the recommended Python + REST workflow to combine campaign data with metrics (for example, which report type to use, and how to correlate results by CampaignId)?

Could you please share a working REST + Python example to fetch campaign metrics, ideally in JSON format?

I want to achieve functionality similar to the Microsoft Ads UI’s “Campaigns” table — showing campaign name, ID, spend, impressions, clicks, CTR, conversions, and currency.

Thank you for your help!
Santosh Sakre

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MS Advertising - Arsen 155 Reputation points Microsoft External Staff Moderator
    2025-10-29T09:29:51.5866667+00:00

    Hi Santosh,

    Thank you for reaching out to the Microsoft Advertising Learn Q&A Platform and sharing the details of your integration.

    Unfortunately, we don’t provide support for normal API functionality, our support is limited to technical issues such as errors or unexpected behavior. For implementation guidance, you’ll need to rely on the official API documentation and community resources.

    Here are some helpful links to get you started:

    The Reporting API is the recommended way to retrieve performance metrics. You can use the Campaign Performance Report to get impressions, clicks, CTR, spend, conversions, and currency code. While the API returns data in CSV format, you can parse it in Python to convert it into JSON for your workflow.

    Regarding this question, Is there a REST endpoint that returns campaigns with metrics in a single response?
    Unfortunately, no, the Microsoft Advertising API does not currently support a REST endpoint that combines campaign metadata and performance metrics in a single JSON response.

    If you encounter any technical errors during API calls, feel free to share the details, and we’ll be happy to assist.

    I hope the information provided here will at least partly answer your question.

    Our support teams are happy to discuss your account in more detail via phone, chat or email to provide review assistance, please see our support page to reach out!

    Kind regards, 

    Arsen D. | Microsoft Advertising Support Specialist | 800-518-5689

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.