Questions tagged [httr]

The R package 'httr' provides useful tools for working with HTTP connections. It is a simplified wrapper built on top of 'RCurl'.

The R package httr provides useful tools for working with HTTP connections. It is a simplified wrapper built on top of RCurl. It is much much less configurable but because it only attempts to encompass the most common operations it is also much much simpler.

Resources:

1019 questions
5
votes
2 answers

Retrieving cached oauth token with packages httr, twitteR, and streamR

The only way I've found to get myself authenticated with the twitter API is the following: library(twitteR) setup_twitter_oauth(consumer_key = "a", consumer_secret = "b", access_token = "c", …
user2987808
  • 1,387
  • 1
  • 12
  • 28
5
votes
1 answer

'RCurl' [R] package getURL webpage error when scraping API

I am trying to scrape data on pages from an API using the getURL function of the RCurl package in R. My problem is that I can't replicate the response that I get when I open the URL in Chrome when I make the request using R. Essentially, when I open…
Tom
  • 147
  • 1
  • 1
  • 7
5
votes
1 answer

R Disparity between browser and GET / getURL

I'm trying to download the content from a page and I'm finding that the response data is either malformed or incomplete, as if GET or getURL are pulling before those data are loaded. library(httr) library(RCurl) url <-…
Brandon Bertelsen
  • 43,807
  • 34
  • 160
  • 255
5
votes
1 answer

Failing to set the user agent via httr::user_agent

Is there anything special I need to consider when trying to change the user agent via httr::user_agent in a httr::GET() call on MS Windows? I'm using R-3.1.0 and httr 0.3. Following the example at ?user_agent, I'm getting these results: url_this <-…
Rappster
  • 12,762
  • 7
  • 71
  • 120
5
votes
2 answers

Using the openpaths.cc API with R

I tried to pull my location data from openpaths.cc to use it with R. The API uses OAuth and is documented here, however, it only provides an example in Python. After looking around how to handle OAuth (which I am barely familiar with) in R, I…
Jemus42
  • 629
  • 9
  • 24
5
votes
1 answer

reading raw data in R to be saved as .RData file using the dropbox api

Having worked out the oauth signature approval system, for dropbox, I wanted to download an .RData file that I had saved there, using the API, and httr's GET function. The request was sucessfull and comes back with data, but it is in a raw format,…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
5
votes
1 answer

R + httr and EC2 api authentication issues

I would like to use the R package httr to access the EC2 services via their API. But I am a little bit unsure how to get started as it does not fall into the usual authentication format of "Oauth2.0" in which you have the usual: key, secret, token…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
5
votes
2 answers

Oauth authentification to Fitbit using httr

I'm trying to connect to the fitbit api using the httr library. Using the examples provided, I came up with the following code: library(httr) key <- '' secret <- '' tokenURL <-…
Yann Abraham
  • 330
  • 3
  • 11
4
votes
3 answers

Retrieve pictures from API with R

I have never worked with APIs so this is my first try, I don't even know if what I'm trying to do is possible. I'm trying to obtain pictures of cells from the SwissBioPics API (https://www.npmjs.com/package/%40swissprot/swissbiopics%2Dvisualizer)…
CodingBiology
  • 262
  • 4
  • 13
4
votes
1 answer

Querying IMF API with imfr - error no result/does not accept filter

I am currently trying to download a particular series from the Direction Of Trade Statistics at the IMF for a calculation of trade volumes between countries. There is a r-package imfr that does a fantastic job at doing this. However, when going for…
Datapumpernickel
  • 606
  • 6
  • 14
4
votes
3 answers

Formulating POST request to CoinSpot API

I am pulling my hair out trying to query the CoinSpot API. The endpoint for the Read Only API is: https://www.coinspot.com.au/api/ro The documentation states: All requests to the API will need to include the following security data. Headers: key -…
timothyjgraham
  • 1,142
  • 1
  • 15
  • 28
4
votes
1 answer

specify timeout time in a POST or GET request with httr using r

I am running several scripts to post and retrieve data using the httr package. Occasionally, one of the jobs will just stall and never complete. This causes problems when other scripts assume that this script has completed. The stalling is due to…
Jagge
  • 938
  • 4
  • 21
4
votes
2 answers

Authenticate using httr package when Making API Requests

I'm learning how to fetch data using an API in R. I understand that the aim of httr is to provide a wrapper for the curl package. The documentation I'm following so that I make requests to the API has the following HTTP request format. This code…
andy
  • 1,947
  • 5
  • 27
  • 46
4
votes
1 answer

Fill in web form, submit and download results

I am wanting to fill in a web form and submit my query and download the resulting data. Some of the fields have the option of a drop-down menu or typing in a search query, sections can also be left blank (if all sections are left blank the entire…
flee
  • 1,253
  • 3
  • 17
  • 34
4
votes
1 answer

Formatting POST body with httr in r

I am trying to change a contact property value in hubspot. documentation: https://developers.hubspot.com/docs/methods/contacts/update_contact This item lives in a series of data frames that are encoded in JSON(see GET request below) I have tried a…
Luke Holcomb
  • 165
  • 1
  • 8