> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bigdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Response - Document

For **`POST /v1/search`**, the JSON body includes **`results`** (premium content) and, when [`query.external_search`](/api-reference/search/search-documents#body-query-external-search) is enabled, **`external_results.web`** with live web hits.

### Document main attributes

The documents returned has the following attributes:

* `id`: The unique identifier of the document, a 32-character
  hexadecimal string.
* `headline`: The title of the document.
* `url`: The URL of the original document.
* ~~`sentiment`~~ (Sunsetting. Instead use the chunk-level `sentiment` described below)
* `source`: The source of the document, an instance of
  `Source`, which contains the key and name of the source, and its Rank.
* `timestamp`: The timestamp of the document, a datetime object.
* `chunks`: The content of the document.
* `language`: The language of the document, an instance of `Language`. *Only available in the Python SDK.*

As for "chunks", each chunk object has the following attributes:

* `text`: The text of the chunk.
* `cnum`: The index of the chunk in the document, zero-based. You can
  use it to sort them in order. For the Python SDK, `chunk` is used instead.
* `entities`: A list of entities detected in the chunk, each entity is
  an instance of
  `DocumentSentenceEntity` and contains the entity key as well as the position
  in the text where it's detected. Note that these entity objects
  can't be used to create queries for searches. *Only available in the Python SDK.*
* `sentences`: A list of sentences detected in the chunk, each sentence
  is an instance of `DocumentSentence` and contains only the number of paragraph and
  sentence. *Only available in the Python SDK.*
* `relevance`: A float between 0 and 1. Relevance indicates the
  degree to which a particular match aligns with the various terms in
  your query. It's important to note that the relevance scores you
  receive are only meaningful within the context of the same search.
  Each execution generates unique scores, so comparing relevance across
  different queries is not meaningful.
* `sentiment`: A score between -1.0 and +1.0 that represents the
  chunk-level sentiment.

### `Document` dictionary

<Note>Only for the Python SDK.</Note>

We can print the document in dictionary format with the following code:

```python theme={null}
document = documents[0]
print(str(document.__dict__))
```

Output:

```python theme={null}
{
    'id': '0B4623C81D073FAE45DE6D6F23874878', 
    'headline': 'The new industry partnerships fuelling innovation',
    'document_scope': <DocumentScope.NEWS: 'news'>, 
    'source': DocumentSource(
      key='D6F0EE', 
      name='Drug Discovery World', 
      rank=3), 
    'timestamp': datetime.datetime(
        2025, 4, 8, 10, 10, 14,
        tzinfo=datetime.timezone.utc), 
    'chunks': [
        DocumentChunk(
            text="This agreement represents the sixth collaboration signed under 
            "the broader strategic partnership between Flagship Pioneering and  "
            "Pfizer to create a new pipeline of innovative assets, following  "
            "programmes announced with Flagship companies ProFound Therapeutics, "
            "Quotient Therapeutics, Montai Therapeutics, and Ampersand ."
            " Biomedicines \nIntegrated DNA Technologies and Elegen   \nDNA "
            "Technologies (IDT) and Elegen are teaming up to offer IDT customers"
            " early access to Elegen's ENFINIA Plasmid DNA, a long and "
            "high-complexity clonal gene synthesis service.", 
            chunk=13,  // The index of the chunk in the document, zero-based.
            entities=[
                DocumentSentenceEntity(
                  key='E3E549', 
                  start=36, end=49, 
                  query_type=<QueryType.ENTITY: 'entity'>), 
                DocumentSentenceEntity(
                  key='913660', 
                  start=439, end=448, 
                  query_type=<QueryType.ENTITY: 'entity'>), 
                ...
                DocumentSentenceEntity(
                  key='71QN2J', 
                  start=309, end=331, 
                  query_type=<QueryType.ENTITY: 'entity'>), 
                DocumentSentenceEntity(
                  key='business,partnerships,partnership,,', 
                  start=75, end=135, 
                  query_type=<QueryType.TOPIC: 'rp_topic'>), 
                ...
        ], 
         sentences=[
            DocumentSentence(paragraph=15, sentence=1), 
            DocumentSentence(paragraph=15, sentence=2)
            ], 
         relevance=0.5533394852057426, 
         sentiment=0.54,
         section_metadata=None, 
         speaker=None)
     ], 
    'language': 'English', 
    'cluster': None,
    'reporting_period': None, 
    'document_type': None, 
    'reporting_entities': None, 
    'url': 'https://www.ddw-online.com/the-new-industry-partnerships-fuelling-innovation-34442-202504/
}
```

### Download the entire document

Search results return document `id` values that can be used to retrieve the **full annotated document** as JSON (metadata, content, analytics). For those IDs, use the **[Fetch document](/api-reference/search/fetch-document)** API (`GET /v1/documents/{document_id}`) **only** in the case of Ravenpack content (news, premium content, web, etc.). It does **not** apply to **private** files you uploaded or ingested via the Content API; for those, use **[Get annotated document](/api-reference/documents/get-annotated-document)** or **[Get original document](/api-reference/documents/get-original-document)** (`/contents/v1/documents/{content_id}/...`).

1. **GET** `https://api.bigdata.com/v1/documents/{document_id}` with your API key in the `X-API-KEY` header.
2. The response includes a time-limited **pre-signed `url`** (valid for 24 hours).
3. **GET** that URL to download the complete document JSON.

You can also find **example scripts** in [bigdata-docs-resources](https://github.com/Bigdata-com/bigdata-docs-resources):

* [download\_entire\_document.py](https://github.com/Bigdata-com/bigdata-docs-resources/tree/main/how_to_guides/api_retrieve_entire_articles) — download one document by ID.
* [search\_and\_retrieve\_entire\_articles.py](https://github.com/Bigdata-com/bigdata-docs-resources/tree/main/how_to_guides/search_and_retrieve_entire_articles) — search with **POST /v1/search**, then fetch full documents with **GET /v1/documents/{document_id}**.
