Data Access Path · 5/7
Recommended reading order, not completion status. Optional steps can be skipped.
View all steps
Before you start: Obtain an authorized document_id from a search.
Read Content & Versions
By the end of this page you can read a document’s full body from its document_id, along with every version it has had.
No document_id yet? Search or browse first.
Read several documents at once
Use this for list pages and batch jobs, up to 50 documents per call:
curl -sS "$WHALE_BASE_URL/v1/documents/batch-get" \
-H "Authorization: Bearer $WHALE_API_KEY" \
-H "Content-Type: application/json" \
--data '{"document_ids": ["doc_01J...", "doc_01K..."], "include_content": true}'Each document is returned separately; one failure doesn’t affect the others:
{
"document_id": "doc_01J...",
"document": {
"id": "doc_01J...",
"source_platform": "reddit",
"external_content_id": "t3_abc123",
"canonical_url": "https://www.reddit.com/...",
"content_type": "post",
"title": "...",
"published_at": "2026-09-01T08:00:00Z",
"current_version_id": "ver_01J..."
},
"content": {"body": "full body...", "body_format": "plain", "char_count": 712}
}A document that fails carries an error whose code is not_found or forbidden.
You can include more in the same call; nothing extra is returned by default:
| Parameter | Adds |
|---|---|
include_content | The full body of the current version |
include_latest_snapshot | The latest metrics; see metrics & snapshots |
include_affect, include_entities, include_intents | Sentiment, entities, intents; see sentiment, entities & intents |
include_parts, include_facts | Subtitles, OCR and facts; see transcripts, OCR & facts. parts_limit defaults to 20, facts_limit to 50 |
Every document field is described in the field reference. The ones you’ll use most:
id: the MarsYoo document ID, starting withdoc_.external_content_id: the original ID on the platform, such as a tweet ID or YouTube video ID.canonical_url: the link to the original.published_at: when it was published on the platform.
Read one document
curl -sS "$WHALE_BASE_URL/v1/documents/$DOCUMENT_ID" \
-H "Authorization: Bearer $WHALE_API_KEY"Returns the document object and information about the current version, without the body.
Read the full body
curl -sS "$WHALE_BASE_URL/v1/documents/$DOCUMENT_ID/content" \
-H "Authorization: Bearer $WHALE_API_KEY"{
"content": {
"document_id": "doc_01J...",
"version_id": "ver_01J...",
"body": "full body",
"body_format": "plain",
"char_count": 712
}
}bodyis always complete, never truncated.body_formatisplainormarkdown.- Add
?version_id=ver_...to read an earlier version’s body.
See the edit history
A new version is created when the title, body, link or subtitles change. Metric changes don’t create versions; they’re recorded as snapshots.
curl -sS "$WHALE_BASE_URL/v1/documents/$DOCUMENT_ID/versions?limit=100" \
-H "Authorization: Bearer $WHALE_API_KEY"{
"versions": [
{"version_id": "ver_01J...", "char_count": 712, "created_at": "2026-09-01T08:05:00Z"}
]
}- Newest first.
- Up to 500, with no pagination.
- To compare two versions, read both bodies and diff them yourself.
Read several versions at once
When following the change feed for new versions, use this, up to 100 per call:
POST /v1/versions/batch-get
{
"items": [{"document_id": "doc_01J...", "version_id": "ver_01J..."}],
"include_body": true
}Each item returns:
version: version information.body: the body. Requiresinclude_body: trueand body access.platform_payload: the raw platform data at ingest for this version. Requires matching access.
A failed item carries its own error (not_found or forbidden).
Read covers and image links
With metadata access, document.metadata.assets lists links to images, videos and other media. When there’s a cover, document.cover gives it directly:
"cover": {"media_type": "image", "url": "https://cdn.example.com/cover.jpg", "role": "cover"}role for each asset:
role | Meaning |
|---|---|
cover | The cover, at most one per document |
inline | An image inside the body |
gallery | One item in a gallery or carousel |
media | The video or audio itself |
- Older data without
roledoesn’t appear incover. Don’t treatpreview_urlor the first image as the cover. - These are public platform links. To download files MarsYoo stored, see download images & attachments.
Read raw platform data
document.metadata doesn’t include the platform’s raw data. When you need it, read platform_payload per version with read several versions at once.
When something fails
See Error codes.
Completion check: Read metadata, full content, and the facts you need without treating search snippets as complete bodies.
Not needed? Skip optional steps: Production Checklist