List your Microsoft Ads campaigns — status, budget
microsoft-ads.queryCampaigns in your Microsoft Advertising account, with status, budget and bid strategy
- 价格
- free按目录价
- 成功率
- —暂无成功率数据暂无成功率数据
- 延迟 p50
- ——
- 最后验证
- —尚未验证
POSThttps://toolswitch.dev/v1/tools/microsoft-ads.queryBeta- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
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
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 请求体(JSON) | ||||
AccountId | 整数 | 必填 | the ad account id (a long). Must equal the CustomerAccountId header | 123456789 |
CampaignType | 字符串 | 可选 | 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 | 字符串 | 可选 | space-delimited opt-ins for newer properties, e.g. "AdScheduleUseSearcherTimeZone BidStrategyId" | BidStrategyId |
- 请求体(JSON)
AccountId整数必填the ad account id (a long). Must equal the CustomerAccountId header
示例:
123456789CampaignType字符串可选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 PerformanceMaxReturnAdditionalFields字符串可选space-delimited opt-ins for newer properties, e.g. "AdScheduleUseSearcherTimeZone BidStrategyId"
示例:
BidStrategyId
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
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());网关接口为 Beta,地址与鉴权方式可能变更。 示例参数仅为样例数据。 调用按 free 计费,已含服务费。