json - Consume WooCommerce REST API with JavaScript - Stack Overflow

PHOTO EMBED

Sat Jun 26 2021 03:43:41 GMT+0000 (Coordinated Universal Time)

Saved by @rstringa

fetch('https://example.com/wp-json/wp/v2/posts')
  .then(response => response.json())
  .then(posts => {
    posts.forEach(post => {
      console.log(post.title.rendered);
    });
  });
content_copyCOPY

https://stackoverflow.com/questions/52855402/consume-woocommerce-rest-api-with-javascript