Video není dostupné.
Omlouváme se.

How to work with APIs using R (httr2 package tutorial)

Sdílet
Vložit
  • čas přidán 19. 08. 2024

Komentáře • 12

  • @ggnot2
    @ggnot2  Před 6 měsíci +1

    Hi everyone! Hadley Wickham suggested some awesome improvements to the code featured in this video. Please use the code on GitHub rather than what's in the video :) Link to the code that should be used: github.com/melissavanbussel/CZcams-Tutorials/blob/main/httr2/httr2_examples.R
    The changes are:
    - Using the req_url_path_append() function rather than pasting things together with the paste0() function
    - Define the access tokens as system environment variables and access them using Sys.getenv() rather than including the tokens directly in the script (for instructions on how to set your Open AI API key as a system environment variable, check this video here at timestamp 30:34 - czcams.com/video/tqfOgWr0PAY/video.htmlsi=GEERk28_m4tyDXab&t=1835)
    - Using the req_auth_bearer_token() function to greatly simplify working with access tokens

  • @transportation-talk
    @transportation-talk Před 7 měsíci

    Thanks a lot for taking the time to create this tutorial. I wish I had this tutorial before digging into the Firebase API and using it in R.

  • @home1250
    @home1250 Před 7 měsíci

    Great work, thank you for sharing this tutorial! I've been wanting to learn more about working with APIs using R. Your explanations and instructions made it easy to follow along. Looking forward to trying it out myself. Keep up the great work!

    • @ggnot2
      @ggnot2  Před 6 měsíci

      Thanks for the support and kind words!

  • @rappa753
    @rappa753 Před 7 měsíci

    Great job, Melissa! Calling APIs is hard at the beginning and I feel like there are not many R resources about that.

  • @grzegorzklaczak3365
    @grzegorzklaczak3365 Před 6 měsíci

    Thank you! Great work, helped a lot

  • @AngelFelizF
    @AngelFelizF Před 7 měsíci

    This is great tutorial, thanks for sharing

  • @meme31382
    @meme31382 Před 7 měsíci

    beautiful

  • @DaarShnik
    @DaarShnik Před 7 měsíci

    You could use a method called request append to append url path... You don't get paste function to do it.

    • @ggnot2
      @ggnot2  Před 6 měsíci

      Thanks! Code has been updated to avoid paste0 :)

  • @apshinyn
    @apshinyn Před 6 měsíci

    Very nice intro - any plans to cover more complex auth interactions such as PKCE?

    • @apshinyn
      @apshinyn Před 6 měsíci

      For future reference, here is the way I figured out how to make code challenges for PKCE!
      make_challenge %
      charToRaw() %>%
      openssl::sha256() %>%
      openssl::base64_encode() %>%
      str_replace_all("=", "") %>%
      str_replace_all("\\+", "-") %>%
      str_replace_all("/", "_")
      }