List your Microsoft Ads campaigns — status, budget
microsoft-ads.queryCampaigns in your Microsoft Advertising account, with status, budget and bid strategy
- Price
- freeZum Listenpreis
- Success rate
- —Noch keine ErfolgsratendatenNoch keine Erfolgsratendaten
- Latency p50
- ——
- Last verified
- —Not verified yet
POSThttps://toolswitch.dev/v1/tools/microsoft-ads.queryBeta- Uses platform quota
- Synchronous response
- Reads public data
Parameter
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 | Typ | Erforderlich | Beschreibung | Beispiel |
|---|---|---|---|---|
| Anfragetext (JSON) | ||||
AccountId | Ganzzahl | Erforderlich | the ad account id (a long). Must equal the CustomerAccountId header | 123456789 |
CampaignType | Zeichenkette | 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 | Zeichenkette | Optional | space-delimited opt-ins for newer properties, e.g. "AdScheduleUseSearcherTimeZone BidStrategyId" | BidStrategyId |
- Anfragetext (JSON)
AccountIdGanzzahlErforderlichthe ad account id (a long). Must equal the CustomerAccountId header
Beispiel:
123456789CampaignTypeZeichenketteOptionalSPACE-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
Beispiel:
Search Shopping PerformanceMaxReturnAdditionalFieldsZeichenketteOptionalspace-delimited opt-ins for newer properties, e.g. "AdScheduleUseSearcherTimeZone BidStrategyId"
Beispiel:
BidStrategyId
Codebeispiele
Ersetze $TOOLSWITCH_KEY durch den in der Konsole erstellten Schlüssel.
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());Diese Gateway-API ist in der Beta; URL und Authentifizierung können sich ändern. Die Beispielparameter sind Musterdaten. Aufrufe werden mit free einschließlich Servicegebühr abgerechnet.