How To Interact With A Simple API in WordPress - Advanced WordPress Tutorial

  Рет қаралды 211,357

WPCasts

WPCasts

5 жыл бұрын

In this tutorial, we go over how to scrape a remote data source (API) and store that data in a Custom Post Type that has a set of Advanced Custom Fields. This is a real-world project that I used to create a timed-scrape for a side project.
Sign up for the newsletter to notified about the free 2020 WordPress Development Course: wpcasts.tv
Get WordPress Hosting:
wpcasts.tv/go/kinsta
*Don't forget to subscribe!*
**Make sure to visit the live project: brewla.la/ **
Correction at 33:51 - "weekly" is a custom interval. You have to create that on your own with something like this: developer.wordpress.org/plugi...
** FULL CODE REPOSITORY **
github.com/alexander-young/br...
*SOCIAL*
Twitter: / _wpcasts_tv_
Instagram: / the_alex_young
#WordPress #API #RealWorldProject

Пікірлер: 192
@WPCasts
@WPCasts 4 жыл бұрын
Sign up for the newsletter to notified about the free 2020 WordPress Development Course: wpcasts.tv
@timucin4220
@timucin4220 2 жыл бұрын
i cannot reach wpcasts website
@abdul_qadir7780
@abdul_qadir7780 2 жыл бұрын
Link is an empty wordpress website. By the way thank you for great video.
@mountainman9570
@mountainman9570 4 жыл бұрын
I really enjoyed this! Thanks for speaking slowly and clearly. I am 75 and trying to learn a bit more about Wordpress. I support about 6 sites and would like to learn how to do some customization work.
@sameermishra3598
@sameermishra3598 2 жыл бұрын
Wow ! Keep inspiring us young ones sir!
@killerdude909
@killerdude909 2 жыл бұрын
how are you doing today sir?
@stephenm3874
@stephenm3874 2 жыл бұрын
Sweet! I'm 67 and started programming when I was 47 and made a nice living from it. You rock!
@pmx5684
@pmx5684 2 жыл бұрын
thats awesome!!!
@abdul_qadir7780
@abdul_qadir7780 2 жыл бұрын
Hey Mountain, I really inspire me. Best of luck
@stillready6405
@stillready6405 2 жыл бұрын
Wow. This tutorial is really good and you made it very easy to follow without skipping important parts and giving a clear path to follow. I'm glad I found the video!
@chrisklightandsound2801
@chrisklightandsound2801 4 жыл бұрын
Just to give some feedback, this tutorial really helped me to get an api integration running on my company. As someone with a very limited background in coding, this was a perfect starting place. Thanks
@priestofpsi
@priestofpsi 3 жыл бұрын
As a programmer who has never touched wordpress, this was brilliant. Learnt far more from this (i actually watched this) and learnt the exact thing I was wanting to. Excellent excellent excellent video!
@imarkdesigns
@imarkdesigns 3 жыл бұрын
THIS video helped me saving my ass to my project. I really appreciate your effort on doing this video. Thanks Alex!
@kerimtim
@kerimtim 2 жыл бұрын
Your videos are just unbelievably simple professional and amazing
@mayanikolova8353
@mayanikolova8353 3 жыл бұрын
Incredibly useful and well delivered. Thank you!
@JassarDev
@JassarDev 4 жыл бұрын
Not specifically looking for this function but this tutorial is amazing!
@guizuk3
@guizuk3 4 жыл бұрын
Incredible, man! Good job you did here, congrats!
@ChadAmI80
@ChadAmI80 3 жыл бұрын
Great overview of some new to me wp functions. I learned several things from your video. Thanks!
@kerimtim
@kerimtim Жыл бұрын
Wow. This is a great video tutorial, a starting point for integrating any possible API. Thank you!
@fekedewhailemariam5979
@fekedewhailemariam5979 3 жыл бұрын
I really appreciate your effort on doing this video. Thanks!
@hkyoyo
@hkyoyo 3 жыл бұрын
I love this cast. Great work mate!
@JerryFerguson
@JerryFerguson 6 ай бұрын
Hey Alex! Amazingly straightforward video and exactly what I needed for the project I'm working on! Right on!
@digwillhachi
@digwillhachi 2 жыл бұрын
this is amazing. really well explained and informative. thank you.
@martinkaspar5095
@martinkaspar5095 Жыл бұрын
Thank you so much! As useful as usual! Keep inspiring us. Thanks a million. I've been waiting for this forever. I cannot thank you enough 👍 - plz keep up the awesome work i would love to see more of your great vids - ...
@fissunix
@fissunix 5 жыл бұрын
Awesome tutorial !
@kaungko7393
@kaungko7393 2 жыл бұрын
Very clear and well explained. Thank alot.
@j8ahmed
@j8ahmed 8 ай бұрын
This was a phenomenal explanation. Thank you!
@onemoreprince
@onemoreprince 3 жыл бұрын
Really very helpful. Content on a topic like this is scare & due to such reasons it is very tough for a non-coder with good experience of working with themes & plugin (even some advance plugins like toolset, pods) can do pretty easy things like using API.
@ashkanahmadi
@ashkanahmadi 2 жыл бұрын
Excellent. I got a bit confused by the end but overall, thank you for showing everything from scratch instead of keep saying "i already wrote half of the code offsceen".
@soultouchingsongs
@soultouchingsongs 4 жыл бұрын
Awesome 👏. Thanks a ton for this valuable content. 🙏
@leokattah
@leokattah 2 жыл бұрын
Congrats for the tutorial. It really helped me.
@biotropicsmensformula4811
@biotropicsmensformula4811 4 жыл бұрын
Great. Really new thing for me. It's heavy and I like it
@theman7050
@theman7050 2 жыл бұрын
This is a legendary WP video!!
@kokapeli
@kokapeli 2 жыл бұрын
Amazing video! Thank you!
@technoar8161
@technoar8161 Жыл бұрын
Thanks a lot!!!, this video really help me.
@pifonsi
@pifonsi 4 жыл бұрын
Wow, great video, I love it!
@RobertoTenil
@RobertoTenil 2 жыл бұрын
Correct me if I'm wrong, but when you put >= on line 73 (31:40), the = takes away the whole purpose of the function, which would be to update only the newest ones (>). Those with the same timestamp (=) shouldn't be updated. The tutorial is excellent, and it helped me a lot. Thanks. 👍
@jameschoyens23
@jameschoyens23 4 жыл бұрын
I finished an Ad as a thank you.
@kennyirvine8786
@kennyirvine8786 Жыл бұрын
Amazing tutorial! It helped me out soo much! Something I think that is missing is removing a brewery from WP if it no longer exists in the API response. Easy enough to figure out though.
@ahmedmusawir
@ahmedmusawir 4 жыл бұрын
Amazing!! Can you plz give us a how-to series on building a whole CRUD app using WP Graph QL and React? Pleeeease?
@felixlozada5260
@felixlozada5260 2 жыл бұрын
Increible tutorial, ya con esto lo combinas con un oage builder y haces magia, de verdad muchas gracias
@juanitacami9023
@juanitacami9023 4 жыл бұрын
Excellent tutorial
@mindwasher1813
@mindwasher1813 3 жыл бұрын
this is exactly what i needed
@gillessabathe6086
@gillessabathe6086 3 жыл бұрын
Thanks for this video !
@jakeparrotta7372
@jakeparrotta7372 3 жыл бұрын
Wow I was able to do this line by line, and then repurpose it for another API. Thanks so much WPCasts, let me know if I can buy you a coffee (virtually) Cheers!!!
@jakeparrotta7372
@jakeparrotta7372 3 жыл бұрын
Nevermind lol found your Patreon!! 👍🏼
@jakeparrotta7372
@jakeparrotta7372 2 жыл бұрын
@wpcasts If you have a moment to reply I am really stuck! I am finding that my it takes a long time for my admin-ajax call to load, and some of the posts are duplicates. Is this because I am overloading the script with so many db queries and update_fields? I am mapping over 270 fields for many post objects at once. What would be a better action hook? maybe init? or some wp api one? Please help
@pierrot8762
@pierrot8762 Жыл бұрын
Hi I'm japanese. your video is very great‼ Thanks
@kmmarch60
@kmmarch60 2 жыл бұрын
Great tutorial! I'm trying to figure out how to import products into WooCommerce via an API. This has helped me immensely.
@rizzaValdemoro-by1bo
@rizzaValdemoro-by1bo 23 күн бұрын
hello can you help to fetch api product woocomers?
@sufiansuhail9243
@sufiansuhail9243 3 жыл бұрын
Awesome, thank you very much
@propertunity
@propertunity Жыл бұрын
Hey Alex great video! Really glad I found you! Did you happen to do a video for when you created the interactive map for Brewlala ?
@VinceAlvare
@VinceAlvare 4 жыл бұрын
Very nice tutorial! I'm hoping this helps me work out how to scrape the ebay trading API and import to WooCommerce product data on a daily cycle. I could definitely see myself using this with ACF in the future as well. I'm not a php pro, and my API experience is limited, so this is extremely helpful in just wrapping my head around things. Keep the vids comin!
@felixlozada5260
@felixlozada5260 Жыл бұрын
how did you upload variable products in woocommerce?
@AiBusinessConsulting
@AiBusinessConsulting 5 жыл бұрын
Very nice tutorial. What editor do you use? Also could you have got this brewery info from the Google API? Also you should consider integrating Google reviews and when you got time change it so when some wants directions they stay on your site. I am really impressed with what you have done here and how simple your explanation was.
@rickyrozario1577
@rickyrozario1577 2 жыл бұрын
Hi, first of all great video! Learned a lot from it. I have one question, What if a brewery is deleted from the API? How will you find the obsolete brewary in your WordPress database and delete it there as well? What checks can we run to achieve this?
@alihussain1974
@alihussain1974 2 жыл бұрын
Please create more videos on API integration in wordpress. And thank you so much for such a Great video sir 😊❤️
@Itsrichayo
@Itsrichayo 4 жыл бұрын
This is a great job. I love the explainers though I had a tough time following you. This means I have a lot to learn. Do you collaborate on projects?
@nagg9007
@nagg9007 4 жыл бұрын
Really helpful. Looking for this kind of stuff. Can we display this on seperate page? Let's say Im integrating with different API, so for each API I need to create a page then show results there.
@manassane4681
@manassane4681 3 жыл бұрын
Great video. To the point. Can you help me in understanding which theme is used here?
@user-ub7xo3qz2b
@user-ub7xo3qz2b 5 жыл бұрын
Thanks for another amazing tutorial. I really hope you set up a patreon or do a udemy course at some point, it would be great to support such useful content!
@paul7973
@paul7973 4 жыл бұрын
One of the best tutorials I've seen on this subject by far... but I died when you decided not to show the front-end. Do you think you'll ever take what this tutorial delivered and extend it a little further to show how you created what you did with the map and search etc?
@joyprince6301
@joyprince6301 Жыл бұрын
Its really awesome video, do you have any video based on using the api data from custom fields in the Website?
@GregRobinsonHD
@GregRobinsonHD 3 жыл бұрын
Great tutorial, thanks! Just curious: which JSON formatter/viewer are you using within your web browser to make the text more readable? (see 0:47s)
@janpanev2820
@janpanev2820 4 жыл бұрын
Thanks for that great video! Which program do you use for coding? I like the Wordpress tooltips it's displaying.
@pasizdobrekuce
@pasizdobrekuce 3 жыл бұрын
I want to buy you a beer. This is actually one of rare WP "real world case" tuts. Include "buy me a beer" link in your posts.
@WPCasts
@WPCasts 3 жыл бұрын
I'm really glad you found it helpful! The only thing I have currently is a Patreon: www.patreon.com/wpcasts
3 жыл бұрын
Dude! you cover every theme I am looking for! I just seen the first minute of this video and its just what I need. Thank you! Where is your patreon page!
@WPCasts
@WPCasts 3 жыл бұрын
I’m so glad! It’s www.patreon.com/wpcasts we also have a few exclusive videos over there :)
3 жыл бұрын
Found it!
@DavidMSSmith
@DavidMSSmith 4 жыл бұрын
Is there a followup video where you show how you created the front end? Otherwise, pretty cool!
@daviduarte22
@daviduarte22 Жыл бұрын
thank you very much for sharing the content, by any chance if I want to save the information in taxonomies, could I save it?
@berenjor
@berenjor 3 жыл бұрын
Is it possible that the key for each field in custom field is now only available with the pro version of Advanced Custom Fields?
@bollachabchobtikawa6737
@bollachabchobtikawa6737 2 жыл бұрын
😍😍 Amazing Video 😍😍
@serifahmet
@serifahmet 2 жыл бұрын
Thank you for this very useful tutorial. However in my case I was not able to write the fields created by ACF. I was able to see the post titles in the custom post type I created however not necessarily the contents of the ACF fields I created. What in your opinion is the problem? Thank you...
@phoneyiam123
@phoneyiam123 2 жыл бұрын
Any idea as to why there would be two entries created instead of just one? They both have the same permalink but show up twice in the Breweries CPT.
@mercadoclic7780
@mercadoclic7780 2 жыл бұрын
Wow! its very usefull. I have one question, What theme do you used in this example?
@andreas-stricker
@andreas-stricker 3 жыл бұрын
really nice explained! But what if a brewery gets deleted in the api? The brewery would still exist as a custom post type, right?
@tschroeder131313
@tschroeder131313 Жыл бұрын
Do we have the tutorial for building the map section? I have this part done all ready :)
@justinbrown8214
@justinbrown8214 Ай бұрын
Hi @WPCasts, Love your video. I'm making progress but my api is a bit more complicated as it's json array has multiple dimensions to it, I can successfully parse info from the first dimension, but none of the subsequent dimensions. Do you have any idea why this might be? Thanks a bunch!
@Arnaudherr
@Arnaudherr 2 ай бұрын
Hey thanks for this very helpful tuto 😇 How can we deal with multilingual blog using polylang ?
@user-tx6mp7on1t
@user-tx6mp7on1t 10 ай бұрын
very nice !!!!! question .... how did you do the map thing
@felixlvh
@felixlvh 4 жыл бұрын
Will you have a complete course for integrating third party api to wordpress?
@HasinthaWeragala
@HasinthaWeragala Жыл бұрын
good video.
@davidjordan9365
@davidjordan9365 Жыл бұрын
Hi, this tutorial is very helpful. I do have a question about being able to replicate this using the Divi Theme. Thanks!
@Star-egy
@Star-egy 3 жыл бұрын
Nice video
@vehbirestelica2243
@vehbirestelica2243 2 жыл бұрын
Hi, I really enjoyed this video!! I have a question regarding the json showing in the wp. I did all the steps u showed, but still couldnt get any data! Ps the API is showing as XML(not as JSON), could that be the problem? Thanks in advance :)
@gobodeath1214
@gobodeath1214 4 жыл бұрын
I've seen that when sending the $url parameter in the wp_remote_get the function esc_url_raw() is used, do you know why? I see you don't use it, but wanna know whyt
@patrick8105
@patrick8105 3 жыл бұрын
Could you please make a video on how to import/use the code. Thanks
@alcantaraallan
@alcantaraallan Жыл бұрын
Hello Thank you for this, i subscribed because of this. question do you have something that interacts with the external API like CRUD? i think this included a authentication if im right. thank you again.
@justinbrown8214
@justinbrown8214 Ай бұрын
Is there a reason to do this with recursion instead of a for loop? It seems easier to me for my cases. Thanks!
@pasizdobrekuce
@pasizdobrekuce 4 жыл бұрын
Gold.
@johnballo2402
@johnballo2402 4 жыл бұрын
Do Bank API also for a gateway payment. Thanks
@anigarzat7
@anigarzat7 3 ай бұрын
Great!! I am looking for a wordpress plugin or script that works with ticketmaster API to import the events or concerts from ticket master into my worpdress pages or posts. Can you help me? thanks!!
@justinbrown8214
@justinbrown8214 2 ай бұрын
What's the best way to do this if the API I'm using has multiple dimensions to the data? Is there a different custom field data type I can use? Thanks for your video!
@eugeneloggenberg1885
@eugeneloggenberg1885 2 жыл бұрын
How would you go about adding images and image galleries to the ACF from the API information? Is there any way to contact you to get a quote on such a project?
@johngiftakis9878
@johngiftakis9878 3 жыл бұрын
How we could make a Webhook so for example when a Plugin is installed to send a REST API call to a 3rd party backend and not using cron job?
@meeramadhu4392
@meeramadhu4392 4 жыл бұрын
hai,,,, how to get the product inforamtion from one ecommerce website to another by using api can plz suggest a youtube video realated to that.
@afflictionmarketing5303
@afflictionmarketing5303 3 жыл бұрын
Can you please make a tutorial on create a shortcode that print two pages output with end points. For example : in woocommerce my-account short code is printing 6 pages by just one shortcode. Thank you in advance.
@MichaelRBurke
@MichaelRBurke 3 жыл бұрын
Because of this video I just realized API backwards is IPA.
@denisecknauer4627
@denisecknauer4627 3 жыл бұрын
Creating of such Custom Post Type will allow anyone to update values through REST API by checking wp-json options?
@rajendraparmar1501
@rajendraparmar1501 3 жыл бұрын
Great job Sir!!!, How to integrate external API with a thumbnail (file and text data)?.. @thanks
@danielrozin9843
@danielrozin9843 Жыл бұрын
I have 2 wordpress websites that I need to sync the ACF dynamic field between them. When some list is uploaded at the first website, I want that the same list will be upload on the 2nd website, automatically. What is the best way to make it happen?
@victor_venema
@victor_venema 5 жыл бұрын
Nice to see how this works. If I see it right, for every iteration with 50 new breweries, you also (check to) store all the old breweries again: the foreach() goes over all breweries, not just the new ones. The final result will be okay, but it is a bit wasteful. Is there a special reason to do the recursions by calling the page via Ajax? I never coded something recursively in Wordpress. Could you not directly call the function? If not, wouldn't a while() be an easier way to handle an unknown number of API calls?
@bobbuilder3748
@bobbuilder3748 2 жыл бұрын
This isn't really recursion, it's a way to send requests sequentially without blocking. Using while or calling directly would block, and calling functions recursively to handle an unknown amount of data is a bad idea. I also noticed the 'feature' where breweries are updated unnecessarily. That didn't bother me so much, but there is one glaring omission to this example. What happens if a brewery is deleted or renamed? Deleted entries are not removed, and renaming would cause duplicate entries. There is probably no need to create a new unique ID. A sane API would assign a permanent unique ID, so I would assume the 'id' filed provided by openbrewerydb to be the unique identifier unless documentation specified otherwise.
@Johnathonaaron
@Johnathonaaron 2 жыл бұрын
Is this storing the breweries data into the wp MySql server? Or is it calling it every time the costomer comes. If it does call it once and store it then how do you handle updates?
@felixlozada5260
@felixlozada5260 Жыл бұрын
Hello, how would be the process to insert url of external images to an acf pro gallery?
@gobodeath1214
@gobodeath1214 4 жыл бұрын
fcking useful tutorial! although Wordpress is just a shitty CMS I needed to connect to an API from a wordpress endpoint and this help me to get started, very nice tutorial boi
@ivanmitic52
@ivanmitic52 2 жыл бұрын
Hi , i have a question about this part 'if( $brewery->updated_at >= $exisiting_brewerey_timestamp )' , why you checking '>=' , then condition will always be true , not only if job 'updated on' was bigger , also you are checking if post exists by 'slug' , if in the api title is changed , that will be considered as a new post , which will add post twice
@adarshsoni5323
@adarshsoni5323 4 жыл бұрын
Hi wo casts could u please a video series on theme development to make a theme like wp astra or ocean wo, in those theme the customizer has tons of options also there customizer is not normal like normal theme they use backbone js in that, please make a video series to make theme like that
@creadigma360
@creadigma360 2 жыл бұрын
Cool, but what If I don't have an 'updated at' value return from my data? How can I check if the information was updated?
@JingMingLi
@JingMingLi 3 жыл бұрын
What if we are using a wordpress theme with a custom post type that does not show Field_keys?
@colandru
@colandru 3 жыл бұрын
If I would decide, could I achieve this with Python instead of PHP? thanks in advance
@malves82
@malves82 Жыл бұрын
Is there anyway to use this method to scrap my offline website that is saved on my laptop?
@davidebordin4499
@davidebordin4499 2 жыл бұрын
Thank you. I have an api in which I’m registered with id and password, why wp_remote_get return me an unauthorized response ?
3 Methods for AJAX in WordPress | Which Method is the Best?
23:09
WordPress REST API Tutorial (Real Examples)
49:31
LearnWebCode
Рет қаралды 480 М.
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН
Я нашел кто меня пранкует!
00:51
Аришнев
Рет қаралды 2 МЛН
1❤️
00:17
Nonomen ノノメン
Рет қаралды 4,5 МЛН
These Coding Projects Give You An Unfair Advantage
14:39
Harkirat Singh
Рет қаралды 324 М.
Part 1: Actions - WordPress Hooks Tutorial For Beginners 2019
12:11
How to Display Posts and ACF Fields in WordPress (2 Ways)
32:44
Envato Tuts+
Рет қаралды 27 М.
WP REST API - Custom Endpoints
14:00
Watch and Learn
Рет қаралды 78 М.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
Using the WordPress API
14:51
iEatWebsites
Рет қаралды 34 М.
Working With APIs in Python - Pagination and Data Extraction
22:36
John Watson Rooney
Рет қаралды 94 М.
Haha😂 Power💪 #trending #funny #viral #shorts
00:18
Reaction Station TV
Рет қаралды 15 МЛН