Hi there !
I want to use Google Suggest API to get keyword's suggestion from different keywords (about 350)
So I need to use FOR LOOP in order to get suggestions for each keyword in the list.
Output wanted : Dataframe with all keywords found in one column
Here is my code, but it needs to be optimized to get to the result wanted
#Load my keywords list
mykeyword = read.csv(file = "mykeyword.csv", sep=";", header = TRUE)
#Initiate the first iteration
df = googleSuggest(mykeyword[1,], language = "fr", walkThrough = FALSE,
questions = FALSE, prepositions = FALSE, comparisons = TRUE)
#Start the loop
for (i in 1: nrow(mykeyword)) {
df[i] = googleSuggest(mykeyword[i,], language = "fr", walkThrough = FALSE,
questions = FALSE, prepositions = FALSE, comparisons = TRUE)
df_final = rbind(df,df[i])
}
Does someone can help here ?
Thanks in advance