'Accept' request header should be set. If you are accessing from a web browser, it will set the 'Accept' header paramter as 'text/html' and so you will get a html response. You can set the 'Accept' parameter value to 'application/xml' or 'application/json' to get respective output. You should use a RESTful web service client to check that out. Visit PHP RESTful Web Service tutorial for more information.
https://phppot.com/demo/rest-api-search-implementation-in-php/mobile/list?name=apple