Get Internet Archive Item Text
ia_get_textRead-onlyIdempotent
Retrieve the readable text content of a text item (OCR DjVuTXT or plain-text file) from the Internet Archive, with length-aware truncation and a continuation pointer for pagination. Suited for public-domain books, documents, scanned periodicals, and transcripts. Use max_chars and char_offset to page through long documents. To confirm the item has a text file first, call ia_get_item with format "DjVuTXT"; its response also gives the mediatype.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_chars | No | Maximum number of characters to return in this response. Defaults to the server-configured maximum (IA_MAX_SNAPSHOT_CHARS, typically 50 000); a larger value is served at that maximum, with a notice. Lower values reduce token usage. | |
| identifier | Yes | Internet Archive item identifier, e.g. "prideprejudice00aust" (Pride and Prejudice). Obtain from ia_search_items results. | |
| char_offset | No | Character offset to start reading from (default 0). To read the next page, add max_chars to the previous char_offset. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | The text slice starting at char_offset up to max_chars characters. | |
| error | No | Present when the call failed. Absent on success. | |
| notice | No | Set when max_chars exceeded the server maximum (IA_MAX_SNAPSHOT_CHARS) and was served at it, naming the char_offset of the next page, or saying the page reaches the end of the document. | |
| has_more | No | True when there is more text beyond this slice. Increment char_offset by max_chars to read the next page. | |
| max_chars | No | Maximum characters this response could hold — the requested max_chars, or the server maximum when the request exceeded it. | |
| char_offset | No | Character offset used for this response. | |
| source_file | No | Filename of the source text file fetched from the item. | |
| source_file_bytes | No | Size of the source text file in bytes, from the item manifest — a byte count, not a character count (non-ASCII text takes several bytes per character). Omitted when the manifest lists no size. |