Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rcrossref is not returning answer giving issues about curl_fetch_memory #229

Open
covid19ec opened this issue Mar 24, 2022 · 4 comments
Open

Comments

@covid19ec
Copy link

Hi all. I am using rcrossref to get some values using ISSN. The code is very simple and yesterday I ran it a couple of times and worked. Now, I am re running the same code and I am getting an error. This is the code:

library(rcrossref)
library(tidyverse)
library(usethis)
library(listviewer)
#Code
vals <- rcrossref::cr_journals(issn = "1139-1979",
                               works = T,
                               limit = 25,
                               flq = c(query.author = "OLLER")) %>%
  purrr::pluck("data")

And I am getting this error:

Error in curl::curl_fetch_memory(x$url$url, handle = x$url$handle) : 
  Timeout was reached: [api.crossref.org] Connection timed out after 10013 milliseconds

I am using the dev version of rcrossref but I do not what is happening because yesterday it worked. I would like to know if there is a limit on the query number you can send, or how I could avoid this issue. My sessionInfo() is next:


R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] readxl_1.3.1       xlsx_0.6.5         listviewer_3.0.0   usethis_2.1.5     
 [5] forcats_0.5.1      stringr_1.4.0      dplyr_1.0.7        purrr_0.3.4       
 [9] readr_2.1.1        tidyr_1.1.4        tibble_3.1.6       ggplot2_3.3.5     
[13] tidyverse_1.3.1    rcrossref_1.1.0.99

loaded via a namespace (and not attached):
 [1] httr_1.4.2        jsonlite_1.7.2    modelr_0.1.8      shiny_1.7.1      
 [5] assertthat_0.2.1  triebeard_0.3.0   urltools_1.7.3    xlsxjars_0.6.1   
 [9] cellranger_1.1.0  yaml_2.2.1        pillar_1.7.0      backports_1.3.0  
[13] glue_1.5.1        digest_0.6.28     promises_1.2.0.1  rvest_1.0.2      
[17] colorspace_2.0-2  htmltools_0.5.2   httpuv_1.6.5      plyr_1.8.6       
[21] pkgconfig_2.0.3   httpcode_0.3.0    broom_0.7.10      haven_2.4.3      
[25] xtable_1.8-4      scales_1.1.1      later_1.3.0       tzdb_0.2.0       
[29] generics_0.1.2    ellipsis_0.3.2    DT_0.21           withr_2.5.0      
[33] cli_3.1.0         magrittr_2.0.1    crayon_1.5.0      mime_0.12        
[37] evaluate_0.15     fs_1.5.2          fansi_0.5.0       xml2_1.3.3       
[41] tools_4.1.2       hms_1.1.1         lifecycle_1.0.1   munsell_0.5.0    
[45] reprex_2.0.1      ggsci_2.9         compiler_4.1.2    rlang_1.0.2      
[49] grid_4.1.2        rstudioapi_0.13   htmlwidgets_1.5.4 miniUI_0.1.1.1   
[53] rmarkdown_2.13    gtable_0.3.0      DBI_1.1.1         curl_4.3.2       
[57] reshape2_1.4.4    R6_2.5.1          lubridate_1.8.0   knitr_1.37       
[61] fastmap_1.1.0     utf8_1.2.2        shinythemes_1.2.0 rJava_1.0-5      
[65] stringi_1.7.5     crul_1.2.0        Rcpp_1.0.7        vctrs_0.3.8      
[69] dbplyr_2.1.1      tidyselect_1.1.2  xfun_0.28        
@njahn82
Copy link
Member

njahn82 commented Mar 24, 2022

Hi, many Crossref services including the API are currently down: https://twitter.com/CrossrefSupport/status/1506898745484406786

Not sure when the API is back.

@njahn82
Copy link
Member

njahn82 commented Mar 24, 2022

See also here:
https://status.crossref.org/incidents/gwxd1yqdw304

@covid19ec
Copy link
Author

@njahn82 Many thanks for the advice. Maybe could you help me with another question? How many requests (for example) can I send to the API? Is there a limit for that?

@njahn82 njahn82 mentioned this issue Nov 9, 2022
@njahn82
Copy link
Member

njahn82 commented Nov 12, 2022

Hi @covid19ec , calling verbose = TRUE gives you some more information about your request, including rate limits. Usually, you should be able to perform 50 requests a second.

rcrossref::cr_works("10.1037/0003-066X.59.1.29", verbose = TRUE)
< x-ratelimit-limit: 50
< x-ratelimit-interval: 1s
< x-api-pool: polite
< x-rate-limit-limit: 50
< x-rate-limit-interval: 1s
< permissions-policy: interest-cohort=()
< connection: close
< 
* Closing connection 1
$meta
NULL

$data
# A tibble: 1 × 29
  alternative…¹ conta…² created depos…³ publi…⁴ doi   indexed issn  issue issued
  <chr>         <chr>   <chr>   <chr>   <chr>   <chr> <chr>   <chr> <chr> <chr> 
1 2004-10043-0Americ2004-02020-02004    10.12022-119351     2004  
# … with 19 more variables: member <chr>, page <chr>, prefix <chr>,
#   publisher <chr>, score <chr>, source <chr>, reference.count <chr>,
#   references.count <chr>, is.referenced.by.count <chr>, subject <chr>,
#   title <chr>, type <chr>, url <chr>, volume <chr>, language <chr>,
#   short.container.title <chr>, author <list>, link <list>, reference <list>,
#   and abbreviated variable names ¹​alternative.id, ²​container.title,
#   ³​deposited, ⁴​published.online
# ℹ Use `colnames()` to see all variable names

$facets
NULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants