Closed ysgit closed 6 years ago
Hi @ysgit @mbannert and me started a project from scratch with the aim to connect R and the Bing Ads API a long time ago. However, we never proceeded any further than the authentication process with the API.
You can find the code in a separate branch of the RAdwords repo: https://github.com/jburkhardt/RAdwords/tree/bing
Due to limited time and unpleasant XML overhead related with the Bing Ads API, we did not proceed with the project. You are welcome to pick it up again!
Microsoft provides client libraries in Python, Java and PHP for the Bing Ads API. It was convincing to use one of these libraries in order to retrieve Bing Ads data.
Hi @ysgit.You unfortunately @jburkhardt is right. We do not have any plans currently to fight through the MS documentation, XML and all the things that are so much more fun /w Google stuff. The only chance I'd see for a quick R based fix would be a Python or Java wrapper. In any case I'd see a Bing solution in another package bingR.
Just to add something to this thread... In our tech team, we always use R to develop scripts in order to automate manual actions. We personally call the Bing Ads Python libraries via R, using the shell command. It is very adaptive, and though not being scripted fully in R, quite flexible. Happy to discuss this further if need be.
You can use the package bingsAdsR from github.
rm(list=ls())
# library(devtools)
# install_github("deepeshgoeliitk/bingAdsR")
library(bingAdsR)
##Variables##
credentials <- list(
###For authorization and access token###
client_id = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
client_secret = "XXXXXXXXXXXXXXX",
###To get data###
username = "abc@abc.com",
password = "***********",
developer_token = "XXXXXXXXXXXXXXXXX",
customer_id = "XXXXXXXXXX",
account_id = "XXXXXXX"
)
####AUTHENTICATION#####
credentials <- baAuthentication(credentials)
#####Generate the data
startDate <- "2018-05-17"
endDate <- "2018-05-17"
report <- "CampaignPerformanceReport"
columns <- c("AccountName", "CampaignName", "TimePeriod", "Impressions", "Clicks", "Spend", "Conversions")
reportId <- getReportId(credentials, report, columns, startDate, endDate)
downloadUrl <- getDownloadUrl(credentials, reportId)
df <- getDataFromURL(downloadUrl)
Btw... there's a new interface from R to Python. It's called reticulate and maintained by the folks at rstudio: https://github.com/rstudio/reticulate
Hi @jburkhardt have you had any success in creating something similar to RAdwords for bing ads?