0

First of all, I'm a total WordPress newbie and I genuinely couldn't find an answer to my question:

I have a site hosted in WordPress (https://srebelo80.wordpress.com) which I'm planning to use as a testing API endpoint, however, when I test the endpoint https://srebelo80.wordpress.com/wp-json/wp/v2/posts I get a Page not found.

I'm reading the documentation and it seems like WordPress has integrated Rest API to the core so in technically this should work without any plug-ins?

Am I missing something?

Thanks a lot in advance for your help.

  • wordpress.com is not self-hosted. "Self-hosted" refers to sites that are not on WordPress.com. The API works differently on WordPress.com. developer.wordpress.com/docs/api – Jacob Peattie Dec 4 '18 at 12:01
  • Yes, I'm editing that part. I meant hosted on WP :) – Teknotica Dec 4 '18 at 12:14
1

I'm pretty sure you're not using self-hosted WP, since you clearly mentioned that your site is running on wordpress.com...

And if it really is hosted on WordPress.com, then you'll have to use REST API a little bit different.

Your API is available here:

https://public-api.wordpress.com/wp/v2/sites/srebelo80.wordpress.com

Here you can find Console - you can use it for easy testing: https://developer.wordpress.com/docs/api/console/

| improve this answer | |
  • Yes, sorry, I meant public hosted :) Cool, this is all I wanted to know. Thanks a lot! – Teknotica Dec 4 '18 at 12:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.