Skip to content

Instantly share code, notes, and snippets.

@corynissen
Created June 13, 2013 15:41
Show Gist options
  • Save corynissen/5774747 to your computer and use it in GitHub Desktop.
Save corynissen/5774747 to your computer and use it in GitHub Desktop.
google prediction api example request
hosted.model <- "sample.languageid"
model.url <- "https://www.googleapis.com/prediction/v1.5/hostedmodels/"
model.curl.request <- paste0('curl -k --header "Content-Type: application/json" --data \'{"input":{"csvInstance":["Como se llama?"]}}\' -H "Authorization: Bearer ', token_code, '" https://www.googleapis.com/prediction/v1.5/hostedmodels/sample.languageid/predict?key=', api_key, " --verbose")
system(model.curl.request, intern=T)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment