100
Views
7
Comments
[Blogs Connector] Wordpress Api Base URL
Question
blogs-connector
Web icon
Forge asset by Nuno Reis

I tried my blog URL to get,

But it always shows 404 not found. 

Is there any specific way to find the URL of my wordpress?

2016-04-22 00-29-45
Nuno Reis
 
MVP

What version is your WP? It only works in 4.7 and above.

I did it based in the documentation at https://v2.wp-api.org/ and it worked for 90% of the blogs I tested.

Can you share the blog URL?

2025-02-26 08-43-44
kaarthick Velraj

Nuno Reis wrote:

What version is your WP? It only works in 4.7 and above.

I did it based in the documentation at https://v2.wp-api.org/ and it worked for 90% of the blogs I tested.

Can you share the blog URL?

Blog URL : https://sportsmadeeasy.blog

Above is my blog page URL and how to get blog posts from this?


2016-04-22 00-29-45
Nuno Reis
 
MVP

Apparently while self-hosted blogs are

https://blog.nunoreis.pt/wp-json/wp/v2/

for blogs hosted at wordpress.com the URL is:

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

Similar to what Blogger has.

It can be done at the root.



You need to make a minor adjustment on each method for it to work and change to this format

https://public-api.wordpress.com/wp/v2/sites/sportsmadeeasy.blog/posts?

It means going on each of the methods and delete the start of the URL

Tomorrow I'll publish a fixed version that will guess if it is a wordpress.com or a wordpress.org.


2016-04-22 00-29-45
Nuno Reis
 
MVP

Hi Keerthi.

It is now working. I published a new version and tested with several blogs wodpess.com including yours. There was a minor bug in the GetPages that prevented the correct usage in Example so I made a 2.0.1 version to fix it.

2025-02-26 08-43-44
kaarthick Velraj

Nuno Reis wrote:

Hi Keerthi.

It is now working. I published a new version and tested with several blogs wodpess.com including yours. There was a minor bug in the GetPages that prevented the correct usage in Example so I made a 2.0.1 version to fix it.

Hi Nuno,

              It is working fine. But I couldn't get image of the blog and featured image from the response. How can I get the image of the blog from this? 

Thanks in advance.



2026-02-19 02-54-36
Keerthi Vasan V

Thanks Nuno,


Will look at it and let you know : )

2016-04-22 00-29-45
Nuno Reis
 
MVP

My goal with this component was to save the texts.
Images usually are stored locally by the user, but everyone forgets the text.

Each post has an id in featured_media field. You can get the full link in links->wp_featuredmedia, but it simply points to a new method where you can get the image path. That one is not implemented here.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.