As of Jetpack 1.9, the WordPress.com REST API can now access self-hosted WordPress blogs with the Jetpack plugin installed.

Instead of just building for the WordPress.com platform, you can build awesome applications that interact with WordPress in general. Any applications built using the API for WordPress.com will automatically work with Jetpack-enabled sites running Jetpack 1.9 or higher.

Check out our documentation, create an app, and get started today!

21 thoughts on “Using the REST API with WordPress.org self-hosted sites via Jetpack

  1. QUESTION: is there a link that explains why REST API can be useful and show examples? This sounds like something that would be a valuable tool but Google searches take me to technical explanations.

    It’s like I’m trying to find out about uses for a jackhammer and everything is telling me about air pressure, vibration, and safety precautions. But nothing plainly stating. “This is for busting up concrete when you need to get at piping underneath, or need to remove a section of bad road to repave it.”

    HELP?

    1. The REST API is provided specifically for developers to be able to programmatically interact with WordPress.com/Jetpack-powered blogs (e.g. via raw data, rather than going to a webpage etc). It can be used for all sorts of things, including editing posts in a different interface, creating new posts based on user input in your own application, loading the content from a site, Following and Liking posts, etc. What it’s used for is kind of up to the developers who choose to use it 🙂

  2. More than a little confused how this works with a self hosted site.

    – Is everything still going through the wordpress.com public API – which then access our self hosted site (via Jetpack link)?

    – Is user authentication, authenticating against accounts that have been created on our own site, or is it just authenticating users who have wordpress.com accounts?

    – Any plans to release a rest api for wordpress.org self hosted sites that allows them to operate independently of wordpress.com?

  3. The public JSON API is not working at all for my self-hosted site with JetPack installed and connected. Is there a tutorial that explains this? Also, the sites not hosted at the domain root. its in a subdirectory: site.com/folder/wordpress

  4. I did not see this in the documentation: is it possible to get data for wordpress PAGES? Also, what about data that may be used by a plug-in, widget and so on?

    There is some great potential for using WP as the back-end for some great website experiences. I am excited to experiment!

    1. You can get pages by making a request to the /sites/$site/posts/ endpoint, with the type parameter set to page.

      Most plugins/themes store their preferences as options, which we currently don’t expose via the API, but we’re looking at the best way to do that.

  5. Possible to use this with ajax? Looks like even with self-hosted sites, you have CORS issues. How do you set the access-control-allow-origin header to make use of this? Setting a header at the beginning of response in my child theme does not make it into the response from the public api call. However, the filters in my child theme do effect the response and work great…

Comments are closed.