# Inconsistent Data Types Returned

**URL:** <http://forum.companieshouse.gov.uk/t/inconsistent-data-types-returned/6990>\
**Category:** Uncategorized\
**Created:** [October 12, 2023, 9:21am UTC](http://forum.companieshouse.gov.uk/t/inconsistent-data-types-returned/6990 "2023-10-12T09:21:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alafunnell](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/a/59ef9b/32.png) [@alafunnell](http://forum.companieshouse.gov.uk/u/alafunnell)\
**Post date:** [October 12, 2023, 9:21am UTC](http://forum.companieshouse.gov.uk/t/inconsistent-data-types-returned/6990/1 "2023-10-12T09:21:26Z")

</div>

Hi,

When downloading financial records of companies I have an issue where the format the data is provided in is not consistent. Sometimes I make a GET request and receive XML in return other times I receive a PDF instead, this is strange as it is for the exact same company and same data? Is there a way to specify a preference of document type in the GET request?

Thank you  
Arthur

---

<div class="post-metadata">

**Author:** ![ebrian101](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/ebrian101/32/1145_2.png) [@ebrian101](http://forum.companieshouse.gov.uk/u/ebrian101)\
**Post date:** [October 12, 2023, 10:10am UTC](http://forum.companieshouse.gov.uk/t/inconsistent-data-types-returned/6990/2 "2023-10-12T10:10:49Z")

</div>

Yes, you can specify preference for file format using a HTTP header.  
See [Filings Document API | CH Guide](https://chguide.co.uk/rest-api/document-api/filing#how-to-use) for a complete example, but in essense you just need to add `Accept: application/xhtml+xml` to your request (if you wish to receive XML, otherwise use `application/pdf`). The available formats for the document are available in the `resources` field of the document metadata.

---

<div class="post-metadata">

**Author:** ![alafunnell](http://forum.companieshouse.gov.uk/letter_avatar_proxy/v4/letter/a/59ef9b/32.png) [@alafunnell](http://forum.companieshouse.gov.uk/u/alafunnell)\
**Post date:** [October 12, 2023, 10:57am UTC](http://forum.companieshouse.gov.uk/t/inconsistent-data-types-returned/6990/3 "2023-10-12T10:57:35Z")

</div>

Thank you! I haven’t seen that CH guide before but it looks very useful.

---

<div class="post-metadata">

**Author:** ![ebrian101](http://forum.companieshouse.gov.uk/user_avatar/forum.companieshouse.gov.uk/ebrian101/32/1145_2.png) [@ebrian101](http://forum.companieshouse.gov.uk/u/ebrian101)\
**Post date:** [October 12, 2023, 2:05pm UTC](http://forum.companieshouse.gov.uk/t/inconsistent-data-types-returned/6990/4 "2023-10-12T14:05:10Z")

</div>

Yes, I created it last year to try and add some clarity to some common pitfalls and questions I see asked on here. Bear in mind it is not official from companies house, it is unofficial created by me, a user of their data products.  
You are welcome to contribute any documentation you think others would find helpful. Thank you.
