Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205372

R: How to use Bing free tier web search using R

$
0
0

Assuming user provided card and phone and has valid Azure account. Created a free tier service. (has key and endpoint, something like xyz.cognitiveservices.azure.com/bing/v7.0

Using free tier (3 searchers per second and max per month or so) (see here https://azure.microsoft.com/en-us/pricing/details/cognitive-services/ )

Is it a GET or POST call and what are the right header parameters? They only have Python example that is not working. https://docs.microsoft.com/en-us/azure/cognitive-services/bing-web-search/quickstarts/python

https://github.com/Azure-Samples/cognitive-services-REST-api-samples/blob/master/python/Search/BingWebSearchv7.py

The questions is how to do it in R.

This code does not work

library(httr)
token='xxxxx'
server='https://xxxxx.cognitiveservices.azure.com/bing/v7.0/'
url=paste0(server,'search')
response = GET(url = url, 
               authenticate('',token, type = 'basic'))
response
res = content(response, encoding = 'json')

Viewing all articles
Browse latest Browse all 205372

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>