Document Text
document_textReturn the full TEXT of a Folketinget (Danish Parliament) document by its numeric Dokument id -- e.g. a minister's final answer to a committee question (udvalgsspørgsmål), a bill text, a consultation reply. Resolves the Dokument record, fetches its published file and extracts the text (PDF or Word; the declared file format is not trusted, the bytes are sniffed). Returns title, date, the question wording (spørgsmålsordlyd), who answered/asked, the extracted text, and a reason when no text could be read (file missing, scanned image, unsupported type) so an empty text is never ambiguous. Long texts are paged with offset/max_chars. Source: Folketinget, parliamentary document register.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Character offset into the extracted text, for paging a long document (default 0). | |
| max_chars | No | Max characters of text to return (default 100000, max 400000). | |
| document_id | Yes | Numeric Dokument id, e.g. 1237262 (the id used by get_entity_by_id with entity "Dokument"). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ||
| file | No | ||
| text | No | Extracted document text; null when reason is set | |
| found | No | False when no document has that id | |
| title | No | ||
| actors | No | ||
| offset | No | ||
| reason | No | Why no text was returned (document_not_found, no_file, file_fetch_failed, file_blocked, no_extractable_text, unsupported_file_type, ...) | |
| source | No | ||
| message | No | ||
| type_id | No | ||
| warnings | No | ||
| truncated | No | ||
| data_as_of | No | ||
| answered_by | No | ||
| document_id | No | ||
| next_offset | No | ||
| question_id | No | ||
| question_title | No | ||
| returned_chars | No | ||
| question_wording | No | Danish wording of the parliamentary question, when the document answers one | |
| text_chars_total | No |