2017 © Pedro Peláez
 

wordpress-plugin wp-api

Access your WordPress site's data through an easy-to-use HTTP REST API.

image

wp-api/wp-api

Access your WordPress site's data through an easy-to-use HTTP REST API.

  • Friday, January 6, 2017
  • by rmccue
  • Repository
  • 258 Watchers
  • 3974 Stars
  • 75,294 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 710 Forks
  • 52 Open issues
  • 54 Versions
  • 8 % Grown

The README.md

REST API

Access your WordPress site's data through an easy-to-use HTTP REST API., (*1)

Build Status, (*2)

About

WordPress is moving towards becoming a fully-fledged application framework, and we need new APIs. This project was born to create an easy-to-use, easy-to-understand and well-tested framework for creating these APIs, plus creating APIs for core., (*3)

This plugin provides an easy to use REST API, available via HTTP. Grab your site's data in simple JSON format, including users, posts, taxonomies and more. Retrieving or updating data is as simple as sending a HTTP request., (*4)

Want to get your site's posts? Simply send a GET request to /wp-json/posts. Update user with ID 4? Send a POST request to /wp-json/users/4. Get all posts with the search term "awesome"? GET /wp-json/posts?filter[s]=awesome. It's that easy., (*5)

WP API exposes a simple yet easy interface to WP Query, the posts API, post meta API, users API, revisions API and many more. Chances are, if you can do it with WordPress, WP API will let you do it., (*6)

WP API also includes an easy-to-use Javascript API based on Backbone models, allowing plugin and theme developers to get up and running without needing to know anything about the details of getting connected., (*7)

Check out our documentation for information on what's available in the API and how to use it. We've also got documentation on extending the API with extra data for plugin and theme developers!, (*8)

We're currently aiming for integration into WordPress 4.1 as a permanent part of core., (*9)

Installation

Drop this directory in and activate it. You need to be using pretty permalinks to use the plugin, as it uses custom rewrite rules to power the API., (*10)

Quick Setup

