Using REST APIs in a web application | Quick PHP Tutorial

  Рет қаралды 598,782

WebConcepts

WebConcepts

Күн бұрын

In this video I show you how to create a simple web application which converts a location into latitude and longitude using the Google Maps API. Then it uses those coordinates to pull images taken in that location from the Instagram API.
Final PHP file used in this tutorial:
github.com/jel...
Example Google Maps API call:
maps.googleapi...
Example Instagram API call using Disneyland's coordinates:
api.instagram....
Chrome extension I'm using to make JSON responses readable in the browser:
chrome.google....
Outro music:
"Rollin at 5 - electronic" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 3.0
creativecommons...

Пікірлер: 442
@joshdewinter2238
@joshdewinter2238 7 жыл бұрын
Thank you for making a video that's not too simple, but doesn't skip a bunch of critical steps to get the learner from A to B. You have just the right amount of detail to help someone who knows enough about the basics, but wants to get to the next level. Unlike a whole truckload of KZbin publishers, you are a great teacher. You know your stuff and can communicate it well. Great video! Thank you! P.S.: If you're ever tempted to skip over showing the code, even typing it out (this is great), please don't. It's part of what makes it great.
@kockgunner
@kockgunner 9 жыл бұрын
Perfect. I am getting into APIs and it's frustrating how most tutorials assume you have knowledge of knowing what to do with the API data instead of explaining how to parse it. Thank you!
@rishabhgusai96
@rishabhgusai96 8 жыл бұрын
this video deserves more than a million views. look at the video quality and the way he speaks it was fast but if you aren't new to programming you will find this content amazing and time saving none other thing can teach you such stuff so fast. Beginners keep away search something that ends with "For Beginners"
@rishabhgusai96
@rishabhgusai96 8 жыл бұрын
+Rishabh Gusain Now I am gonna watch each and every video of this guy and like them as well please make a video about accessing a payment gateway api
@eshwarenm9111
@eshwarenm9111 8 жыл бұрын
True. Getting onboard with API technologies can be confusing for flat HTML CSS JS writers.
@reyariass
@reyariass 8 жыл бұрын
Haha, i just found this channel and i love it. :)
@condor07uk
@condor07uk 8 жыл бұрын
+1
@CCampbellKC
@CCampbellKC 7 жыл бұрын
Personally, I don't think you went too fast at all. In fact, I was glad it wasn't long and drawn out. Fast, concise, and put together very well.
@janeelliottsbookshelf4374
@janeelliottsbookshelf4374 6 жыл бұрын
Thanks so much! You talk fast, but I really appreciate it as I hate wading through slow talking videos wasting time - just pause the vid when needed. You're very clear with your descriptions.
@fstarockaburns425
@fstarockaburns425 8 жыл бұрын
i think im gonna watch every vid uve ever made - stellar stuff for a 15 yrs long php coder who needs to play catchup - fantastically fast, to the point and incredible - thanks so much.. def going to look into using this for future apps..
@EZraw87
@EZraw87 8 жыл бұрын
Found your channel randomly researching APIs and your application coincidentally does exactly what I wanted to do. Thx for the tuts sir, you are awesome!
7 жыл бұрын
I really like this more technical example of APIs. I usually don't dig into the developer side of things, but I appreciate that you do
@juissijakismet
@juissijakismet 9 жыл бұрын
You are easily the best web coding tutorial guy I've ran into so far. Cheers!
@eshwarenm9111
@eshwarenm9111 8 жыл бұрын
I don't understand people who complain he speaks too fast. Just slow down the video or pause if you need to. I think in the entirety of KZbin, this guy does the best with concepts, with fun and working examples. For UX, go find Nick Babich - his Medium (UX Planet) articles are next level.
@CodeProHassam
@CodeProHassam 6 жыл бұрын
Eminem of coding .
@thewpagroup1562
@thewpagroup1562 6 жыл бұрын
Right? Rap God here lol
@Besiktas7Bjk7
@Besiktas7Bjk7 6 жыл бұрын
Honestly, would you click on the video, if it would be 20-30 minutes? I am sure, I wouldn't. He has to rap, and he is good at it!
@OWEN-zn8rm
@OWEN-zn8rm 6 жыл бұрын
watch it with 0.25 speed
@chrisriddell7424
@chrisriddell7424 4 жыл бұрын
This comment gets funnier the longer the video goes on
@newlandstorm
@newlandstorm 4 жыл бұрын
Hahaha. indeed bruv . eminem of coding
@danielpettus4846
@danielpettus4846 9 жыл бұрын
Usually I find a site with information so I can read because people talk too slow making it almost not worth the time to watch some videos. You however make each sentence full of information but very concise, where I feel like I need to hear each word as its valuable to the video.
@WaqasKhan-lm2yo
@WaqasKhan-lm2yo 5 жыл бұрын
I really like your fast way of teaching Man 😊, thanks. I become sleepy when listening to some other guys 😴.
@JonoChong
@JonoChong 8 жыл бұрын
Learning about API's and I've watched many videos and I'll say - This one trumps them all in being informative, clear and concise ! ! Looking forward to more ! Cheers !
@kobadg
@kobadg 8 жыл бұрын
+Jonathan Chong I agree completely... Now if only there were more videos.... (Seems this one was the last in over a year.)
@glynnjohnson558
@glynnjohnson558 9 жыл бұрын
Just wanted to say thanks! I've been struggling to get started with the Linnworks API all day as I've never done anything like it. Thanks to this tutorial I've managed to get going and actually understand what I'm doing now. Great video!
@ilmakeyouone
@ilmakeyouone 7 жыл бұрын
Pretty cool application REST API on PHP. Thank you man. One of the best programming channel on the KZbin!
@pierreugaz
@pierreugaz 7 жыл бұрын
I was looking for something like this in order to fully understand how rest apis work, thank you so much sir!
@FaizKhan-fm6kg
@FaizKhan-fm6kg 8 жыл бұрын
Excellent. Your videos are full of useful information. And do not consider talking slow. Everything is perfect the way it is.
@flaviotosi931
@flaviotosi931 5 жыл бұрын
Bravo. Even a rusted bone lioke me has finally understood the mechanism of a REST API in PHP HTML. thanks a lot
@bobkeeper7386
@bobkeeper7386 7 жыл бұрын
Final PHP file used in this tutorial: github.com/jelled/geogram/blo... and Example Instagram API call using Disneyland's coordinates: api.instagram.com/v1/media/se... both links are broken
@joebazooks
@joebazooks 5 жыл бұрын
great production quality. one of if not the best production quality ive seen in a programming tutorial
@vlad981
@vlad981 9 жыл бұрын
Dude, you are awesome! please, make more video!)
@adamrajnoha4653
@adamrajnoha4653 9 жыл бұрын
man, thank you so much for this. I knew what the concept of API is but every example was way too much difficult, you explained the usage quickly, understandable and efficient way))
@jona8820
@jona8820 4 жыл бұрын
Just what I needed, perfect. Short and quick. no bs.
@LidongYang
@LidongYang 9 жыл бұрын
Please keep making these videos. I found them very helpful and I'm comprehending without too much trouble. Thank you a lot.
@mkmabl
@mkmabl 8 жыл бұрын
you are awesome! I'm a Jack of too many trades and master of none. I've done an ounce of udp and tcp server work and a bit of php. your video here was exactly what I needed to get started on this topic. in particular, I like the no library approach, even the simple forms drudgery. it is best when simple examples limit number of toolsets used. here you have html and php. I'm going to now look for a server tutorial from you. great stuff! thanks!
@shadsluiter
@shadsluiter 7 жыл бұрын
Unfortunately, the Instagram API has changed. Tutorial needs an update.
@a.davidoyerinde7068
@a.davidoyerinde7068 7 жыл бұрын
Please what is the new instagram API?
@Beebop121
@Beebop121 6 жыл бұрын
Thanks, I just had a problem with that as well
@shadsluiter
@shadsluiter 5 жыл бұрын
@@a.davidoyerinde7068 instagram.com/developer/
@BilaalAbdelHassan
@BilaalAbdelHassan 4 жыл бұрын
It has changed but the principle stays same.
@kobadg
@kobadg 8 жыл бұрын
No new videos in over a year? What happened to this channel?! I feel this guy explained things extremely well....
@atabish2
@atabish2 8 жыл бұрын
I learned a lot about Rest API after watching this video. Also I learned about AJAX through one your video and created a really small but cool application about Instagram trend search. Unfortunately Instagram has now restricted the usage of its endpoints. But anyway, this is really fun to learn.
@ImmaShadowGirl
@ImmaShadowGirl 8 жыл бұрын
Your videos are amazing and you explain really well. But in this particular one, you went too fast. It was amazing but could've been better if you gave some time to the viewer's brain to store one block of data you input, before moving onto the next block.
@spaceinfotech5539
@spaceinfotech5539 8 жыл бұрын
Well said ImmaShadowGirl. He should know better
@rishabhgusai96
@rishabhgusai96 8 жыл бұрын
+ImmaShadowGirl or u could just pause and rewind to.
@eshwarenm9111
@eshwarenm9111 8 жыл бұрын
Or go Shift + '
@ImmaShadowGirl
@ImmaShadowGirl 8 жыл бұрын
^@Rishabh Gusain I was pausing and rewinding a hell lot and it reduces concentration, hence, the comment. and Eshwaren M Try slowing it down and you'll know how awkward it is. Hence, the comment. :D
@reyariass
@reyariass 8 жыл бұрын
Completely agree with you. :)
@Shnigi
@Shnigi 8 жыл бұрын
I like tutorials like this, no bullshit explained, straight to the point. Thanks
@christopherenriquez9765
@christopherenriquez9765 7 жыл бұрын
I thought that the speed of the video isn't set to normal so i check it out lol. BTW i learn from you , thank you.
@andrewmcbride88
@andrewmcbride88 9 жыл бұрын
I subscribed for more of this series! I'm very new to APIs and you did a great job of explaining what they are and now showing how to use them easily. thank you!
@realcconnect6873
@realcconnect6873 4 жыл бұрын
where I can get maps url , you didnt tell? then I began confused, thats very difficult if I dont understand
@leonardocollares
@leonardocollares 7 жыл бұрын
Great video! You are really good when explain things. Just a comment from my instructor perspective, you could be talking in a slower pace considering most of the viewers are here to learn something new.
@madhawapiumika4037
@madhawapiumika4037 2 жыл бұрын
Same as anyone said thanks, Love the explanation. SOLID real SOLID explanation got it under 10 minutes into brain. Could improve the Coding and showing examples a little longer in 2 to three seconds.
@johansebasb
@johansebasb 9 жыл бұрын
Keep on the good work! Very useful mini-tutorials! Waiting for more
@stianmaurstad
@stianmaurstad 9 жыл бұрын
Nicely presented & straight to the point. Thanks! Keep it up.
@SureshKUMARMukhiya
@SureshKUMARMukhiya 9 жыл бұрын
Great Videos. Concept is much clear. Thank you for this video. Would like to see more on this topic.
@ImGodTheMaryBanger
@ImGodTheMaryBanger 2 жыл бұрын
Great video, helping me get a much better understanding of the next step in my project
@frenchmarty7446
@frenchmarty7446 6 жыл бұрын
I could not hit that subscribe button fast enough after watching.
@susie1010
@susie1010 7 жыл бұрын
I'm so glad I could slow down the speed of the video... i'm not an english native speaker and it was very hard to follow your talking - especially with such a "technical" topic. nevertheless it is a great video, thank you.
@kartikchauhan5498
@kartikchauhan5498 7 жыл бұрын
But JSON response didn't contain an 'address' property. So, how do we know which variable to send to get the desired data?
@learnlearn236
@learnlearn236 8 жыл бұрын
{ "meta": { "error_type": "OAuthAccessTokenException", "code": 400, "error_message": "The access_token provided is invalid." } } its give a error ike this so what sould i do.
@Manoj5437
@Manoj5437 8 жыл бұрын
Dude seriously... Hats Off !!! Post more videos :)
@MoutasemMohammad
@MoutasemMohammad 8 жыл бұрын
Amazing !! don't you ever quite make such amazing videos
@lafouinevino1496
@lafouinevino1496 6 жыл бұрын
that's good! very introduction and i get a grest information for exemple rest APIs in a web application
@jeyjd123
@jeyjd123 9 жыл бұрын
Excellent presentation, I loved it. Looking forward more. Nicely done
@mujahidbhoraniya6038
@mujahidbhoraniya6038 6 жыл бұрын
Nice understanding . I like your video. Really very simple explanation for you.
@trumangregg6266
@trumangregg6266 6 жыл бұрын
I am confused that yo u never mentioned api access tokens in this video. Do you need access tokens for the example in this video to work?
@kellywang9331
@kellywang9331 8 жыл бұрын
An advanced introductory video. Good work. Appreciate it.
@finnhoile2377
@finnhoile2377 8 жыл бұрын
Good tutorials, but man you talk fast!!
@shubhamchandra9258
@shubhamchandra9258 8 жыл бұрын
dats the reason for his short tutorials ;)
@phptuts4545
@phptuts4545 7 жыл бұрын
Whoever make this function, salute to that guy :D
@ShadowsMasquerade
@ShadowsMasquerade 7 жыл бұрын
lmao with 0.5 speed he sounds patronizing as fuck
@AM-iv3bp
@AM-iv3bp 7 жыл бұрын
What? I always watch the videos on 2x speed. Thanks a lot for these tutorials man. No BS video's, which are compact and concise.
@wiscatbijles
@wiscatbijles 7 жыл бұрын
Drunk you mean!
@Manishchauhan-yf4fr
@Manishchauhan-yf4fr 4 жыл бұрын
Perfect Explanation. Great Job
@zhaksy
@zhaksy 8 жыл бұрын
Super appreciate all the hard work put into this video!
@branchyapple
@branchyapple 5 жыл бұрын
The url gives a error.. Google says i need to send out a API.. While at 4:03 you can do it.. maps.googleapis.com/maps/api/geocode/json?address=disneyland,ca
@LordMpW
@LordMpW 3 жыл бұрын
maps.googleapis.com/maps/api/geocode/json?address=disneyland,ca&key=1234567890 (Add the key from your Google Maps API in the url).
@branchyapple
@branchyapple 3 жыл бұрын
@@LordMpW ah thanks man! Long time ago, but if i need to do this again i will know 👍
@LordMpW
@LordMpW 3 жыл бұрын
@@branchyapple haha no problem, you're right it is a long time ago ;-)
@gwenaelriou3559
@gwenaelriou3559 7 жыл бұрын
a quick and efficient explanation !
@Phantomwalker
@Phantomwalker 9 жыл бұрын
These are pretty awesome tutorials you've made sir. Thanks for creating these. :)
@callforjhed
@callforjhed 7 жыл бұрын
i love the tutorial. thanks Eminem!
@DiegoMiranda07
@DiegoMiranda07 9 жыл бұрын
That work only for public profiles? I mean, if a user have an private profile the images of him do not possible to see, correct?
@webconcepts
@webconcepts 9 жыл бұрын
Diego Miranda Correct. Unless you make the API request using an access token which belongs to the owner of the profile. For example, if I use the "sign in with facebook" button on some random site the access token generated will belong to my facebook account. Therefore, if the 3rd party site requested photo permissions during the sign in process, they could use my access token to request all of my photos.
@RickBeacham
@RickBeacham 8 жыл бұрын
You can use scrapy for private profiles and if you need to request more then what the API allows but only if your account is allowed to see the profile. Just save the cookie. doc.scrapy.org/en/master/topics/request-response.html
@TDefton
@TDefton 7 жыл бұрын
What about When the API requires a token to be sent using the cURL header? What Should my php look like then?
@mehranvafaee1053
@mehranvafaee1053 6 жыл бұрын
Absolutely love the way you put it! Bravo!
@leticialimacavalcanti
@leticialimacavalcanti 6 жыл бұрын
English is not my first language and I understand only 50% of what you said, that is, you speak very fast!
@achkh1139
@achkh1139 8 жыл бұрын
what if i told u that u are doing a very good job?
@sarveshgandhi4588
@sarveshgandhi4588 4 жыл бұрын
by making such clean and time efficient tutorials
@AlMarufSharif
@AlMarufSharif 8 жыл бұрын
why your videos are too amazing??? really i love it :)
@lastmanustanding
@lastmanustanding 7 жыл бұрын
It's mandatory to use the access_token' for Instagram requests. They changed how it works and it no longer works with 'client_id'. You will also have to specify/pass a 'scope' parameter in the URI when you are requesting the 'access_token'. The rest of this tutorial still works. :)
@RickBeacham
@RickBeacham 8 жыл бұрын
Needed a refresher on using json with restful api's. Thanks. What can't we just access the specific element from the JSON object? Is it possible to not use a loop?
@renzogamboa821
@renzogamboa821 9 жыл бұрын
I can't wait to see some AJAX in action as well as 'caching' you mentioned. Great Video! I subscribed.
@mohaarifahmed4072
@mohaarifahmed4072 6 жыл бұрын
i used same code but I am getting error {"meta": {"code": 400, "error_type": "OAuthAccessTokenException", "error_message": "The access_token provided is invalid."}}
@Deadnature
@Deadnature 6 жыл бұрын
Dude. You are awesome. Not faff, just info. Subbed.
@floriwanna
@floriwanna 8 жыл бұрын
Thanks!! From Arg!! I finally catched get results! have a nice day
@atabish2
@atabish2 8 жыл бұрын
Great tutorial. I think Instagram has a best set APIs. I have also tested the search profile API using the same method.
@rodneycox7233
@rodneycox7233 9 жыл бұрын
Your videos are great!!!! Thank you so much. Keep em coming please!
@HG-mt3vl
@HG-mt3vl 7 жыл бұрын
which browser tool do you use to beautify the json code returned ,the tool in which you minimised some parts of json inbrowser
@salvajez1
@salvajez1 7 жыл бұрын
thanks! This video helped me a lot to understand WEB API. keep doing videos!
@husseinajam3625
@husseinajam3625 7 жыл бұрын
Did Instagram change their API policy? I think we can't access their API without authentication. Can you please make new video to sort this problem.
@jxcreed705
@jxcreed705 7 жыл бұрын
This is a great and amazing tutorial!...Thanks for the video!, hope you make videos more for future developers.
@Chris-sc7rx
@Chris-sc7rx 9 жыл бұрын
For php curl request to pull data along with having an API token. How would you including the API token as query param or as an authorization header? Would very much appreciate your help.
@khalidmohd882
@khalidmohd882 7 жыл бұрын
This error is generated in my case meta: { code: 400, error_type: "OAuthAccessTokenException", error_message: "The access_token provided is invalid." } Please help me
@amirzendehboudi1191
@amirzendehboudi1191 5 жыл бұрын
Excellent !!!
@Lockbaconwithmagic
@Lockbaconwithmagic 9 жыл бұрын
These videos have been incredibly helpful. Thank you for taking time out to make them.
@suareduj
@suareduj 7 жыл бұрын
Ah crap - Instagram no longer allows to access the public content for one-off projects such as displaying hashtag based content on our website. That is why the API from your videono longer works (even with OAuth Token...).
@patrickkouame2162
@patrickkouame2162 8 жыл бұрын
Great videos!! Clear and concise to the point. Thanks
@shwebsoft7122
@shwebsoft7122 6 жыл бұрын
Just subscribed to your channel. Became a fan of you!
@shedahoma
@shedahoma 8 жыл бұрын
very straight to the point!! I love it
@arisweedler4703
@arisweedler4703 7 жыл бұрын
Fantastic guide. I appreciated the speed
@arisweedler4703
@arisweedler4703 7 жыл бұрын
Not being sarcastic^ I have no qualms with needed to pause and/or rewind a few times.
@leumasile
@leumasile 9 жыл бұрын
awesome, I enjoyed this video, it was fast and straight forward ! Thanks
@TobiTobeToby
@TobiTobeToby 8 жыл бұрын
I'm trying to do something kind of like this, essentially I want to allow users to input a postcode and get the search form to return the latitude an longitude values for the postcode entered. What code does that? Anyone know?
@therealteggy
@therealteggy 9 жыл бұрын
How would I alter your code so that I could accept a string that contains spaces?
@HalukOral
@HalukOral 8 жыл бұрын
i'll make simple comment like your videos... You and your videos are awesome... Thats it.
@jayminsejpal1263
@jayminsejpal1263 8 жыл бұрын
I 'm still stuck with this error: error_type: "OAuthAccessTokenException", code: 400, error_message: "The access_token provided is invalid. Any Solution to that? I think I'm missing something
@chrismuga
@chrismuga 7 жыл бұрын
this was, overall just incredible to watch... thanks.
@lozada12100
@lozada12100 8 жыл бұрын
I have no Idea how to start up this code ....I downloaded it and I assumed I can work with it but im not able ....can some one help ?
@ikay45
@ikay45 8 жыл бұрын
I want to understand how to integrate amadeus gds flight api into my wordpress or t hp website, how do I go about this?
@alentech6091
@alentech6091 7 жыл бұрын
Love the videos man thank you so much and keep up the great work!
@Chris-sc7rx
@Chris-sc7rx 9 жыл бұрын
I'm given clientId, employeeId, code#, merchantId. I'm trying get json data from an inventory via php curl request, and i was advised to include the api token as a query param or as authorization header. It's secured with OAUTH. (It's a curl get request) For authorization header my code: $header = array( "Content-type:"=>"application/json", "Authorization:Bearer "=>"$accesstoken"); curl_setopt($curl_init,CURLOPT_HTTPHEADER,$header); Is the code above correct? And do I need to add: curl_setopt($curl_init,CURLOPT_HTTPAUTH,CURLAUTH_BASIC); curl_setopt($curl_init,CURLOPT_USERPWD,"user:pssw");
@vincentshi5233
@vincentshi5233 8 жыл бұрын
Hi, Thanks for the video. For some reason, when I clicked submit, it just return to the submit page again, instead of displaying instagram image, could you please help? I used your github code and replace the client id
@abhirocks550
@abhirocks550 9 жыл бұрын
Thank you so much for this awesome video :-)
@sonathaj1352
@sonathaj1352 8 жыл бұрын
Such an awesome tutorial. Loved it!
@severn-master
@severn-master 5 жыл бұрын
wow no typo, he is god
@AustinNwaka
@AustinNwaka 7 жыл бұрын
0.75 Speed makes sense. Nice tutorials.
Web Server Concepts and Examples
19:40
WebConcepts
Рет қаралды 245 М.
Шок. Никокадо Авокадо похудел на 110 кг
00:44
Самое неинтересное видео
00:32
Miracle
Рет қаралды 2,5 МЛН
Brawl Stars Edit😈📕
00:15
Kan Andrey
Рет қаралды 42 МЛН
Learn CSS in 12 Minutes
12:11
Jake Wright
Рет қаралды 2,3 МЛН
Automate your inbox using Google Apps Script
17:23
WebConcepts
Рет қаралды 43 М.
API vs. SDK: What's the difference?
9:21
IBM Technology
Рет қаралды 1,4 МЛН
Why do big Companies use Java, and NOT PHP?
12:34
Stefan Mischook
Рет қаралды 222 М.
Domains and the Domain Name System
8:35
WebConcepts
Рет қаралды 97 М.
AI Expert Explains Future Programming Jobs… and Python
9:59
Travis Media
Рет қаралды 290 М.
The Story of Next.js
12:13
uidotdev
Рет қаралды 576 М.
REST API & RESTful Web Services Explained | Web Services Tutorial
15:33
Docker Explained
23:22
WebConcepts
Рет қаралды 36 М.
iPhone 16 Pro Max Trailer | DrTech
1:08
DrTech
Рет қаралды 707 М.
D3 XIAOMI SU7 MAX
14:25
smotraTV
Рет қаралды 504 М.
iPhone 16 и 16 Pro / Max - за тебя калым отдам!
18:56
Покупка бюджетного смартфона? 😤
1:00
Вэйми
Рет қаралды 1,1 МЛН