How to use a real API in your web app (rapidAPI tutorial)

Поділитися
Вставка
  • Опубліковано 27 сер 2024

КОМЕНТАРІ • 134

  • @DoubleDYouTube
    @DoubleDYouTube  2 роки тому +3

    If you want to learn how to monetize your API:
    ua-cam.com/video/ZvX99V0Xfho/v-deo.html

    • @DoubleDYouTube
      @DoubleDYouTube  Рік тому +1

      @@Whatsappvideo95R nope, they're correct

    • @Whatsappvideo95R
      @Whatsappvideo95R Рік тому

      do a lesson with getting an object from an array. in your lesson you can get only object

  • @YolandaTheGardener
    @YolandaTheGardener 3 роки тому +16

    This was exactly what I needed to see when connecting an API to Javascript. Thanks so much.

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому +1

      I'm glad I could help!

    • @YolandaTheGardener
      @YolandaTheGardener 3 роки тому +2

      @@DoubleDUA-cam You literally made this so easy for me to understand. I've been trying to get an API connected all week.

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому +1

      @@YolandaTheGardener That's great! I wish you good luck on your web dev journey.

  • @stoyansarov2647
    @stoyansarov2647 Рік тому +6

    You are a legend sir... I've watched tons of 2-3 hours API tutorials and other info and neither was as helpful as yours. I can finally understand APIs and how to connect them to my project. Kuddos to you!

    • @DoubleDYouTube
      @DoubleDYouTube  Рік тому

      That's awesome to hear, I'm glad I could help!

    • @thesecretnvolia
      @thesecretnvolia 11 місяців тому

      X 2

    • @dharsanv3366
      @dharsanv3366 9 місяців тому

      @@DoubleDUA-cam Sir what about POST method endpoints like a google translate can you explain

    • @DoubleDYouTube
      @DoubleDYouTube  9 місяців тому

      @@dharsanv3366 POST endpoints require sending some data to the server and each one works differently. Use google to see an example of a POST endpoint, or if you need help implementing custom code, message me on Fiverr.

  • @codingprograms2078
    @codingprograms2078 3 роки тому +2

    I can't help but to say it again clear and concise. If you don't understand apis after this I don't know what to tell you.

  • @kidmyn
    @kidmyn 2 роки тому +4

    Finally, a video that is clean and clear. Thank you!

  • @asfgsadfas
    @asfgsadfas Рік тому +3

    Proper practices for hiding API keys perhaps in a backend environment and how that's set up in vs code would definitely be an interesting video. I found this one very helpful, been scratching my head over APIs for awhile, thanks for posting !

  • @babycheeks.4335
    @babycheeks.4335 7 місяців тому

    Very simple and nice way to get to use an API. Thank you !

  • @jondisla
    @jondisla 3 роки тому +4

    You are a great source thanks for the tutorial, Keep up the great videos...SUBSCRIBED!

  • @codingprograms2078
    @codingprograms2078 3 роки тому +7

    This is how you break down the elephant in the room.

  • @serkandiner2784
    @serkandiner2784 Рік тому

    Definitely , this video answered all question about API and help me to build my website using API. Thanks a lot for that

  • @bechemgaston6039
    @bechemgaston6039 2 роки тому +1

    simple but wonderful. Thanks Mr Double D

  • @diwakarr5425
    @diwakarr5425 2 роки тому

    Awesome tutorial for Api Beginners using RapidApi . . .

  • @yozora0ryuu239
    @yozora0ryuu239 Рік тому

    This was a quick and informative video. Thank you for the content.

  • @Harvyss
    @Harvyss 3 місяці тому

    Thanks for the video, I learnt too much!

  • @Exendes
    @Exendes Рік тому +4

    I dont get it. You cut the most important part which is to show how to get the response on the actual webpage

    • @DoubleDYouTube
      @DoubleDYouTube  Рік тому

      I showed exactly how to get the response, step by step. I don't know what you mean by this comment.

    • @llicit1833
      @llicit1833 Рік тому +2

      Good video but I had the same thought. Everything was very clear but then went from showing the data in the console log to showing it in the browser without explaining how that actually happened. I guess it will be in index.html but would have been better to show how this file was modified to show the retrieved content. Otherwise excellent though

    • @llicit1833
      @llicit1833 Рік тому +2

      So I looked at the source files, and now can see the index.html modification required. Admittedly pretty simple but still would be good to include in the video given it is aimed at beginnners etc

  • @cuzzo9146
    @cuzzo9146 5 місяців тому +1

    when a user uses your app do they have to use their own API key? Because in my app that uses an external API it doesn't load data for the users on their devices and only on mine and i believe its because the API key is exclusive to my ip

    • @DoubleDYouTube
      @DoubleDYouTube  5 місяців тому

      No, the api key is not exclusive to your ip. If you setup everything correctly, it will for all users (with your api key).

  • @ramirorenteria7333
    @ramirorenteria7333 Рік тому

    Extremely useful. thank you!

  • @madsonmendes8842
    @madsonmendes8842 2 роки тому

    Thank you very much for the tutorial

  • @selenayeo4205
    @selenayeo4205 3 роки тому +1

    please help me out.. when i typed in .then(response => response.json()) and run the program. there's a SyntaxError on the console.error(err);

  • @jeri9260
    @jeri9260 5 місяців тому

    wowiie nice video, now I need to know about json

  • @artsworld9016
    @artsworld9016 4 місяці тому

    I would like to know about that bootstrap extension that you have used.

  • @robertudrea
    @robertudrea 3 роки тому +1

    Great tutorial!!!

  • @chrisder1814
    @chrisder1814 Місяць тому

    hello about the use of APIs I had some ideas, could you tell me what you think of them and if they are feasible

  • @Lupo150
    @Lupo150 Рік тому

    API with din currency? Buraz, pa svaka cast!

  • @sergeysokurenko845
    @sergeysokurenko845 2 роки тому

    great videos...SUBSCRIBED!

  • @simonhaesaert8175
    @simonhaesaert8175 8 місяців тому

    How do you put it into html. The content.

  • @Julukevin
    @Julukevin Рік тому

    So informative

  • @jaiharekrishna2132
    @jaiharekrishna2132 4 місяці тому

    Thanku so much

  • @maxdamiecki1935
    @maxdamiecki1935 Рік тому

    Why is my java script fetch code way different when I copy from the api website. I am trying to use the quote api

    • @DoubleDYouTube
      @DoubleDYouTube  Рік тому

      Every RapidApi user has different credentials in their request headers. This is to identify who made the request to that API.

  • @stockmarketinusa1251
    @stockmarketinusa1251 2 роки тому

    how to connect desktop application to website with database

  • @akptr2821
    @akptr2821 3 роки тому +1

    Great explanation!! Could you share a link that public api for covid-19 real time data? thanks

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому

      Thanks! I updated the description and put all the links there.

  • @frking3
    @frking3 Рік тому

    how to use cricket api on blogger kindly tell me?

  • @matijastojnic8191
    @matijastojnic8191 Рік тому

    Hvala ti brate puno

  • @chriscalver8595
    @chriscalver8595 Рік тому

    Great Vid Tks DD

  • @sachinkadam5570
    @sachinkadam5570 2 місяці тому

    It's good 👍

  • @dharsanv3366
    @dharsanv3366 9 місяців тому

    Wt about POST endpoints ?

  • @dharsanv3366
    @dharsanv3366 9 місяців тому

    can you explain about twitter api in this website it has many endpoints ?

    • @DoubleDYouTube
      @DoubleDYouTube  9 місяців тому

      Each endpoint should have a description and tell you what it does. You most likely only need GET endpoints.

  • @user-rq9zl6nk6e
    @user-rq9zl6nk6e 10 місяців тому

    Nice Sir Thanks

  • @raswithanarla5889
    @raswithanarla5889 3 роки тому

    hey i have asked to fetch the data from the 3rd party server and asked to use that on my student edit profile web application for that which API I should use in the rapid api.

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому

      I don' know, it depends on what you want to do. Maybe you can fetch some interesting and educational data about your college/branch of studying... or you can fetch how many people in the world are named same as you, if you want it to be entertaining.
      Just explore the rapidapi website until you find something suitable :)

  • @nismaelagder4951
    @nismaelagder4951 2 роки тому

    Thank you man

  • @grigordanut844
    @grigordanut844 2 роки тому

    Hi. Can you make tutorial how to use the API using Ruby on Rails? I have difficulties in displaying the weather icon from a weather API. Thank you.

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому

      I've never used Ruby, so I can't help you there, sorry.

  • @CrazyAshu34
    @CrazyAshu34 11 місяців тому

    Maybe You can increase Your Font a little bit... it's hard to watch in mobile phone💁

  • @robertudrea
    @robertudrea 3 роки тому

    How can I upload this project to github as a repository, but hidding the config file? Is it possible?

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому +1

      That's a good question. Every github repository has a gitignore file, make sure to include your config filename in the gitignore file to ensure that it's not tracked/committed/pushed.
      For more info, google 'github and api keys', a bunch of helpful articles show up. :)

    • @robertudrea
      @robertudrea 3 роки тому +1

      @@DoubleDUA-cam thank you, I’ll try this.

  • @vallydon1788
    @vallydon1788 2 роки тому

    Great tutorial Sir!. Can you please do a tutorial on how to use crypto API?

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому +1

      Thanks! I never used any crypto APIs, but the gist of it is explained in the video. No matter what the API is about, the idea is the same.

  • @MrGedanggoreng
    @MrGedanggoreng 2 роки тому

    Hi. Can you make tutorial how to use the API using PHP? I have diffculties in hiding the uneeded elements.

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому

      I don't have experience with PHP, so I can't help you with that.
      However, PHP is a server side technology. This means that it isn't publicly available and cannot be seen on the client for example. This means that you don't have to hide things like API keys and passwords.
      But if you're using any kind of version control system (e.g. Github), you should still separate your sensitive info in a separate config PHP class.

    • @MrGedanggoreng
      @MrGedanggoreng 2 роки тому

      @@DoubleDUA-cam Thanks for your reply. Any recommendations what programming language should I use in WordPress if I want to get API from RapidApi?

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому

      @@MrGedanggoreng I think PHP is your only choice for WordPress.

  • @weebthatlikesshitposts5527
    @weebthatlikesshitposts5527 2 роки тому

    Thanks this was useful, say i want want to get a value i from user... and when the request is sent it should be like api url/ "i" What should I do , thanks

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому

      How you formulate a URL depends on the specific API you choose.
      For example, let's say you're using a COVID api and you want to get data for a specific country. Your URL might look something like this:
      MyCovidApi.com/data?country=Italy&month=September
      This way, you're passing the arguments directly through the URL.
      You're saying you want to get COVID data for Italy and for the month of September.
      This is how you will form your URL depending on the user input that you get.

  • @retagif
    @retagif 3 роки тому

    Would you be kind enough to teach us how to hide an API key in javascript?

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому +1

      The basic thing you can do is what I showed in the video. Make a separate CONFIG file where you define your sensitive data (passwords, API keys, etc.) and in your main code, use those constants (variables). Later on, when publishing the code on GitHub (or anywhere else), just don't include the config file. For GitHub, you can include your config filename in the .gitignore file, which will make sure to ignore it when pushing code onto your repository.
      Another common practice is to use so-called environment variables in JavaScript. Store your constants and their values in .ENV files, then use them with "process.env.variable_name" in your code. Same thing about .gitignore applies to ENV files.

  • @lolloler4555
    @lolloler4555 2 роки тому

    Very nice tutorial. I have one question, do you know how to dockerize this web app? Lets say i only use the covid api in my app and i want to dockerize it. How can i do that ?

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому

      If you want to dockerize your app, then you probably shouldn't build a web app (browser), you need a NodeJS app (it runs using node, not the browser).
      I don't know much about docker, but I assume you would have to create a docker file in your base folder. And then you set your entrypoint in the dockerfile, deploy it using whatever hosting service you prefer and that's it.
      Perhaps this article can help you: nodejs.org/en/docs/guides/nodejs-docker-webapp/

    • @lolloler4555
      @lolloler4555 2 роки тому +1

      @@DoubleDUA-cam okay thank you a lot for the quick answer.

  • @miljandjordjevic5354
    @miljandjordjevic5354 3 роки тому

    Oplodi me Dodiću!!! ❤️❤️❤️

  • @albertosambrotta776
    @albertosambrotta776 3 роки тому

    Really great tutorial, but i'm having some trouble. I'm trying to use an IMDb API, i follwed your tutorial but in the console i keep getting the error "Failed to load resource: net::ERR_FILE_NOT_FOUND" and i don't know how to solve it

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому

      That specific API might not be working. Have you tried another one?
      Can't tell you much with just that error message, all it tells you is that a resource was probably deleted or something.

    • @albertosambrotta776
      @albertosambrotta776 3 роки тому

      @@DoubleDUA-cam i resolved by changing some attributes from the script tag, thanks anyway✌🏻

    • @realfire9614
      @realfire9614 3 роки тому +1

      @@albertosambrotta776 I got the same error, what exactly did you change?

  • @elearningbyali3474
    @elearningbyali3474 3 роки тому

    It is a great tutorial of API. However, everything is working fine on the console but it is not showing anything on the browser. I have just downloaded your source file and there is also this problem.

    • @elearningbyali3474
      @elearningbyali3474 3 роки тому

      It is working now. Thanks

    • @mikewellick557
      @mikewellick557 2 роки тому

      @@elearningbyali3474 how did you fix it?

    • @oluwatimilehinatobatele3873
      @oluwatimilehinatobatele3873 2 роки тому

      @@mikewellick557 you just have to put the response into your html. Save a variable for the part of the json object you want to display on the page.

  • @shubhamh7451
    @shubhamh7451 3 роки тому +2

    damn bruhh, this some cool shit!

  • @MayankCodes
    @MayankCodes 3 роки тому

    How to connect android api?? I have searched everywhere but very few tutorials on this

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому

      What do you mean by android api?

    • @MayankCodes
      @MayankCodes 3 роки тому

      @@DoubleDUA-cam to use this api in java

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому +1

      @@MayankCodes If you actually watched the video, you would know. The rapidAPI website gives you an option to choose a programming language.

    • @MayankCodes
      @MayankCodes 3 роки тому

      Yaa.. i have watched.. what i am saying is i am not getting the url in which data is given in json format

    • @DoubleDYouTube
      @DoubleDYouTube  3 роки тому +1

      @@MayankCodes Then you need to find a way to parse JSON data from the response (JSON() function from js, but in java). A google search should help.

  • @boymatin5845
    @boymatin5845 Рік тому

    Bootstrap is not necessary! Sure it makes it easier in the beginning, but you may pay for it later!

  • @hungphung6738
    @hungphung6738 3 роки тому

    nice

  • @JoseDavidGaitan-s2b
    @JoseDavidGaitan-s2b 28 днів тому

    yo !!

  • @sumodsivadas6959
    @sumodsivadas6959 3 роки тому +1

    Keep posting these stuffs, we want real world tuts, not hello worlds

  • @mubarakakinsola8498
    @mubarakakinsola8498 3 роки тому

    👍🏾

  • @Bri-mf3tm
    @Bri-mf3tm 2 роки тому

    CSS is an important part of the tutorial for beginners. Skipping the CSS portion takes away value from this tutorial.

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому +2

      It is important, but it wasn't the focus of this video and I wanted to keep it as short as possible.

  • @abdullahhagos9833
    @abdullahhagos9833 2 роки тому

    Thanks for the tutorial. I'm doing the exact code as yours for covid19 api but i'm getting this error: Uncaught TypeError: document.querySelector(...) is not a function
    at HTMLSelectElement.document.querySelector.onchange

    • @DoubleDYouTube
      @DoubleDYouTube  2 роки тому

      As far as I can see, there's no "document.querySelector" in the example I showed.
      I can't really help you without seeing your code.

    • @abdullahhagos9833
      @abdullahhagos9833 2 роки тому

      @@DoubleDUA-cam I used document.querySelector instead of document.getElementById.
      Here is a snippet of my code:
      select a country

      New confirmed cases:
      Total confirmed cases:
      New deaths:
      Total deaths :
      Last updated:

      let covid19data
      (function onLoad(){
      getLatestCvoid19Data();
      setButtonFunction();
      })();
      function setButtonFunction(){
      document.querySelector('.countries').onchange = function() {

      const selectedValue = document.querySelector('.countries').value;
      const countryData = covid19data.filter(c => c.country == selectedValue)[0];

      const newConfirmed = document.querySelector('.covidNewConfirmed');
      const totalConfirmed = document.querySelector('.covidTotalConfirmed');
      const covidNewDeaths = document.querySelector('.covidNewDeaths')
      const covidTotalDeaths = document.querySelector('.covidTotalDeaths');
      const lastUpdated = document.querySelector('.covidLastUpdate');
      countryData.cases.new ? newConfirmed.innerHTML = 'New confirmed cases:' + countryData.cases.new : newConfirmed.innerHTML = 'New confirmed cases: 0'
      countryData.cases.total ? totalConfirmed.innerHTML = 'Total confirmed cases:' + countryData.cases.total : totalConfirmed.innerHTML = 'Total confirmed cases: 0'
      countryData.deaths.new ? covidNewDeaths.innerHTML = 'New deaths:' + countryData.deaths.new : covidNewDeaths.innerHTML = 'New deaths: 0'
      countryData.deaths.total ? covidTotalDeaths.innerHTML = 'Total deaths:' + countryData.deaths.total : covidTotalDeaths = 'Last updated: 0'
      lastUpdated.innerHTML = 'Last updated:' + countryData.day
      }
      }

    • @oluwatimilehinatobatele3873
      @oluwatimilehinatobatele3873 2 роки тому

      There's no jquery in the code

  • @simonhaesaert8175
    @simonhaesaert8175 8 місяців тому

    How do you put it into html. The content.