# Html markup in JSON responses

**URL:** <http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23>\
**Category:** API Issues\
**Created:** [February 19, 2015, 11:07pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23 "2015-02-19T23:07:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lymber](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/l/b9e5f3/32.png) [@lymber](http://forum.companieshouse.gov.uk/u/lymber)\
**Post date:** [February 19, 2015, 11:07pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/1 "2015-02-19T23:07:12Z")

</div>

I did a search for company STL GROUP. And in the json results i get html markup (`<STRONG>`) in the name and title. There shouldn’t be any type of UI markup in any of the JSON responses. Example:

```
request: GET /search/companies?q=stl+group HTTP/1.1

part of the response:
"name": "<strong>STL</strong> <strong>GROUP</strong> PLC",
 "title": "01171409: <strong>STL</strong> <strong>GROUP</strong> PLC: active"
```

---

<div class="post-metadata">

**Author:** ![csmith](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/csmith/32/8_2.png) [@csmith](http://forum.companieshouse.gov.uk/u/csmith)\
**Post date:** [February 20, 2015, 4:02pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/2 "2015-02-20T16:02:33Z")

</div>

The search response is currently undergoing a redesign. It will be much simpler, and support multi-language descriptions, and avoid forcing html markup into text. We’re just finalising the details, and will post back with more soon!

---

<div class="post-metadata">

**Author:** ![pwalsh](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/pwalsh/32/1125_2.png) [@pwalsh](http://forum.companieshouse.gov.uk/u/pwalsh)\
**Post date:** [April 7, 2015, 12:52pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/3 "2015-04-07T12:52:31Z")

</div>

I just want to add my voice here: the HTML in responses is really annoying (I’m using the Beta API). Is there a roadmap for API development, or, some estimate of delivery for fixing this?

---

<div class="post-metadata">

**Author:** ![kashif\_saleem](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/k/d9b06d/32.png) [@kashif\_saleem](http://forum.companieshouse.gov.uk/u/kashif_saleem)\
**Post date:** [November 17, 2015, 11:20am UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/4 "2015-11-17T11:20:49Z")

</div>

Is there any update on this issue?  
How can we get json formatted output from companieshouse API?  
What will be the link for this?  
I am making it in Java ,  
And when I go with link “[https://api.companieshouse.gov.uk/search/companies/q=mySearchedCompany](https://api.companieshouse.gov.uk/search/companies/q=mySearchedCompany)”;

I get error and when I use link “[https://beta.companieshouse.gov.uk/search/companies/q=mySearchedCompany](https://beta.companieshouse.gov.uk/search/companies/q=mySearchedCompany)”,

i am getting result but as html page,.  
i want result in json format.

any help will be definitely appreciated.

---

<div class="post-metadata">

**Author:** ![mfairhurst](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@mfairhurst](http://forum.companieshouse.gov.uk/u/mfairhurst)\
**Post date:** [November 17, 2015, 2:06pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/5 "2015-11-17T14:06:02Z")

</div>

The search API has been modified to remove the HTML markup from the JSON response. In terms of how to use the API then this is explained in our documentation, link as follows: -

> **[Companies House API](https://developer.company-information.service.gov.uk/api/docs/)**

Specifically the endpoint you reference should be (NB its a ? rather then the / before the q=)

“[https://api.companieshouse.gov.uk/search/companies?q=mySearchedCompany](https://api.companieshouse.gov.uk/search/companies?q=mySearchedCompany)”

The beta… URL is our web site which returns data as HTML only.

If there are any further questions then please let us know.

Thanks,

Mark.

---

<div class="post-metadata">

**Author:** ![csmith](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/csmith/32/8_2.png) [@csmith](http://forum.companieshouse.gov.uk/u/csmith)\
**Post date:** [November 17, 2015, 3:25pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/6 "2015-11-17T15:25:01Z")

</div>

@kashif_saleem You’re probably making the same errors as @awais_techloyce123 ?

Have a read of the following post, which should help:

> [@HTML Response to a Beta Request](http://forum.aws.chdev.org/t/html-response-to-a-beta-request/331/8):
>
> @awais_techloyce123 Ah. Okay, there are several things wrong here: You are sending your API requests to the WEBSITE. Your authorisation header is wrong. First, do not be confused that the URLs look similar for the API and the website. The API will return data encoded as JSON. The Website will of course return HTML, plus, if you scrape the website, you’ll no doubt have your IP blocked by our access control infrastructure… Your problem stems from you not authenticating properly, hence the HTT…

Regards.

---

<div class="post-metadata">

**Author:** ![csmith](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/csmith/32/8_2.png) [@csmith](http://forum.companieshouse.gov.uk/u/csmith)\
**Post date:** [November 17, 2015, 3:27pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/7 "2015-11-17T15:27:32Z")

</div>

Just to update everyone, a little while back we removed all the HTML escaping (be it mark-up or mark-down) in the search results.

Apologies for forgetting to update this topic…

---

<div class="post-metadata">

**Author:** ![csmith](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/csmith/32/8_2.png) [@csmith](http://forum.companieshouse.gov.uk/u/csmith)\
**Post date:** [November 18, 2015, 1:11pm UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/8 "2015-11-18T13:11:53Z")

</div>

Split this topic on November 18, 2015, 1:11pm UTC

A post was merged into an existing topic: [HTML Response to a Beta Request](http://forum.companieshouse.gov.uk/t/html-response-to-a-beta-request/331)

---

<div class="post-metadata">

**Author:** ![mfairhurst](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@mfairhurst](http://forum.companieshouse.gov.uk/u/mfairhurst)\
**Post date:** [November 18, 2015, 9:03am UTC](http://forum.companieshouse.gov.uk/t/html-markup-in-json-responses/23/9 "2015-11-18T09:03:08Z")

</div>

Great news, thanks for letting us know
