So during my classes we never had any lessons, or really mentions of api. I tried to look at other stuff to build, and If it mentioned “use so and so api” I would skip over it. What’s a good place to get familiar with this, or experiment with it?
Hi there , i personally just started learning API myself. You might want to look into AJAX first before moving to API which i am learning at the moment.
Api’s, Ajax, Axios etc I’ve heard, and seen them used in code, but never knew what they do, what they are for, how to use them and all that. Is there a site you’re using to learn about them?
I am using andrew mead course that explains well in udemy. Another alternative is youtube brad traversy.
If you don’t know what ajax and axios is used for, then learn what it is that is important. You need to learn how the client request data from the server through HTTP request response protocol.
I definitely got some learning to do, just don’t know where to start. I’m not a fan of watching YouTube videos for the fact a lot of those guys are never really clear in their explanation. Like to jump from line to line of code without really being clear.
Hi Cody_Biggs,
Here’s my best attempt at explaining an API:
Programmer: I would love to analyze some [Insert Tech Company] data. Am I going to have to manually go to each page or code a web scraper?
Tech Company (think Google, FB, Reddit, etc.): No way! We would love for you to use our data in your project! We made your life simpler by creating an Application Programming Interface (API) that you can use to fetch what you need from our back end!
Programmer: Awesome, thanks! Wow, there’s even documentation on your sites for how to use these APIs?
Tech Company: Yup! Just make a request, like this one to Wikipedia:
https://en.wikipedia.org/w/api.php?action=query&format=json&prop=pageimages%257Cpageterms&generator=prefixsearch&redirects=1&formatversion=2&gpssearch=pie
(See specific API documentation for what kinds of queries return what info, above is just an example.)
And we’ll return the info you’re looking for in JSON format!
(Try copying and pasting the above link into your browser to see the response.)
To learn how to make an AJAX call, I would suggest either going through a tutorial, the one recommended above by randelldawson looks great, or just finding someone’s functional code on CodePen and reading it. I offer up my Wikipedia Viewer for your perusal, though I coded it a long time ago, so it looks pretty terrible, haha. (The API call works though!)
I first learned how to use APIs through a couple of freeCodeCamp’s old challenges, like Wikipedia Viewer and the Weather app challenge, which required using an API to figure out where the user is located as well as what the weather in that location is. I don’t think those challenges are available any longer though (correct me if I’m wrong), but I still recommend building these projects or something similar to learn how to use APIs. Once you get one to return something and display it on the screen, you’ll become obsessed with their usefulness XD
If you bump into any issues feel free to message me, or the forum, and I’m sure someone will help
Hope this helps.
I may have to take you up on that offer. Be warned @camperextraordinaire knows first hand how much of a pain I can be when I need help