七度&光 2017-01-04 18:19 采纳率: 22.2%
浏览 30

使用R访问AJAX API

I'd like to access data from an jQuery/AJAX api within R. Is there a way to call jQueries in R?

These are some examples of AJAX requests, would be great if I could translate them into R code and get the response back into a data frame.

$.ajax("https://nestiolistings.com/api/v2/agents/?key=<your_key>")

Or a more complex one,

$.ajax({
    url: "https://nestiolistings.com/api/v2/listings/350889/contact/?key=<your_api_key>",
    type: 'POST',
    data: {
        name: 'John Doe',
        email: 'johndoe@example.com',
        phone: '(212)576-5847',
        message: 'Lorem ipsum dolor sit amet, cu has labores adipiscing id.'
    },
    contentType: 'application/json'
})

Link to their API docs: http://developers.nestio.com/api/v2/listings.html#listing-contact

I also found this but it'd be great if I can get an example on how would this calls work on this specific API, and maybe there are other suggestions for jQuery packages within R. https://cran.r-project.org/web/packages/RSelenium/vignettes/RSelenium-basics.html

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 r包runway详细安装教程
    • ¥15 Html中读取Json文件中数据并制作表格
    • ¥15 谁有RH342练习环境
    • ¥15 STM32F407 DMA中断问题
    • ¥15 uniapp连接阿里云无法发布消息和订阅
    • ¥25 麦当劳点餐系统代码纠错
    • ¥15 轮班监督委员会问题。
    • ¥20 关于变压器的具体案例分析
    • ¥15 生成的QRCode圖片加上下載按鈕
    • ¥15 板材切割优化算法,数学建模,python,lingo