Wordpress offers the the ability to get the page in json format by adding /wp-json/ to the url.

Now my question is, does Joomla offer a similar option where I could retrieve the page in json format?

  • Welcome to JSE. Please take our tour while you wait for feedback/support. Can you explain the circumstances by which you feel it is necessary to json encode page output? Since web pages are presented as rendered html documents, I don't think it makes much sense for a CMS to try to serve html content as json. Do you have a particular set of pages that should have a "raw data as json" mode? Can you tell us more about your goal? There is probably a more professional way to handle your task. It sounds like you are experiencing an XY Problem.
    – mickmackusa
    Aug 17 at 22:03
  • @mickmackusa no reason in particular, simply wanted to know if Joomla offered that exact feature, but I don't think it does.
    – laso
    Aug 18 at 1:58
  • I can't imagine that it would bother to for the reasons previously mentioned -- but I am not an expert on this subject matter.
    – mickmackusa
    Aug 18 at 2:14

Yes it can, but as your question doesn't provide much detail it is impossible to say if the 'page' you are referring to is set up to provide data in JSON form.

Depending on the component involved it may provide the use of the format=json in the URL, it may be available via the com_ajax component and with Joomla 4 many of the core components now have an API that returns the data in JSON format.

Some more reading https://docs.joomla.org/JSON_Responses_with_JResponseJson and for Joomla 4 https://docs.joomla.org/J4.x:Joomla_Core_APIs, https://magazine.joomla.org/all-issues/august-2020/joomla-web-services-api-101-tokens,-testing-and-a-taste-test

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.