Want to test out WP-API and work on it? Here's how you can set up your own testing environment in a few easy steps:, (*11)

  1. Install Vagrant and VirtualBox.
  2. Clone Chassis:, (*12)

    git clone --recursive git@github.com:Chassis/Chassis.git api-tester
    
  3. Grab a copy of WP API:, (*13)

    cd api-tester
    mkdir -p content/plugins content/themes
    cp -r wp/wp-content/themes/* content/themes
    git clone git@github.com:WP-API/WP-API.git content/plugins/json-rest-api
    
  4. Start the virtual machine:, (*14)

    vagrant up
    
  5. Activate the plugin:, (*15)

    vagrant ssh -c 'cd /vagrant && wp plugin activate json-rest-api'
    
  6. Set the permalink structure to something other than the default, in order to enable the http://vagrant.local/wp-json/ endpoint URL (if you skip this step, it can be accessed at http://vagrant.local/?json_route=/):, (*16)

    vagrant ssh -c "cd /vagrant && wp rewrite structure '/%postname%/'"
    

You're done! You should now have a WordPress site available at http://vagrant.local; you can access the API via http://vagrant.local/wp-json/, (*17)

To access the admin interface, visit http://vagrant.local/wp/wp-admin and log in with the credentials below:, (*18)

Username: admin Password: password, (*19)

Testing

For testing, you'll need a little bit more:, (*20)

  1. Clone the Tester extension for Chassis:, (*21)

    # From your base directory, api-tester if following the steps from before
    git clone --recursive https://github.com/Chassis/Tester.git extensions/tester
    
  2. Update the wpdevel submodule in Chassis to latest on master from WordPress Git Mirror:, (*22)

    # From your base directory, api-tester if following the steps from before
    cd extensions/tester/wpdevel
    git checkout master
    git pull
    
  3. Run the provisioner:, (*23)

    vagrant provision
    
  4. Log in to the virtual machine and run the testing suite:, (*24)

    vagrant ssh
    cd /vagrant/content/plugins/json-rest-api
    phpunit
    

    You can also execute the tests in the context of the VM without SSHing into the virtual machine (this is equivalent to the above):, (*25)

    vagrant ssh -c 'cd /vagrant/content/plugins/json-rest-api && phpunit'
    

Issue Tracking

All tickets for the project are being tracked on GitHub. You can also take a look at the recent updates for the project., (*26)

Previous issues can be found on the [GSOC Trac][] issue tracker, however new issues should not be filed there., (*27)

The Versions

06/01 2017

dev-develop

dev-develop http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

19/10 2016

dev-issue-2657

dev-issue-2657 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

17/10 2016

dev-polymorphic-fields-no-sanitization

dev-polymorphic-fields-no-sanitization http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

17/10 2016

dev-title-sanitization-issue-2788

dev-title-sanitization-issue-2788 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

17/10 2016

dev-whitelist-meta-schema-types

dev-whitelist-meta-schema-types http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

12/10 2016

dev-test-dates-client-js-issue-137

dev-test-dates-client-js-issue-137 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

12/10 2016

dev-use-wp_term_query-cache

dev-use-wp_term_query-cache http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/10 2016

dev-improve-posts-collection-parameter-whitelisting

dev-improve-posts-collection-parameter-whitelisting http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

08/10 2016

2.0-beta15

2.0.0.0-beta15 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

07/10 2016

dev-fields-parameter

dev-fields-parameter http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

03/10 2016

dev-support-auto-draft

dev-support-auto-draft http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

01/10 2016

2.0-beta14

2.0.0.0-beta14 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

23/09 2016

dev-cache-schema-generation

dev-cache-schema-generation http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

31/07 2016

dev-fix-2616

dev-fix-2616 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

26/07 2016

dev-fix-user-search-test

dev-fix-user-search-test http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

26/07 2016

dev-fix-boolean-args

dev-fix-boolean-args http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

25/05 2016

dev-release-2-0-beta-13-1

dev-release-2-0-beta-13-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

25/05 2016

2.0-beta13.1

2.0.0.0-beta13.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

25/05 2016

dev-release-2-0-beta-12-1

dev-release-2-0-beta-12-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

25/05 2016

2.0-beta12.1

2.0.0.0-beta12.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

30/03 2016

2.0-beta13

2.0.0.0-beta13 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

18/03 2016

dev-curies-2

dev-curies-2 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

02/03 2016

dev-include-exclude-post-terms

dev-include-exclude-post-terms http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

09/02 2016

2.0-beta12

2.0.0.0-beta12 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

29/01 2016

dev-revert-2134-2118-type-controller

dev-revert-2134-2118-type-controller http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

26/01 2016

2.0-beta11

2.0.0.0-beta11 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta10

2.0.0.0-beta10 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-2-1

dev-release-beta-2-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta2.1

2.0.0.0-beta2.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-3-1

dev-release-beta-3-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta3.1

2.0.0.0-beta3.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-4-1

dev-release-beta-4-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta4.1

2.0.0.0-beta4.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-5-1

dev-release-beta-5-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta5.1

2.0.0.0-beta5.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-6-1

dev-release-beta-6-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta6.1

2.0.0.0-beta6.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-7-1

dev-release-beta-7-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta7.1

2.0.0.0-beta7.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-8-1

dev-release-beta-8-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta8.1

2.0.0.0-beta8.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

dev-release-beta-9-1

dev-release-beta-9-1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/01 2016

2.0-beta9.1

2.0.0.0-beta9.1 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

09/01 2016

dev-schema-abstraction

dev-schema-abstraction http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/12 2015

2.0-beta9

2.0.0.0-beta9 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

11/12 2015

dev-1706-consistently-show-context

dev-1706-consistently-show-context http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

02/12 2015

2.0-beta8

2.0.0.0-beta8 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

19/11 2015

2.0-beta7

2.0.0.0-beta7 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

12/11 2015

2.0-beta6

2.0.0.0-beta6 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

23/10 2015

2.0-beta5

2.0.0.0-beta5 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

28/08 2015

dev-1500-site-endpoint

dev-1500-site-endpoint http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

14/08 2015

2.0-beta4

2.0.0.0-beta4 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

02/07 2015

2.0-beta3

2.0.0.0-beta3 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires

28/05 2015

2.0-beta2

2.0.0.0-beta2 http://wp-api.org/

Access your WordPress site's data through an easy-to-use HTTP REST API.

  Sources   Download

GPL2+

The Requires

 

The Development Requires