No video

Learn Fetch API In 6 Minutes

  Рет қаралды 1,274,795

Web Dev Simplified

Web Dev Simplified

Күн бұрын

Accessing data from an API is one of the most common things you will do in web development, and the way to access APIs is with fetch. Fetch is function built into JavaScript that allows you to query any URL/API to get back data. The most important part is that fetch is asynchronous so it will run in the background and let you know when it finishes using promises. In this video I will show you exactly how to use fetch, and all of the common mistakes people make using fetch so you can get up and running in just six minutes.
📚 Materials/References:
Fetch Article: blog.webdevsim...
Learn Promises In 10 Minutes Video: • JavaScript Promises In...
Async Await Tutorial: • JavaScript Async Await
🧠 Concepts Covered:
- What the fetch API is
- How to use the fetch API
- How to handle API response errors
- How to use JSON data with fetch
🌎 Find Me Here:
My Courses: courses.webdev...
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/Web...
CodePen: codepen.io/Web...
#Fetch #WDS #JavaScript

Пікірлер: 667
@sergiearruda443
@sergiearruda443 3 жыл бұрын
Be like Fetch, always succeed even when you fail
@rendoesmath
@rendoesmath 3 жыл бұрын
Two comment bots oof
@outside7
@outside7 3 жыл бұрын
The Trump of JavaScript. lol
@FrankUnderwoood
@FrankUnderwoood 3 жыл бұрын
That's deep man
@terry9873
@terry9873 3 жыл бұрын
@@outside7 no
@anonimous4798
@anonimous4798 2 жыл бұрын
@@terry9873 yes
@ProgrammingwithPeter
@ProgrammingwithPeter 4 жыл бұрын
Best 6 mins of KZfaq that I watched today
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thank you so much!
@whitecircle626
@whitecircle626 4 жыл бұрын
Programming with Peter 6:35
@rameshsrivastavachandra
@rameshsrivastavachandra 4 жыл бұрын
true
@FuknNoName
@FuknNoName 3 жыл бұрын
Agreed :)
@FurTuna13
@FurTuna13 4 ай бұрын
Indeed it is
@plaguegames3556
@plaguegames3556 3 жыл бұрын
At last someone who explains the reason behind every action. Most of the instructors just want us to copy paste and do not explain why we need to do sth, and what is the meaning of the action. Great Job 👍
@BrunoMCDowell
@BrunoMCDowell 2 жыл бұрын
Spot on!
@djkly1
@djkly1 2 жыл бұрын
I said this same thing 1/4 way through a previous vid.
@mohammadhisbullah9332
@mohammadhisbullah9332 9 ай бұрын
exactly so !
@kvncnls
@kvncnls 4 жыл бұрын
Took 6 minutes and now I can use Fetch for all of my JavaScript projects. Thank you!
@randalfjohn9848
@randalfjohn9848 2 жыл бұрын
Exactly
@sajaljaiswal1659
@sajaljaiswal1659 2 жыл бұрын
This channel is really helpful for people like me who had studied some web stuff before but didn't keep in touch with it. I really don't want to go over hours of lectures studying what I already know but have forgotten. Great resource.
@abdelazizelshrkawy5193
@abdelazizelshrkawy5193 Жыл бұрын
the mighty solution for every problem you are actually one of the best people who explain the problem or teach others in fantastic way which make the listener not only know the answer but to understand the details thank you I wish the best to you
@alexzimmerman3447
@alexzimmerman3447 2 жыл бұрын
100% the best JS videos I've found on KZfaq. You got me hooked with the Promise video, and now here we are! Thank you!!
4 жыл бұрын
Man! This is really web dev simplified! I enjoyed this video so much and it clarifies everything!
@petertester915
@petertester915 4 жыл бұрын
Your videos are invaluable, the direct effect you are having is bringing novice developers up the notches to an intermediate / advanced level. I have been using the fetch() method for a while now, but the in depth analasyis lets me connect the dots, enables me to become a better developer. Keep on going!
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
That is awesome! The goal with my channel is to help people understand new technology and tools better than they already do and I am so glad I am able to do that for you.
@StefanVanderVyver
@StefanVanderVyver Жыл бұрын
Sometimes it takes someone to use slightly different words in order for the explanation to land. I think you have a gift. Well done on this video, and step by step explaining the double promise in fetch. Also, simply by saying "you can use asynce/await OR then" you put so much clarity into my mind. Keep going.
@ranamuzamal9655
@ranamuzamal9655 3 жыл бұрын
One of the best tutorial of Fetching datta from API , i hhave searchout many here on google and youtube ,Really you are the best one
@manasnagelia
@manasnagelia 2 жыл бұрын
Absolute legend, banged my head on the keyboard for hours, until I found out I had to set the headers as application/json. Thank you.
@omarpervez5657
@omarpervez5657 2 жыл бұрын
Hi Kyle, My name is Omar. I have been following you for 1.5 years.I knew lots of things from you. Thank you so much for your all Videos 😍😍
@marlish6235
@marlish6235 2 жыл бұрын
Simple, clear and straight to the point. Excellent video.
@cllhicqani9678
@cllhicqani9678 Жыл бұрын
i have never seen a motivated helper like you. may god bless you. You made me understand what I was confused about it. the best video i've ever seen.
@jumboliah13
@jumboliah13 8 ай бұрын
Your style of teaching is fantastic. I hope somebody gave you some kind of award, you deserve it.
@bmac-cz6rk
@bmac-cz6rk 4 жыл бұрын
Its so amazing that I have been struggling with promises and the fetch api all week, reading docs and trying to grasp it, then this video shows up and clears all my problems away. Forever grateful to you Kyle! You gained my support today!
@ameyajoshi5673
@ameyajoshi5673 Жыл бұрын
OMG I quickly wanted to revise JS Fetch very quickly and this helped a lot. Awesome Video thanks!
@SuperQuwertz
@SuperQuwertz 3 жыл бұрын
Dude, youre a life saver. Best Channel for Webdevelopment on KZfaq.
@timucintarakc2281
@timucintarakc2281 Жыл бұрын
best java script channel in youtube. thank you very much. i actually wathed multiple videos on this before. you were the only one who expalined it very well.
@thomasviles8158
@thomasviles8158 3 жыл бұрын
Everything I search for as I learn Javascript,, this guy has the best videos. Thanks for all of the help man!!!
@mobigeek666
@mobigeek666 3 жыл бұрын
Thank you so much bro!!! I asked this guy to help me with the .then() method and he made a whole video!!! thank you so much. now i understand what goes on behind the scenes.
@CaptWindShear
@CaptWindShear Жыл бұрын
Thank you, sir, for not trying to blind me with science. It is convoluted enough as it is, but you made it make sense.
@SJY11
@SJY11 10 ай бұрын
In 6 minutes you covered basically everything you need to know about fetch! I love how explained the corner cases for every line (like why we use JSON.stringify or how .catch() only catches fetch-related errors) potentially saving us from many unexplained bugs and sleepless nights! Thank you so much, Kyle! You're the GOAT!
@fodecissokho9918
@fodecissokho9918 Жыл бұрын
This is by far the best tuto I've ever seen Eveything is detailed under just 6 minutes, Keep it up G👌👌👌👌
@noveltechmedia
@noveltechmedia 4 жыл бұрын
Great video, much better than reading the documentation. One thing that would also be interesting is if you showed how to use async and await with fetch. Keep up the good work :)
@uulecrocodile8437
@uulecrocodile8437 2 жыл бұрын
the best and most informative 6 minutes ever spent on KZfaq
@scyfox.
@scyfox. 2 жыл бұрын
Man, I lost hours today following a tutorial that has a mistake (or lack of explaining) but this was awsome to understand and follow along. I made a post in my personal blog linking back to you. Great content!!
@evanoffhandson7067
@evanoffhandson7067 11 ай бұрын
This guy's channel is awesome. Taking a $14,000 course right now and I still come to his videos for clarification.
@rishabbhattachaya6676
@rishabbhattachaya6676 9 ай бұрын
recently got into this channel and watching your recent videos compared to something older its amazing how far you've come. thank you for everything sensei
@davidspot191
@davidspot191 4 ай бұрын
Oh my, I really love this simplication 😍😍I've been trying to understand this from more than 3 videos but I was just watching and not even understanding it. Loved how you really break this down from the start. Thanks sooo much Dev 😄😄
@jgwilk
@jgwilk 4 жыл бұрын
the most simple, easy to understand explanation of fetch I've seen! Nice job 👏
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thanks!
@ghanashrim2839
@ghanashrim2839 3 жыл бұрын
I have been following your videos for a long time now, your voice is very soothing to hear man!
@pale-face
@pale-face 2 жыл бұрын
The best video on Fetch I have ever watched.
@gearzanimation
@gearzanimation 2 жыл бұрын
Literally the best code tutorials on the internet from this guy. SO GOOD!
@dharshan5309
@dharshan5309 2 жыл бұрын
Anyone tellme, we are checking if the response is ok in then but we are removing the res.Json. at 4:24 the data is undefined even when we are getting the successful fetch. How to get the data in json format
@alexlindgren1
@alexlindgren1 3 жыл бұрын
Really appreciate your videos man, so thankful for you giving them away for free. I'm already enrolled in another course, but if I'm not satisfied with what I'm going to learn about react I'll check out your course on that - I like the way you describe things so it's easy to understand of how it all comes together.
@kurtheimerman8267
@kurtheimerman8267 2 жыл бұрын
Exactly what I was thinking
@phamtienthinh1795
@phamtienthinh1795 11 ай бұрын
Thank you, I was struggling at header and body, this video is like my life savior
@SJY11
@SJY11 10 ай бұрын
Kyle, you're also one of the few youtubers who actually includes the materials referenced in the video in the description! I know it's an easy thing to forget, but I appreciate the attention to detail :)
@waynezeeman8948
@waynezeeman8948 Жыл бұрын
Many thanks for explaining this topic so well. It has just solved my 2 week struggle with Fetch👍
@kerimtim
@kerimtim 2 жыл бұрын
Kyle makes everything so easy to learn
@lidestudios5094
@lidestudios5094 Жыл бұрын
since I have college and programming is something I do on the side, I never really have enough time to learn about this stuff. But this 6-minute video was just what I needed, short and straight to the point while also managing to explain what everything does. Thanks so much!
@lititiakorau9487
@lititiakorau9487 2 жыл бұрын
Kyle you are such a great teacher bless you!!
@zephieethan7168
@zephieethan7168 2 жыл бұрын
your videos always let me learn new. even though i thought i know this point.
@michaelcarnevale5620
@michaelcarnevale5620 3 жыл бұрын
srs this is the best channel if i need to just learn a quick specific thing
@Ipdxcreative
@Ipdxcreative 3 жыл бұрын
I just wanted to say thank you so much for helping me understand these concepts in such a simple manner!
@cristi8997
@cristi8997 Жыл бұрын
thanks man, I was so confused why api error would return a success case, now I get it
@42svb58
@42svb58 2 жыл бұрын
You are better than my professor in graduate school explaining this...at a nationally ranked program
@frischsticks
@frischsticks 5 ай бұрын
One of the best coders on KZfaq. Making things simplistic, when my professors from years past had failed me. 6 mins and now I understand fetch...
@ayMillmusic
@ayMillmusic 8 ай бұрын
Such a great video man! Hair is looking super dope too!
@digital-ali5763
@digital-ali5763 2 жыл бұрын
Hey kid, you're good at this! 6 minutes and I know what I'm doing!😀
@mikeshilovski1512
@mikeshilovski1512 4 жыл бұрын
Jesus, You're a genius! Thank you so much for the video!! Finally understood it all
@keronwilliams5392
@keronwilliams5392 2 жыл бұрын
Dudeeeeeee straight to the point, love it!
@yasirtahirkheli74
@yasirtahirkheli74 2 жыл бұрын
The perfect explanation. long live mate. you are probably the best and the most thorough professional who has the ability to explain in accurate details.
@digigoliath
@digigoliath 4 жыл бұрын
If you have 6 mins to spend, spend it on this video!
@dannuttle9005
@dannuttle9005 4 жыл бұрын
Could you please make a video explaining your setup, including how you avoid CORS errors?
@markubben
@markubben 4 жыл бұрын
If you got a CORS error, you most likely typed in regres inteasd of reqres in the reqres.in.... I did the same thing. Double check your URL to be correct.
@ThDravuz
@ThDravuz 4 жыл бұрын
adding "cors-anywhere.herokuapp.com/" to the front of your api url should remove "No Access-Control-Allow-Origin header" cors errors. For example: "cors-anywhere.herokuapp.com/yourAPI.com"
@mayank_upadhyay_19
@mayank_upadhyay_19 4 жыл бұрын
@@markubben Holy shit, you are right 😅
@samuelp7847
@samuelp7847 3 жыл бұрын
@@ThDravuz You my friend are the Hero we all need.
@kurtheimerman8267
@kurtheimerman8267 2 жыл бұрын
@@markubben Thank you, that was my problem.
@SnappyScience
@SnappyScience Жыл бұрын
Great video and thank you for going through the potential bugs rather than just showing working code. Learnt a lot.
@pantepember
@pantepember 3 жыл бұрын
Soothing voice, clear, concise, and well-prepared explanation. Awesome!
@ondine9997
@ondine9997 3 жыл бұрын
Hey, do you know what the three calls to fetch() are?
@debopamgupta
@debopamgupta 4 жыл бұрын
Best video that made me understand every thing about fetch because every time after watching a lot of projects when I write something it doesn't work as because I mess up the fetch statement....
@pysof
@pysof 3 жыл бұрын
Bro your videos are absolutely awsome! I hope your channel keeps growing up! Keep it up.
@andrewday7799
@andrewday7799 4 жыл бұрын
I love that you are sensitive to developers time
@moeyali123
@moeyali123 Жыл бұрын
Awesome dude, I learnt the very basics of JS last weekend and now im trying to learn more of the fundamentals to start using it properly.
@bintoucisse2415
@bintoucisse2415 Жыл бұрын
Thank Kyle! You were very helpful as always! You're very pedagogue
@taylorgraham2906
@taylorgraham2906 4 жыл бұрын
The links to other videos were SUPER helpful. Thanks, man!
@phil7121
@phil7121 5 ай бұрын
5:25 YOU DA REAL MVP I was stuck for an entire day because of this
@saladin_advanced
@saladin_advanced 2 жыл бұрын
Thank you. Your explanation way and your videos are really smart 👍
@user-yo2xf3jc3f
@user-yo2xf3jc3f 9 ай бұрын
Straight on point tutorial! Great Job!
@uzairabdullah208
@uzairabdullah208 3 жыл бұрын
Umm dude it simply flew over my head 😵🥺 I understood only a little bit, but still so clear in such a short time! I didn't understand because of unfamiliarity to JavaScript
@MaxSharpy
@MaxSharpy 8 ай бұрын
Thx Kyle! As always, wonderful content!
@darryl8349
@darryl8349 Жыл бұрын
Thank you so much you have helped me solve a problem ive been stuck on for like an hour
@ricardoaguiar616
@ricardoaguiar616 3 жыл бұрын
You have the gift of making things understandable! Thank you for your help!
@the_xibalba
@the_xibalba 4 жыл бұрын
Hey Kyle, you really should blink man. I have been watching your videos for a long time now and you not blinking your eyes as often as they should always catches me off-guard. Just a suggestion, no biggies... :)
@Acuce7ibd468j
@Acuce7ibd468j 2 жыл бұрын
Your videos are helping alot . Keep going 👍👍
@ammarhalees6370
@ammarhalees6370 4 жыл бұрын
You are a great instructor!!! What a great explanation!
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thank you!
@nedjmeddine1630
@nedjmeddine1630 4 жыл бұрын
your videos should've appeared earlier for me they are very useful man, that only the second video I see in your channel and I am activating the bell Icon
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thank you!
@mutley11
@mutley11 2 жыл бұрын
That was a very skillful demonstration; you are a wonderful teacher. Thank you.
@fabiofreitas9304
@fabiofreitas9304 3 жыл бұрын
Simple and efficient. The best explanation about fetch i've ever seen...
@CarlosHasAIdea
@CarlosHasAIdea 4 жыл бұрын
This content should get you more views. Thank you brother. Great reviewing content too.
@haseebpavaratty6249
@haseebpavaratty6249 4 жыл бұрын
Glad I found you. Never stop making these. Thanks :)
@Brezanova
@Brezanova 2 жыл бұрын
I am in a bootcamp and your videos are a crucial part of my understanding the lectures .. You are a truly amazing teacher. May I ask you what equipment you are using for your production (Camera and Microphone?) Thank you for all your work. I will be signing up for your courses as soon as I get to breath and slow down with the bootcamp.
@RomilJain-wt3lb
@RomilJain-wt3lb 3 жыл бұрын
Great video, loved it, please keep doing great work
@wilsonfaustino
@wilsonfaustino 4 жыл бұрын
Man, I really enjoy your channel. Please, zoom a little bit, because I watch over the phone and it’s kinda hard to see what you’re writing and to keep up with the tutorial. Thank you again. Greetings from Brazil.
@WebDevSimplified
@WebDevSimplified 4 жыл бұрын
Thanks for the suggestion. I will see what I can do.
@mactavish7287
@mactavish7287 4 жыл бұрын
Bravo! My first ever video of your channel. Well explained in actually 6 mins. No bullshit. PS: This is the first time I came across fetch. I have been using axios but NOW I think fetch is also nice!
@faisalmehmood5375
@faisalmehmood5375 3 жыл бұрын
Super useful. Helped me on my path to learning how to query a database through a server.
@deboragrano2426
@deboragrano2426 Жыл бұрын
Wow I understood this in 6 minutes, amazing
@paulmcok
@paulmcok 3 жыл бұрын
Great tutorial and very clear!... Turns out it's not what I needed in this instance (so good job I watched it) but definitely useful for future road blocks. I've subscribed.
@averyrobbins68
@averyrobbins68 3 жыл бұрын
Just subbed because of this video. Thanks man.
@Stef-an
@Stef-an 2 жыл бұрын
Not a single moron, writing a 10-page essay on programming blogs, was able to explain to me what you've just explained at 2:13. Thank you so much for these videos, I've learned a lot and more efficiently than reading hundreds of pages of documentation full of jargon and terminology which I also have to google.
@kurtheimerman8267
@kurtheimerman8267 2 жыл бұрын
Another great video. Thank you!
@yeshwanthtoluva4278
@yeshwanthtoluva4278 Жыл бұрын
simple and to the point! Thanks, man!
@Andy-fs4bb
@Andy-fs4bb Жыл бұрын
Clear, concise, and accurate - another great video - thanks!
@skylarw19
@skylarw19 3 жыл бұрын
Question: Why do we need to actually need to use the word, "return", at 5:12 for the res.json()? In earlier parts of the video, it seemed fine to just have .then(res => res.json()) instead of .then(res => return res.json()). Any clarity is much appreciated! Loved this video, super helpful in explaining everything. This was the only thing I had a question on.
@crystallizedsyrup7594
@crystallizedsyrup7594 2 жыл бұрын
Late response, butthe reason why return needs to be used is so the json value could be stored in a variable, such as var data = fetch(...). Without the return you did not assign what data that should be given to the variable data after fetch is run.
@EvertvanIngen
@EvertvanIngen 3 жыл бұрын
Looks right into my soul, "I'm gonna steal that" TT
@arashaadd
@arashaadd 4 жыл бұрын
bro im watching many of your videos and im loving you more every time. Thank you so much.
@aabid3375
@aabid3375 4 жыл бұрын
How did u maintain that delivery speed with so much clarity.Simply amazing.
@danyleveque892
@danyleveque892 3 жыл бұрын
Clear and concise. It would be great if you can explain how to send form data using the FormData object too and any alternate ways of sending form data to an endpoint
@dan110024
@dan110024 3 жыл бұрын
A neat thing I saw someone do to demonstrate JSON.stringify was logging both versions of the object in the console. Like a before and after. It helps visualise what's happening.
@jhonatansantofimio3764
@jhonatansantofimio3764 2 жыл бұрын
me too, you find the solution?
@andreiaquino8994
@andreiaquino8994 4 жыл бұрын
Thanks for this best 6 mins video! Very helpful in my review i dunno why this video have dislikes :D
@rylan_mcmullan
@rylan_mcmullan 3 жыл бұрын
This was super helpful, thank you!
@jeffkorenstein5507
@jeffkorenstein5507 3 жыл бұрын
This is great! This would be even more helpful to show with a "PUT/PATCH" request in addition to the "POST".
@tanishqahuja3861
@tanishqahuja3861 3 жыл бұрын
You help me a lot 😭😭 Thanks brother! ❤️ From India!
How to FETCH data from an API using JavaScript ↩️
14:17
Bro Code
Рет қаралды 121 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
АЗАРТНИК 4 |СЕЗОН 1 Серия
40:47
Inter Production
Рет қаралды 524 М.
ROLLING DOWN
00:20
Natan por Aí
Рет қаралды 11 МЛН
Ik Heb Aardbeien Gemaakt Van Kip🍓🐔😋
00:41
Cool Tool SHORTS Netherlands
Рет қаралды 9 МЛН
王子原来是假正经#艾莎
00:39
在逃的公主
Рет қаралды 17 МЛН
1.1: fetch() - Working With Data & APIs in JavaScript
15:39
The Coding Train
Рет қаралды 452 М.
How to use a real API in your web app (rapidAPI tutorial)
12:53
APIs Explained (in 4 Minutes)
3:57
Exponent
Рет қаралды 815 М.
I built the same app 10 times // Which JS Framework is best?
21:58
Fireship
Рет қаралды 2,5 МЛН
Fetch API with Async/Await (GET, POST, PUT, DELETE)
14:55
ByteGrad
Рет қаралды 25 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Master CSS Overflow/Text Wrapping Like A Senior Developer
20:53
Web Dev Simplified
Рет қаралды 44 М.
What is a REST API?
9:12
IBM Technology
Рет қаралды 1,5 МЛН
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 803 М.
So, you want to build apps & websites?
9:34
Sajid
Рет қаралды 139 М.
АЗАРТНИК 4 |СЕЗОН 1 Серия
40:47
Inter Production
Рет қаралды 524 М.