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

# Get Research Document

> Read the full text of a judgment or piece of legislation, one page of text at a time.

> [!NOTE]
>
> **Preview.** This endpoint is available to organisations in the Wordsmith MCP pilot. Other organisations receive `403 mcp_not_enabled`. See the [preview overview](/preview).

Returns the text of a judgment, statute or rulemaking document found with [Search Research Sources](/api-reference/research/search). Take `source` and `document_id` from a search result.

Long documents come back in pages of text. Each call returns up to `max_chars` characters, starting at `offset`. When `text_truncated` is `true`, more text follows: call again with `offset` set to `next_offset`.

The call is synchronous and fetches from the source on demand, so it can take a few seconds. Each call fetches the whole document again.

What `text` holds depends on the source:

* `uk_case_law`: the judgment's paragraphs. `uk_legislation`: the provisions' text.
* `courtlistener`: the opinion's text. `moonlit`: the document as Markdown.
* `eur_lex`: the act's English text. `nz_legislation`: the version's text.
* `federal_register`: the document's plain text. `regulations_gov`: the document's details and summary only; the body is a posted file.
* `sec_edgar` cannot be read here. Open the search result's `url`.

## Authentication

Send an API key, or an OAuth access token with the `research:read` scope, as a bearer token in the `Authorization` header. A token without the scope gets `403` with `"error": "insufficient_scope"`.

## Path parameters

**source** `string` *required*

The source id from the search result, such as `uk_case_law`. See [Sources](/api-reference/research/search#sources).

## Query parameters

**document\_id** `string` *required*

The document id from the search result. URL-encode it: some ids contain `/`, which becomes `%2F`.

**offset** `integer` (default: 0)

The character to start from. 0 or greater.

**max\_chars** `integer` (default: 20000)

The most characters to return, from `1` to `100000`.

## Response

**source** `string`

The source id.

**document\_id** `string`

The document's id at the source.

**title** `string`

The case name or the instrument's title. For EUR-Lex, the title comes from a separate lookup; when that lookup fails or takes more than 5 seconds, the title is `EUR-Lex <CELEX>` and `date` is `null`, and the text is still returned.

**citation** `string | null`

The neutral or reporter citation, or CELEX number, when the source gives one.

**date** `string | null`

ISO 8601: a full date where the source gives one, else the year.

**url** `string | null`

The document's public page at the source.

**text** `string`

This page of the text.

**text\_truncated** `boolean`

`true` when more text follows this page.

**next\_offset** `integer | null`

Pass as `offset` to read on. `null` on the last page.

```bash cURL theme={null}
curl "https://api.wordsmith.ai/api/v1/research/documents/uk_case_law?document_id=ewhc%2Fqb%2F2013%2F111&max_chars=20000" \
  -H "Authorization: Bearer sk-ws-api1-your_api_key_here"
```

```json First page theme={null}
{
  "source": "uk_case_law",
  "document_id": "ewhc/qb/2013/111",
  "title": "Yam Seng Pte Ltd v International Trade Corporation Ltd",
  "citation": "[2013] EWHC 111 (QB)",
  "date": "2013-02-01",
  "url": "https://caselaw.nationalarchives.gov.uk/ewhc/qb/2013/111",
  "text": "Mr Justice Leggatt:\n\nIntroduction\n\n1. This case arises out of a distribution agreement…",
  "text_truncated": true,
  "next_offset": 20000
}
```

```json Last page theme={null}
{
  "source": "uk_case_law",
  "document_id": "ewhc/qb/2013/111",
  "title": "Yam Seng Pte Ltd v International Trade Corporation Ltd",
  "citation": "[2013] EWHC 111 (QB)",
  "date": "2013-02-01",
  "url": "https://caselaw.nationalarchives.gov.uk/ewhc/qb/2013/111",
  "text": "…for these reasons the claim for breach of contract succeeds.",
  "text_truncated": false,
  "next_offset": null
}
```

## Errors

See [Errors](/errors) for the error format.

| HTTP Status | Error Code | When |
| - | - | - |
| 400 | `invalid_request_body` | `source` is not a recognised source, `document_id` is missing, `offset` is negative, or `max_chars` is outside `1`–`100000`. |
| 400 | `bad_request` | The source is `sec_edgar`, whose documents cannot be read here. |
| 401 | `unauthorized` | The API key or token is missing or invalid. |
| 403 | `insufficient_scope` | The OAuth token does not have `research:read`. |
| 403 | `mcp_not_enabled` | Your organisation is not in the preview. |
| 404 | `resource_not_found` | The source has no document with this id, or the source is off for your organisation. |
| 429 | `upstream_rate_limited` | The source is rate limiting Wordsmith. Retry after a minute. |
| 502 | `research_source_unavailable` | The source refused Wordsmith's credentials on this environment. Retrying will not help. |
| 503 | `research_source_unavailable` | The source did not respond in time or returned an error. Retry after a short wait. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.