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.
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
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!
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. 👍
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!
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".
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?
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.
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?
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!!!
@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
You can create a service to verify "closed" breweries. For example: Comparing “local” breweries array x remote array and then remove the “single” local brewery.
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.
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.
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?
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.
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!
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!
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!
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 - ...
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.
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!
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?
Is there a reason to do this recursively instead of a simple loop? Recursive functions are notoriously ineffecient, at least in app and desktop development, and can result in memory issues, especially if the call gets stuck due to a programming error with the return/exit logic. Only just reason I can think of is if php actions asyncronous and you are trying to spread out the load. New to web dev so I'm unsure if it works that way. Seems like actions are really just function callbacks behind the scenes. If those are called based on intervals or events then I can see the reasoning but if they are called procedurally then this would be much simpler and efficient with a loop. Feedback is appreciated, as is your video. Great for experienced programers new to wordpress dev.
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.
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
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!!
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...
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!
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 :)
how can we register a hook to external api. lets say I have api, it spits out changes based on some events. I want to hook/listen to those changes in wordpress. (API hooks)
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?
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?
Thanks for the great example! Do you have any tips for garbage collection? Say the brewery no longer exists in the API but it will still remain in your WordPress collection?
I have a question which may sound really stupid. Can the user of the website see these API call requests? Because I am using an API that requires a key so that key should be hidden from the user. So is this method secure for hiding the API key?
Sign up for the newsletter to notified about the free 2020 WordPress Development Course: wpcasts.tv
i cannot reach wpcasts website
Link is an empty wordpress website. By the way thank you for great video.
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.
Wow ! Keep inspiring us young ones sir!
how are you doing today sir?
Sweet! I'm 67 and started programming when I was 47 and made a nice living from it. You rock!
thats awesome!!!
Hey Mountain, I really inspire me. Best of luck
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
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!
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. 👍
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!
Is there a reason to do this with recursion instead of a for loop? It seems easier to me for my cases.
Thanks!
Your videos are just unbelievably simple professional and amazing
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".
THIS video helped me saving my ass to my project. I really appreciate your effort on doing this video. Thanks Alex!
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?
Not specifically looking for this function but this tutorial is amazing!
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.
Wow. This is a great video tutorial, a starting point for integrating any possible API. Thank you!
Hey Alex! Amazingly straightforward video and exactly what I needed for the project I'm working on! Right on!
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?
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!!!
Nevermind lol found your Patreon!! 👍🏼
@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
This is a legendary WP video!!
Great tutorial! I'm trying to figure out how to import products into WooCommerce via an API. This has helped me immensely.
hello can you help to fetch api product woocomers?
Great tutorial ..... BUT what if a brewery is deleted from the API list, then its not deleted in the local db?
You can create a service to verify "closed" breweries.
For example:
Comparing “local” breweries array x remote array and then remove the “single” local brewery.
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.
Is it possible that the key for each field in custom field is now only available with the pro version of Advanced Custom Fields?
Hi
I'm japanese.
your video is very great‼
Thanks
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.
very nice !!!!! question .... how did you do the map thing
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?
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.
Amazing!! Can you plz give us a how-to series on building a whole CRUD app using WP Graph QL and React? Pleeeease?
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!
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!
Do Bank API also for a gateway payment. Thanks
Do we have the tutorial for building the map section? I have this part done all ready :)
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.
really nice explained! But what if a brewery gets deleted in the api? The brewery would still exist as a custom post type, right?
Hey thanks for this very helpful tuto 😇 How can we deal with multilingual blog using polylang ?
Incredibly useful and well delivered. Thank you!
This was a phenomenal explanation. Thank you!
this is exactly what i needed
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!
I’m so glad! It’s www.patreon.com/wpcasts we also have a few exclusive videos over there :)
Found it!
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 - ...
Is there a way of making the data live? So instead of cron running weekly it's more instant - as soon as a change is made the post is updated?
i need this too
I finished an Ad as a thank you.
Its really awesome video,
do you have any video based on using the api data from custom fields in the Website?
Will you have a complete course for integrating third party api to wordpress?
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 ?
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.
Because of this video I just realized API backwards is IPA.
Incredible, man! Good job you did here, congrats!
thank you very much for sharing the content, by any chance if I want to save the information in taxonomies, could I save it?
Awesome tutorial !
Great video. To the point. Can you help me in understanding which theme is used here?
Hi, this tutorial is very helpful. I do have a question about being able to replicate this using the Divi Theme. Thanks!
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!
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?
Is there a reason to do this recursively instead of a simple loop?
Recursive functions are notoriously ineffecient, at least in app and desktop development, and can result in memory issues, especially if the call gets stuck due to a programming error with the return/exit logic.
Only just reason I can think of is if php actions asyncronous and you are trying to spread out the load.
New to web dev so I'm unsure if it works that way. Seems like actions are really just function callbacks behind the scenes. If those are called based on intervals or events then I can see the reasoning but if they are called procedurally then this would be much simpler and efficient with a loop.
Feedback is appreciated, as is your video. Great for experienced programers new to wordpress dev.
Wow! its very usefull. I have one question, What theme do you used in this example?
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.
Why not just use a for loop tho?
Great overview of some new to me wp functions. I learned several things from your video. Thanks!
I love this cast. Great work mate!
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
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.
I'm really glad you found it helpful! The only thing I have currently is a Patreon: www.patreon.com/wpcasts
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!!
Hello, how would be the process to insert url of external images to an acf pro gallery?
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...
Congrats for the tutorial. It really helped me.
I really appreciate your effort on doing this video. Thanks!
Could you please make a video on how to import/use the code. Thanks
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!
how did you upload variable products in woocommerce?
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 :)
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?
Thank you. I have an api in which I’m registered with id and password, why wp_remote_get return me an unauthorized response ?
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.
Is there a way to protect a custom Rest API especially when POST Request
Very clear and well explained. Thank alot.
how can we register a hook to external api. lets say I have api, it spits out changes based on some events. I want to hook/listen to those changes in wordpress. (API hooks)
Creating of such Custom Post Type will allow anyone to update values through REST API by checking wp-json options?
Increible tutorial, ya con esto lo combinas con un oage builder y haces magia, de verdad muchas gracias
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?
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?
Please create more videos on API integration in wordpress. And thank you so much for such a Great video sir 😊❤️
this is amazing. really well explained and informative. thank you.
Yes. I having problem following this tutorial.. Can you help me with it.
Would you be willing to teach me more about WP API work? I live in SW Harbor ME. Thanks
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?
Can we create the CPT with a plugin instead of coding?
Thanks for that great video! Which program do you use for coding? I like the Wordpress tooltips it's displaying.
Thanks for the great example! Do you have any tips for garbage collection? Say the brewery no longer exists in the API but it will still remain in your WordPress collection?
Possibly a separate Cron that is monthly? It would probably have to delete and re-add all the breweries.
Could you do a looped api call for the specifc brewery id for each post you have, if the response is null then delete that post.
If I would decide, could I achieve this with Python instead of PHP? thanks in advance
Thanks a lot!!!, this video really help me.
gr8 tutorial. Have u stopped making tutorials?
I dont understand why you chose to make the function recursive instead of using a loop and append to the array and increment current_body
Can I integrate API from Ebay and Discogs into a Wordpress website I have built ?
Is there a followup video where you show how you created the front end? Otherwise, pretty cool!
Hi, do you offer a development service? I need something list this with little bit of modifications. Thanks
where do you save the edited code in the wordpress?
What if we are using a wordpress theme with a custom post type that does not show Field_keys?
can we do without advanced custom field ?
How could i work with products instead of custom post?
hello when i try to call admin url it gives me result of only one page but when i used it to fill the report.txt it goes through every page ..
I have a question which may sound really stupid. Can the user of the website see these API call requests? Because I am using an API that requires a key so that key should be hidden from the user. So is this method secure for hiding the API key?