0

i have the latest installation of wordpress. what i want to do is this:

Suppose i have a site at www.mysite.com and it is running wordpress now i want to create API for mobile app to get data from site using php.

can i create separate API for to get data from wordpress site?

if it can, How to create?

Sai Kumar
  • 53
  • 1
  • 9
  • Possible duplicate of [Is there a wordpress plugin for creating an API from your site?](http://stackoverflow.com/questions/2751973/is-there-a-wordpress-plugin-for-creating-an-api-from-your-site) –  Jan 20 '16 at 06:37
  • Ok thanks mate @fzxt – Sai Kumar Jan 29 '16 at 07:35

3 Answers3

2

You can try WP REST API. Install this plugin to your wordpress site then, you can access your site data through api calls.

ved
  • 96
  • 3
  • 10
1

Install JSON API plugin for web services here is the link https://wordpress.org/plugins/json-api/

you can also make extra web service and change webservice by modifying plugin files.

Harsh
  • 476
  • 1
  • 4
  • 10
  • using that JSON API plugin will get automatic api call for all plugins? – Sai Kumar Jan 20 '16 at 06:37
  • No, it will give basic web services for your wordpress posts , pages , categories etc. if you like my answer then upvote it. – Harsh Jan 20 '16 at 06:41
  • Follow this Link https://wordpress.org/plugins/json-api/other_notes/ it will help you for how to call json web service using this plugin – Harsh Jan 20 '16 at 06:48
1

Try - WP REST API V2

http://v2.wp-api.org/

downlaod plugin and install it.

https://wordpress.org/plugins/json-rest-api/

just type /wp-json/wp/v2/posts in end of your site url and you will get all post.

for get all post

www.mysite.com/wp-json/wp/v2/posts

For the search functionality - search test post

/wp-json/wp/v2/posts?filter[s]=test

much more details from this link http://v2.wp-api.org/reference/posts/

Note for best result use latest version of WP

other is you can also try Json api plugin but this 1 is best.

Jitendra Popat
  • 2,594
  • 1
  • 15
  • 15