帮助者请求bing API
arcane-bing的Python项目详细描述
奥冰
此包基于bingads。在
开始吧
pip install arcane-bing
示例用法
报告
^{pr2}$活动服务
必须提供客户机的客户机id和客户机id的方法:警告
fromarcane.bingimportClientfromarcane.bing.helpersimportparse_webfault_errors,parse_bing_responsebing_client=Client(credentials=Config.BING_ADS_CREDENTIALS,secrets_bucket=Config.SECRETS_BUCKET,refresh_token_location=Config.BING_ADS_REFRESH_TOKEN,storage_client=storage_client,customer_id=CUSTOMER_ID,account_id=ACCOUNT_ID)campaign_service=bing_client.get_service_client(service_name='CampaignManagement')try:response=campaign_service.GetCampaignsByAccountId(AccountId=ACCOUNT_ID)all_campaigns=parse_bing_response(response)['Campaign']# do stuff with all_campaignsexceptWebFaultase:bing_error=parse_webfault_errors(e)# do stuff with bing_error
- 项目
标签: