1

Currently, I want to get data from my personal blog on WordPress to put through my personal website. I tried using this URL: https://shopssam.wordpress.com/wp/v2/posts and it didn't work. After a while of researching, there must be more tweaks in PermaLinks. And I can't find it anywhere in the WordPress home page settings.

O. Jones
  • 103,626
  • 17
  • 118
  • 172
nguyen sam
  • 43
  • 8

2 Answers2

2

wordpress.com use different REST API than normal wordpress.org.

First find your Site ID from link bellow: https://dashboard.wordpress.com/wp-admin/index.php?page=my-blogs

Then replace SITEID in below parameter to get all posts: https://public-api.wordpress.com/rest/v1/sites/{YOUR_SITE_ID_GOES_HERE}/posts

Reza Kia
  • 400
  • 1
  • 7
  • I've done it already. Thank you very much. At first I thought siteID was a number. Turns out that was the path name of my blog – nguyen sam Jun 11 '23 at 13:13
1

For those who need a clearer answer. You can read the information here: https://developer.wordpress.com/docs/api/. This is a document for Wordpress.com, be careful when using Wordpress, because despite having the same name, WordPress.com and WordPress.org have completely different ways of working. And here is the exact API URL that I modified to get the data: https://public-api.wordpress.com/rest/v1/sites/shopssam.wordpress.com/posts

Which shopssam.wordpress.com is my blog URL.

nguyen sam
  • 43
  • 8