1,054 questions
-1
votes
1
answer
202
views
Make an API request in R [closed]
First time trying to do database stuff in R. I want to access a weather database to get weather data. Was following this guide
https://www.geeksforgeeks.org/r-language/access-collect-data-with-apis-in-...
1
vote
0
answers
20
views
OAuth 2.0 Connection Giving a CSRF Error (Using httr)
I am attempting to connect to the QuickBooks Online (QBO) API and when I try to connect I get this error in the browser:
The state query parameter is missing from the authorization request
And then ...
0
votes
0
answers
80
views
Download satellite data using http::GET but the files are incomplete
I'm trying to download lots of satellite data from a government website. When I download each file individually, by manually clicking the download button on the site, the files are about 13 MB each. ...
0
votes
1
answer
89
views
Nested elements in body for REST API using R package httr
I would like to use the REST API of the Canvas Learning Management System to make changes to quizzes students make via the system. I use the R package httr for this. This generally works fine using ...
1
vote
1
answer
87
views
Status code in httr2 when uploading a file that already exists
I'm using the R package httr2 to upload files to a secure environment. If a file already exists, I'd like to receive a warning. Instead, I get a response status of 200 which, means "OK". ...
0
votes
0
answers
67
views
Is there an httr2 equivalent to httr::upload_file?
I'm trying to use REST APIs to upload files to a cloud repository. I've found I can't do this without using the httr upload_file function. The following code works:
req <- request(url) %>%
...
0
votes
1
answer
70
views
PDF URL opens in a browser, but I can't get it with httr [closed]
When I open this URL in the browser:
https://processo.stj.jus.br/processo/dj/documento/?=&sequencial=300060606&num_registro=202500087810&data=20250313&data_pesquisa=20250313&...
1
vote
1
answer
102
views
Unable to retrieve response content from network tab with httr GET request in R
I'm tying to retrieve data from here. Basically game data that are inside a GET request that I've managed to identify here:
In the headers tab I can find the requested info so I do the following:
url&...
4
votes
1
answer
150
views
Decode output from GET request in R
I'm trying to pull some data using httr::GET but the problem I am facing now is that the response seems to be encoded and I am not sure how I can solve this.
Here is the url of historical data on ...
1
vote
0
answers
324
views
GET request to an API endpoint comes back as 403 forbidden even with headers using httr package in R. (works in browser)
I obtained an API endpoint url from inspection of a webpage. That endpoint is: "https://www.sofascore.com/api/v1/sport/esports/scheduled-events/2025-03-14". If I copy and paste this into a ...
0
votes
1
answer
83
views
Convert JSON type scraped string to dataframe in R [closed]
I am trying to pull team names and odds from this webpage : https://www.winamax.fr/paris-sportifs/sports/1/48/162285
I have found that the data is dynamically rendered via JavaScript.
library(dplyr)
...
0
votes
0
answers
128
views
Error: package or namespace load failed for ‘eurostat’ there is no package called ‘httr2’
I tried installing the package "eurostat" and I keep getting this error:
install.packages("eurostat")
library(eurostat)
Error: package or namespace load failed for ‘eurostat’ in ...
0
votes
1
answer
89
views
R httr API query implementation
I have only used wrappers to access this httr library in the past and could use help with a new pull from the courtlistener API. This code (below) retrieves records, but does not use the query items:
...
3
votes
0
answers
198
views
In R POST request OpenAI API Error in curl::curl_fetch_memory()
This is my code:
A simple POST() request to OpenAI API:
# General API completion endpoint
endpoint <- "https://api.openai.com/v1/chat/completions"
# Combine a Prompt with the document
...
1
vote
3
answers
2k
views
A call to DeepSeek API in R returns 401 error despite correct api-key
I am trying to chat from DeepSeek from R, and here is the code I use (since this model is not supported by {ellmer} or {tidyllm}.
Here is my code:
library(httr)
library(jsonlite)
# Set your DeepSeek ...
1
vote
1
answer
80
views
Indicate several curl options via httr::config(ssl_options = c(LIST OF SEVERAL CURLSSLOPT_) )
How to pass several libcurl options via httr::config(ssl_options = ...), please ?
My primary goal is to indicate these 2 arguments : CURLSSLOPT_AUTO_CLIENT_CERT and CURLSSLOPT_NATIVE_CA, in order to ...
0
votes
0
answers
281
views
differences in httr vs httr2 output
Lets consider two ways to make a call to API - via httr and httr2 as suggested by @ismirsehregal and @ifeanyi-idiaye in this topic
library(httr)
library(httr2)
library(jsonlite)
library(tidyverse)
# ...
0
votes
0
answers
118
views
How can I open an .xlsx file from a shared OneDrive's link into R?
I'm working remotely and having an issue about a downloaded .xlsx file from a OneDrive's colleague. I was tired to download the .xlsx file daily from his OneDrive so I tried a code to get around this ...
0
votes
1
answer
286
views
How to connect to the Copernicus Land Monitoring Service API with R
I am trying to connect to the CLMS API in order to download data with R. I have already created a token, and saved it in the file land-copernicus.json.
Here is my attempt to connect:
## Connection
# ...
1
vote
1
answer
125
views
Date parameter errors with Weather.gov API
I am trying to pull historical weather data using the National Weather Service API:
library(httr)
library(jsonlite)
# Define the base URL for the NWS API
base_url <- "https://api.weather.gov&...
0
votes
2
answers
220
views
Using hidden API to scrape website with JavaScript pager
Website https://www.supralift.com/uk/itemsearch/results uses a JavaScript based pager which doesn´t expose any parameters in url which I could alter and navigate this way through the website.
Looking ...
2
votes
1
answer
71
views
Identifying why scraping a website only works for POST request body strings and not others
I am looking to scrape publicly available tables from New York's electricity grid at this url: http://icap.nyiso.com/ucap/public/auc_view_spot_detail.do
I'm able to do so for summer seasons but not ...
0
votes
0
answers
148
views
Can I change the version of curl R is using?
Using a Windows machine with multiple versions of curl installed, can I change which version is used by the R httr package (which wraps the curl R package)?
If I check Sys.which('curl') to confirm the ...
0
votes
1
answer
251
views
Download file by using R [duplicate]
I have this url : "https://www.kaggle.com/datasets/nelgiriyewithana/most-streamed-spotify-songs-2024/download"
I want to download the dataset from the url , but I failed... knowing it should ...
0
votes
2
answers
51
views
rvest - error 403 from computer A but not computer B (same network)
Until few weeks ago, I was able to periodically run a script to scrape https://unjobs.org from my Lubuntu 20.04 machine.
Ever since I installed a fresh 24.04 from scratch, rvest gives me a 403 when ...
0
votes
1
answer
69
views
How can I see Chrome Network activity i R? [httr, selenium?]
I'm wondering how I can in R visit a website and see the Network activity and responses as I would in Google Chrome and copy their associated attributes as url?
Dont even know where to start but I ...
1
vote
0
answers
122
views
Extract data from api to data frame in R
First, I am very new to api stuff, so maybe the solution is simple.
I have access to the Danish Erhvervsstyrelsen's api for enterprise data (CVR information from virk.dk). They use elastic.
The ...
1
vote
2
answers
103
views
Collect URLs from list in R using a for loop [closed]
I have a list of URLs collected from Twitter. All of the URL are shortened (like bit.ly, buff.ly, etc.), and I need the full link with the domain name for some analysis I'll be doing down the road. ...
-1
votes
1
answer
113
views
How to scrape Amcharts interactive data using R
I'm trying to retrieve data from the following link but I've noticed that the data is in an interactive Amcharts 1.1.
I can't find the best parameters for the GET or POST method. I think the website ...
2
votes
2
answers
260
views
Extracting data from API with R
I am trying to extract data from Philadelphia's public transit API using the httr2 package.
I load the packages and call the API in the code below
library(tidyverse)
library(httr2)
septaURL <- '...
0
votes
0
answers
123
views
HTTR GET request not working - SSL peer cert not ok
I have a simple script that sends a GET request to my store's ecom API. I have tried to make this call in R, Python and cURL and all 3 return a similar error:
Error in curl::curl_fetch_memory(url, ...
1
vote
1
answer
72
views
Multiple scraping with R
Trying to scrape many pdfs using R.
I've found multiple examples on how to do this (here's one; here's another), but I can't find a way to do it.
I want to download files from the following main site
...
0
votes
2
answers
174
views
How to pass the progress from API call to waiter
I would like to capture the progress of the API call and update the waiter. This does not display progress on the UI end. not sure why. If I remove the If, just have a for loop, the API calls ...
1
vote
1
answer
62
views
httr package POST function times out when using the same headers as my browser
I am trying to download a file off of a web site using the httr package in R. This is the web site:
https://www.franklintempleton.com/investments/options/exchange-traded-funds/products/91616/...
0
votes
3
answers
68
views
How to post data to firestore avoiding non-existent documents?
I have a data structure similar to this that I want to post to firestore database via REST API:
I manually created the House1 document, then Floor1 and Ground.
Ground contains the data:
REST API in ...
0
votes
2
answers
857
views
Extracting PDF's from EDGAR database
Trying to extract the information from the PDF located here: https://www.sec.gov/Archives/edgar/data/784028/000078402823000002
However, even though this is an open API, it appears that the SEC blocks ...
0
votes
0
answers
351
views
Twitter API access using R's http
I am tearing my hair out over this issue! I am pretty confident I am using the correct bearer token (I have reset this to check), I also have paid API access for twitter. I also don't believe I am ...
0
votes
0
answers
40
views
how to convert this Curl code into R code?
I have this Curl code below which runs fine in https://reqbin.com/curl:
curl -X POST https://historicdata.website.com/api/DownloadListOfFiles
-H 'content-type: application/json'
-H 'ssoid: ...
0
votes
1
answer
286
views
Setting up the inoreader API in R
I am attempting to access the inoreader API in R using the httr package. So far I am failing because of my limited understanding of how an API request work. I was wondering if anyone could help me to ...
1
vote
1
answer
519
views
Request httr2 to download pdf doesn't work
I would like to web scrape some pdf documents which are created with a onclick button. In my previous question @margusl gave a really great answer to download these pdfs. Unfortunately this doesn't ...
1
vote
0
answers
371
views
R HTTR::POST Linkedin API upload image using uploadUrl add binary file in body / or httr::upload_file
I'm using R 4.1.2 and HTTR 1.4.7 to publish in Linkedin personal feed.
So I have followed the steps shown by Linkedin and Microsoft, here.
I have been able to create a share without media.
...
0
votes
0
answers
407
views
Saving openAI TTS API response with R programming
HTTR2 does a great job of calling the OpenAI TTS (text to speech) API. However, I am having trouble saving the response from the API in an audio format. Since the API is "new" and Rpackages ...
1
vote
0
answers
38
views
Column types incorrect when using an API in R
I'm using an API to pull data from a chemically aware database into R. I'm using the httr library and when the query is ready I GET() the data and extract the contents into a df called rawdata:
...
0
votes
1
answer
337
views
R equivalent for Python http request
I currently made a request to get data from an API using Python, which works correctly. I'm trying to make an equivalent code in R but when I run it it doesn't work, does anyone know why this happened?...
0
votes
3
answers
231
views
R rvest read_html() returns almost empty page
I want to scrape links to ads on this page: https://reality.idnes.cz/s/?page=1 usin R, rvest and httr packages. It returns results which I do not understand.
The code is:
link <- "https://...
1
vote
1
answer
215
views
how do i call the amazon selling partner API from R?
i am trying to retrieve data from the amazon sp api using the httr package.
what i did so far is:
(0) prerequisites
library(httr)
library(httr2)
library(jsonlite)
library(lubridate)
(1) defined data ...
0
votes
1
answer
360
views
How to efficiently download multiple files from SharePoint using R
I have an Excel file containing a list of 10,000+ documents (PDFs and Word document) that I aim to download. Each file is linked to a SharePoint URL.
My goal is to devise a script in R that can ...
0
votes
0
answers
33
views
How can I pass a pasted character object into a POST command in R
I need to iterate through a series of webpages using Zyte (a rotating proxy service). I used a curl converter to convert Zyte's instructions to an R friendly command. Unfortunately, when I try to ...
1
vote
1
answer
571
views
Is there a way to download a file from httr::POST in R?
I am trying to download a file which is returned from an HTTP POST call (to an API I have no control over).
I have the following curl command which does what I am trying to, submit the custom json ...
0
votes
1
answer
168
views
How do I use Zyte with HTTR in R
I need to use a rotating proxy IP service and opted to go with Zyte as that's what we used in my former company. I'm having trouble using the Zyte API with R. I've been messing with it for three or ...