How To Interact With A Simple API in WordPress - Advanced WordPress Tutorial
Вставка
- Опубліковано 27 тра 2019
- 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
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
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!
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!
THIS video helped me saving my ass to my project. I really appreciate your effort on doing this video. Thanks Alex!
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.
Your videos are just unbelievably simple professional and amazing
Not specifically looking for this function but this tutorial is 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".
Hey Alex! Amazingly straightforward video and exactly what I needed for the project I'm working on! Right on!
Wow. This is a great video tutorial, a starting point for integrating any possible API. Thank you!
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.
Great overview of some new to me wp functions. I learned several things from your video. Thanks!
Incredible, man! Good job you did here, congrats!
Incredibly useful and well delivered. Thank you!
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 - ...
I really appreciate your effort on doing this video. Thanks!
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. 👍
Increible tutorial, ya con esto lo combinas con un oage builder y haces magia, de verdad muchas gracias
this is amazing. really well explained and informative. thank you.
I love this cast. Great work mate!
Hi
I'm japanese.
your video is very great‼
Thanks
This was a phenomenal explanation. Thank you!
Thanks a lot!!!, this video really help me.
Amazing!! Can you plz give us a how-to series on building a whole CRUD app using WP Graph QL and React? Pleeeease?
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?
This is a legendary WP video!!
Please create more videos on API integration in wordpress. And thank you so much for such a Great video sir 😊❤️
Awesome tutorial !
Awesome 👏. Thanks a ton for this valuable content. 🙏
Very clear and well explained. Thank alot.
Congrats for the tutorial. It really helped me.
Great. Really new thing for me. It's heavy and I like it
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
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?
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?
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.
Amazing video! Thank you!
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?
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 ?
I finished an Ad as a thank you.
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.
Wow, great video, I love it!
Excellent tutorial
Great video. To the point. Can you help me in understanding which theme is used here?
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
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!
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...
Thanks for this video !
Is it possible that the key for each field in custom field is now only available with the pro version of Advanced Custom Fields?
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)
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.
Its really awesome video,
do you have any video based on using the api data from custom fields in the Website?
Awesome, thank you very much
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?
Thanks for that great video! Which program do you use for coding? I like the Wordpress tooltips it's displaying.
really nice explained! But what if a brewery gets deleted in the api? The brewery would still exist as a custom post type, right?
thank you very much for sharing the content, by any chance if I want to save the information in taxonomies, could I save it?
Hey thanks for this very helpful tuto 😇 How can we deal with multilingual blog using polylang ?
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!
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?
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 :)
Is there a reason to do this with recursion instead of a for loop? It seems easier to me for my cases.
Thanks!
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!
Will you have a complete course for integrating third party api to wordpress?
Do we have the tutorial for building the map section? I have this part done all ready :)
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!
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?
Is there a followup video where you show how you created the front end? Otherwise, pretty cool!
Wow! its very usefull. I have one question, What theme do you used in this example?
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!!
very nice !!!!! question .... how did you do the map thing
Creating of such Custom Post Type will allow anyone to update values through REST API by checking wp-json options?
Hello, how would be the process to insert url of external images to an acf pro gallery?
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?
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.
Could you please make a video on how to import/use the code. Thanks
Hi, this tutorial is very helpful. I do have a question about being able to replicate this using the Divi Theme. Thanks!
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
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.
What if we are using a wordpress theme with a custom post type that does not show Field_keys?
If I would decide, could I achieve this with Python instead of PHP? thanks in advance
this is exactly what i needed
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)
Thank you. I have an api in which I’m registered with id and password, why wp_remote_get return me an unauthorized response ?
Can I integrate API from Ebay and Discogs into a Wordpress website I have built ?
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
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?
Is there anyway to use this method to scrap my offline website that is saved on my laptop?
I am having troubles following the example with arrow selectors as an example
update_field( $key, $brewery->$name, $inserted_brewery ); doesnt work for me
update_field( $key, $brewery[$name], $inserted_brewery ); does work fine
I dont know how to find the difference, is an array or object notation issue or neigher of them :( ?
where do you save the edited code in the wordpress?
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.
Can we create the CPT with a plugin instead of coding?
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 ..
This repository has been archived by the owner. It is now read-only.
What to use instead?
Do Bank API also for a gateway payment. Thanks
What is the tool that he is using to code this? I cant find the report.txt in wordpress
Is there a way to protect a custom Rest API especially when POST Request
I run this in admin panel: admin-ajax.php?action=get_breweries_from_api but my report.txt file is not created please help, then I created manually the report.txt file and it is not showing any content in it, sorry I am new in wordpress api learning. Thanks