content: read source text by doc_id
Read paper or patent full text by doc_id, with character pagination.
Read full text by doc_id. Select the resource type for its usage instructions.
Overview
Read paper content by default: omit collection or pass papers. Obtain doc_id from agentic-search or meta-search, then read the full text or paginate by character offset. This endpoint does not perform full-text keyword search.
Use cases
- · Use the doc_id returned by agentic-search to fetch source text for secondary summarization.
- · Read long documents in segments to avoid exceeding context limits.
- · Use next_offset and more for multi-step streaming reads.
Not for
- · Do not use it to search by topic; first obtain a doc_id through agentic-search or meta-search.
- · Do not use it to download images or binary attachments; use resource.
- · Do not use it as a final-answer generation or fact-judgment endpoint.
Capability boundaries
- · content reads source text or context by doc_id with character offset/limit slicing.
- · offset and limit are Unicode character counts; long documents should be read in slices using next_offset.
- · Not every record has readable full text, so callers must handle 404 or empty content.
- · Returned text should be used as citation-verification source material, not as an unsourced conclusion.
Authentication
Use API key Bearer token authentication for all requests. Add this HTTP header:
Authorization: Bearer YOUR_API_TOKEN
Request example
curl
curl -G https://api.sciverse.space/content \
-H "Authorization: Bearer YOUR_API_TOKEN" \
--data-urlencode "doc_id=YOUR_DOC_ID" \
--data-urlencode "offset=0" \
--data-urlencode "limit=700"Python streaming read
import requests
base = "https://api.sciverse.space/content"
headers = {"Authorization": "Bearer YOUR_API_TOKEN"}
offset, parts = 0, []
while True:
r = requests.get(base, headers=headers,
params={"doc_id": "YOUR_DOC_ID", "offset": offset, "limit": 700}).json()
parts.append(r["text"])
if not r.get("more"):
break
offset = r["next_offset"]
print("".join(parts))Request parameters (URL query)
| Field | Type | Required | Description |
|---|---|---|---|
| collection | string | Optional | Omit or pass papers to read paper content. Default papersRange papers |
| doc_id | string | Required | Use the paper doc_id returned by agentic-search or meta-search. |
| offset | integer | Optional | Character offset (Unicode code points); returns full text when omitted. Range ≥ 0 |
| limit | integer | Optional | Maximum characters per request (Unicode code points), default 700; applies only when offset is set. Default 700Range 1–524288 |
Response structure
| Field | Type | Description |
|---|---|---|
| text | string | Text content (Markdown or plain text). |
| bytes_returned | integer | UTF-8 byte length of text, not character count. |
| text_length | integer | Total full-text length in Unicode code points. |
| next_offset | integer | Character offset for the next segment. |
| more | bool | Whether more content is available. |
Errors
| Code | Message | Description |
|---|---|---|
| 400 | INVALID_REQUEST | doc_id is missing or parameters are invalid. |
| 401 | UNAUTHORIZED | Authentication failed. |
| 404 | NOT_FOUND | Document not found. |
| 405 | METHOD_NOT_ALLOWED | Only GET is supported. |
| 429 | RATE_LIMITED | Account quota limit reached. |
| 502/503 | UPSTREAM_UNAVAILABLE | Service temporarily unavailable. |
See the Errors section for shared error codes.
Parameter bounds
| Limit | Value |
|---|---|
| offset | Character offset (Unicode code points); returns full text when omitted. |
| limit | Maximum characters per request (Unicode code points), default 700; applies only when offset is set. |
Retry guidance
- · Retry recommended: 502 / 503
- · Do not retry: 400 / 401 / 405
FAQ
Where does doc_id come from?
doc_id usually comes from an agentic-search hit or a meta-search result.
What units do offset and limit use?
They use Unicode characters, not bytes, which avoids cutting through multi-byte characters.
Can content read a full long paper in one request?
It may, but sliced reads with more/next_offset are recommended to reduce timeout and payload risk.
Can I show the returned text directly to users?
You can show snippets, but keep doc_id, offset ranges, and source metadata for verification.
Notes
- · Omit offset for the full text; limit is then ignored. Pass offset=0 for pagination and continue with next_offset. The response is JSON; text contains the body.
Need an API key?
Create one in Console > Tokens.The same API key works for enabled Sciverse, DianShi, and Skills capabilities, with starter quota available according to account permissions.