List your Microsoft Ads campaigns — status, budget
microsoft-ads.queryCampaigns in your Microsoft Advertising account, with status, budget and bid strategy
- Price
- freeAt list price
- Success rate
- —No success-rate data yetNo success-rate data yet
- Latency p50
- ——
- Last verified
- —Not verified yet
POSThttps://toolswitch.dev/v1/tools/microsoft-ads.queryBeta- Uses platform quota
- Synchronous response
- Reads public data
Parameters
returns Campaigns[] with Id, Name, Status, DailyBudget, BudgetType, BiddingScheme, StartDate/EndDate, Languages and CampaignType. DailyBudget is a plain decimal in the ACCOUNT CURRENCY — not micros, not cents, unlike Google and Meta. No performance metrics: pair with the Reporting service for spend and clicks
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Request body (JSON) | ||||
AccountId | integer | Required | the ad account id (a long). Must equal the CustomerAccountId header | 123456789 |
CampaignType | string | Optional | SPACE-DELIMITED flags, not an array: "Search Shopping DynamicSearchAds Audience PerformanceMax". DEFAULTS TO Search — omit it and Shopping/PMax campaigns are silently missing from the result | Search Shopping PerformanceMax |
ReturnAdditionalFields | string | Optional | space-delimited opt-ins for newer properties, e.g. "AdScheduleUseSearcherTimeZone BidStrategyId" | BidStrategyId |
- Request body (JSON)
AccountIdintegerRequiredthe ad account id (a long). Must equal the CustomerAccountId header
Example:
123456789CampaignTypestringOptionalSPACE-DELIMITED flags, not an array: "Search Shopping DynamicSearchAds Audience PerformanceMax". DEFAULTS TO Search — omit it and Shopping/PMax campaigns are silently missing from the result
Example:
Search Shopping PerformanceMaxReturnAdditionalFieldsstringOptionalspace-delimited opt-ins for newer properties, e.g. "AdScheduleUseSearcherTimeZone BidStrategyId"
Example:
BidStrategyId
Code samples
Replace $TOOLSWITCH_KEY with the key you created in the console.
curl -X POST 'https://toolswitch.dev/v1/tools/microsoft-ads.query' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"POST",
"https://toolswitch.dev/v1/tools/microsoft-ads.query",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/microsoft-ads.query", {
method: "POST",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());This gateway API is in beta; its URL and authentication may change. The example parameters are sample data. Calls are billed at free, including the service fee.