How to Connect to Free APIs via API Connector (and Other Tools πŸ”Žβš’οΈ)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Awesome video. But why is Jason 52? πŸ˜…

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/mixedanalytics πŸ“…οΈŽ︎ Oct 13 2021 πŸ—«︎ replies
Captions
all right youtube i am back in action and have some really exciting stuff coming for all of you very soon so for those of you that are taking some kind of coding course or web development course or something like that you've probably hit the weather api i think it's called openweatherapi.com or something like a gajillion times right and you're probably like okay it's useful it's live data but you might be wanting to build something a bit more interesting so anna put a lot of work into coming up with a big list of public and open apis so if you're doing any kind of like web development trying to make your own app or you just want to take a peek at some different apis to see if there's any useful information for yourself or you don't know what an api is and you want to see what it is stay tuned on this big list of free and open apis obviously you know one of the first things that comes up is a weather forecast um we have a cocktails database lots of crypto data you can you know of course cats what's the internet without a cats api um different things about your ip address itunes search lots and lots of different endpoints here daily page views for a page on wikipedia zip code information so on and so on right as a developer there's a couple of tools that you can use at your disposal for for playing with api data and kind of looking at it and doing different things with it um so for me in general what i like to do is if i see like an api here and i want to get a quick look at it just to understand what's in the data or what the structure is like i like to use a tool called json viewer it's as simple as it sounds um apis will return json so you want to have a json viewer to view that data and this is just a chrome extension so anytime you click on an api in your browser it will pop open that data in a new tab just like this and display that data in a pretty format um so i already have a copy um so let's just say i want to look at i want to look at some random user api data for example right so when i click on that we'll put the results out kind of very neatly so you can see the key and value pairs and any nested objects that are in that um so i highly recommend using this tool for just getting a quick look at your api data another tool that i like to use that actually is a website that works directly in your browser it's called swagger inspector um so if you pop open this link here i'll also put that in the description basically what you can do is you can grab that url and you can paste it here in the gets and when you send that it will do pretty much the same thing it's going to pretty print your json data so that you can quickly look through it and see what your keying value pairs are for that given endpoint and related to swagger another tool that's even a bit more powerful that you need to install on your local machine is called postman so postman is a free tool that you can use to get posts to all kinds of api manipulation and you don't need to put in your email address so the secret right here where it says download the desktop app just click on the one that's corresponding to your machine i already have a copy of it open so i'll show you how to use it briefly so this is what the postman ui looks like you can add a new request here and i'll go ahead and just paste in that um that same request here and then when i hit send it's going to pretty print it yay so i can see you can look at the raw data too but oh nobody wants that no nobody wants to see that get that out of here and last but not least and the reason why i'm here is to show you how to use api connector for accessing these different open apis um so if again if you're new to web development or you just want to get your data into a format like google sheets to be able to look at graphs of your data or to potentially connect it with app sheets or you know some other kind of database like functionality api connector is the tool for you so api connector is a add-on for google sheets that's free to use when you first sign up you get 14-day pro version so you can do some more advanced functionality so if you don't have it yet go ahead and check it out and api connector is essentially an an extension for google sheets that allows you to interface with that api data and dump it into a sheets format so you've been looking at the data and it's kind of raw a json albeit prettified version but then that might be the format that you want for your particular use case so what api connector can do is actually dump that data directly into a sheet for you to do some analytics or any other kinds of things like that so if you've been following this channel we've just pushed out a big ux update for api connector so you uh if you're using a popular api you no longer need to necessarily copy and paste the endpoints anymore you can just type in a keyword and it should pop directly to what you want so just as an example let's take a look at the open brewery database for example right so if i type in brewery you'll see that i will can immediately fill out everything just by selecting the open brewerydb and it will actually automatically make a new sheet for you as well so everything else is ready to go so we can just hit save and run and we're going to dump all that brewery data right here in google sheets no json no having to pretty fight things this data is ready to go so we can see that a lot of these breweries are from the us so if we want to display this data in a more visual way google sheets actually has a chart type that is okay that's not what i was looking for not this kind of chart there's actually a geo chart that we can pop in um and then so we've chosen our region as state so it's looking at the world right now but what we can do under customize is change this region to the united states and bam there we go so we can see that texas has the most breweries not a surprise being one of the bigger states um and then you know we can see some of the other states have just one or none from this particular api endpoint obviously there's breweries in wyoming and idaho am i getting my geography right sorry i'm from the east coast okay so for the next use case let's say i have a list of friends here jason ethan emily and addie and i want to guess what their age was there's an api for that and probably also an app so if i open up api connector and head over here i can go ahead and add new and using our quick search functionality we can search for ageify and now i'll introduce you to the triple plus syntax so triple plus syntax is api connectors way of being able to reference dynamic values inside of google sheets so just like in google sheets when i want to reference a dynamic value i first start by putting in the name of the sheet with an exclamation point followed by any of the cells that i need to reference so make sure you open and close that with three plus signs once you've done that we can have the destination sheet go to a new one that's okay because we're going to reference these and then actually output the api over here so let's just name this predict age this is too long i don't like that okay and then we'll go ahead and run it and then we'll see shortly i've created a new sheet and we will see the endpoint return our values um jason's not 52. the last use case i'll introduce you to is actually pulling image data so most of the time on the internet when an api is communicating image data back and forth it won't actually put an image in that json file it will put a link to the image and then whatever program that you're using will digest that image and display it for your users so let's take a look at the random dog image api because why not um if we type in here we just type dog we can probably see get linked to a random dog image so if we click on that um notes there are no curly braces around anything so we don't need to put any values in here um we're going to create a new sheet that's linked to a random dog and then we'll go ahead and run that now so let's see what we get oh yay so we've got this image here of a dog so we click on that it'll actually redirect us over to that jpeg and we can see some cute dogs at the beach right now let's say for example i want to get a bunch of these kind of images three random images of dogs on this same sheet if i run this command again it's gonna overwrite what's already here so what you can do is change to output options and you can click on append and then we can manually run again two more times to get two more images right now lastly google sheets has a cool feature that we can use to actually display images directly in the sheet so if we we can start by taking our columns and making them a little bit larger and then inside of the column where we want to display the image we can say equals image and then reference the cell that contains that url to the image so once we hit enter we'll see oh there's our doggies at the beach and then we can drag this down and same thing so we'll get some images of more doggy friends so that's it um i hope that that has helped show you guys and gals a little bit about how to use api connector and how to just use free apis in general um and some of the different tools that i use for being able to quickly look at that data thank you so much and take care
Info
Channel: mixed analytics
Views: 306
Rating: undefined out of 5
Keywords:
Id: jjc70bV1A78
Channel Id: undefined
Length: 10min 20sec (620 seconds)
Published: Wed Oct 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.