Accessing WordPress data via JSON gives HTML data for certain keys

  1. which wordpress api could give me a list of all the articles as json?

You’re already using the right API, just remember it’s paginated so you need to request the second/third page/etc in a separate request. It’ll pass how many apges there are in the http header

  1. I found a particular api doing the above same task as point (1.). is it a standard one?

You list posts via the REST API by querying wp-json/wp/v2/posts. Other endpoints exist for other post types such as pages etc

  1. Is it a standard behavior of wordpress apis to have html content directly inside their json key-value pairs?

Yes, if you wanted to display the post you would need the post content. Otherwise how would you display the post?


I think what we’re seeing is a misunderstanding. You never stated what it was that you wanted, just that it’s somewhere in the content HTML. So I think this is what has happened:

  • The post uses a shortcode to display data taken from elsewhere
  • Your app is pulling in the post via the REST API
  • You’re looking at the shortcodes output and wondering how to extract the data in your Android app.

You could parse the HTML using an android library of sorts, assuming it’s consistent, or, you could look at where the shortcode gets its information from and access it directly.

Sadly, you never actually said what the data you wanted was, and we don’t know what the shortcode that generates that output is. Without access to the implementation of the shortcode it’s not possible to say how to expose the information. A shortcode is a PHP function that’s registered under a name, and swaps a string such as [shortcode] with HTML tags. That PHP function might draw the data from post meta, or it might access a custom database table, or even make a HTTP request to a remote API, so no generic solution is possible.

dpn-zvc-shortcode-op-wrapper gives us a clue as to what the shortcode might be, but you would need to look at how the shortcode works to know that, and you didn’t mentiion the shortcodes name. A quick google shows that HTML class appears in a support request for a Zoom plugin, so you would need to go via their support route as 3rd party plugin support is offtopic here.