Bulk Data Exports
When you need offline analysis or want to take a large amount of content at once, use an export instead of calling read endpoints one item at a time. Exports are asynchronous: you create a job, Whale generates files in the background partitioned by UTC day or hour, and you download them when it finishes.
An export contains only the current version of each item. For history or metric snapshots use Read Content & History; to keep receiving new and changed data use Synchronize Data Changes.
Prerequisites
WHALE_BASE_URLandWHALE_API_KEYare configured as in Get & Use an API Key, and you have curl and jq.- Your application’s subscription has export enabled (
export_allowed). Without it, creating a job returns403 export_forbidden; ask your organization administrator to request it from Whale. - If your subscription is limited to specific platforms, pass
source_platformsexplicitly and stay within that scope.
Create an Export
export_response="$(curl -sS --fail-with-body -X POST "$WHALE_BASE_URL/v1/exports" \
-H "Authorization: Bearer $WHALE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"source_platforms": ["reddit"],
"published_from": "2026-10-01T00:00:00Z",
"published_to": "2026-10-08T00:00:00Z",
"format": "jsonl",
"partition_by": "hour"
}')"
printf '%s' "$export_response" | jq .
EXPORT_ID="$(printf '%s' "$export_response" | jq -er '.export_id')"| Field | Required | Description |
|---|---|---|
source_platforms | Conditional | Platforms to export; required when your subscription is platform-limited |
published_from / published_to | No | Publication-time filter, RFC 3339; from must precede to |
format | No | jsonl (default) or parquet |
compression | No | Determined by format: jsonl uses gzip, parquet uses zstd; may be omitted |
fields | No | jsonl only and may include platform_payload; parquet uses the fixed cross-platform schema without platform_payload |
partition_by | No | day (default) or hour; use hour for high-volume sources such as Reddit |
max_rows | No | Safety limit per partition, 1–100000, default 100000 |
max_bytes | No | Safety limit per partition, up to 1073741824 (1 GiB), default maximum |
A successful request returns 202:
{
"export_id": "exp_01K...",
"status": "queued",
"format": "jsonl",
"compression": "gzip",
"rows": 0,
"bytes": 0,
"file_count": 0,
"partitions": 7,
"created_at": "2026-10-14T08:00:00Z",
"expires_at": "2026-10-21T08:00:00Z"
}Partitions and Row Limits
A job with a time range uses UTC-day partitions by default. With partition_by=hour, it uses UTC-hour partitions. max_rows and max_bytes are safety boundaries for each partition. If data remains after a boundary is reached, the partition fails explicitly instead of reporting a silently truncated success.
Use hourly partitions for million-row-per-day sources such as Reddit. If one hour still exceeds a boundary, narrow the time range or split jobs by platform. Use Synchronize Data Changes for continuous delivery.
Check Progress
curl -sS --fail-with-body "$WHALE_BASE_URL/v1/exports/$EXPORT_ID" \
-H "Authorization: Bearer $WHALE_API_KEY" | jq '{status, rows, bytes, file_count, partitions, error}'status moves through queued and running, and ends as succeeded, failed, cancelled or expired. Poll starting at five-second intervals and back off. On failed, error explains why; failed partitions are retried automatically and resume from completed work.
Download Files
When the job is succeeded, list its files:
curl -sS --fail-with-body "$WHALE_BASE_URL/v1/exports/$EXPORT_ID/files" \
-H "Authorization: Bearer $WHALE_API_KEY" | jq .{
"files": [
{"sequence": 0, "format": "manifest", "rows": 18234, "bytes": 2048, "download_url": "/v1/exports/exp_01K.../files/0", "expires_at": "2026-10-21T08:00:00Z"},
{"sequence": 1000001, "format": "jsonl", "rows": 5000, "bytes": 3145728, "download_url": "/v1/exports/exp_01K.../files/1000001", "expires_at": "2026-10-21T08:00:00Z"}
]
}Download each file. download_url is a relative path: prefix it with WHALE_BASE_URL and send the same API key:
curl -sS --fail-with-body "$WHALE_BASE_URL/v1/exports/$EXPORT_ID/files" \
-H "Authorization: Bearer $WHALE_API_KEY" |
jq -r '.files[] | "\(.sequence) \(.format)"' |
while read -r sequence format; do
case "$format" in
jsonl) extension="jsonl.gz" ;;
parquet) extension="parquet" ;;
*) extension="json" ;;
esac
curl -sS --fail-with-body -o "export-$EXPORT_ID-$sequence.$extension" \
"$WHALE_BASE_URL/v1/exports/$EXPORT_ID/files/$sequence" \
-H "Authorization: Bearer $WHALE_API_KEY"
done- The file with
sequence0is the manifest (manifest.json): format, total rows, and each partition’s time range, row count and files. Shards provide asequenceand an authenticated relativedownload_url, not storage paths. - The rest are data shards. Their
sequenceis “partition number × 1000000 + shard number”, so the first shard of partition 1 is1000001. Download by the values returned infiles; do not compute them yourself. - Shard formats:
jsonlis GZIP-compressed JSON Lines with one item per line;parquetis ZSTD-compressed Parquet. - Files and the job expire 7 days after creation. After that they cannot be downloaded; create a new job.
Exported Fields
| Field | Description |
|---|---|
document_id / version_id | Whale content ID and current version ID, usable with Read Content & History |
external_content_id / canonical_url | Source content ID and canonical URL |
source_platform / content_type | Platform and content type (dataset_id is internal; ignore it) |
title / body / body_format | Title, full body and body format |
language / region / country_code | Language and region |
published_at | Source publication time |
content_hash / size_bytes / char_count | Body hash, byte size and character count |
author / subreddit / score / external_parent_id / external_thread_id | Author, community, score and reply relationships; select them explicitly in fields for jsonl, included by default in parquet |
platform_payload | Complete platform-specific fields; JSONL only, explicitly selected and field-authorized |
Every requested field must be within your subscription’s field grants, otherwise the request returns 403 export_forbidden.
Cancel a Job
curl -sS --fail-with-body -X POST "$WHALE_BASE_URL/v1/exports/$EXPORT_ID/cancel" \
-H "Authorization: Bearer $WHALE_API_KEY"The response is 202, with status reflecting the actual state. After cancelled, the job will not retry, publish new files, or return to running or succeeded. The worker stops at a checkpoint; the current small batch or an in-flight request may finish first. Failed jobs awaiting retries can also be cancelled.
Repeated cancellation does not restart work. A job that already succeeded or expired keeps that state and returns succeeded or expired. Cancellation does not delete source content; files published before cancellation remain downloadable until they expire.
Billing, Limits and Errors
Each export creation is metered as one request and charged at your organization’s pricing; failed creations are refunded. Export creation has a daily limit (see the rate limits on the application’s Access restrictions page in the Portal); once reached, creation returns 429 rate_limit_exceeded for the rest of the UTC day.
| HTTP | code | Meaning and action |
|---|---|---|
| 400 | invalid_export_request | Malformed request body |
| 400 | export_create_failed | Validation failed, such as a format/compression mismatch, published_from after published_to, partial fields for parquet, or the daily export limit; fix per message |
| 400 | invalid_export_file | sequence is not a non-negative integer |
| 401 | unauthorized | The API key is invalid |
| 402 | credit_insufficient | Your organization’s credit balance is insufficient |
| 403 | export_forbidden | Export is not enabled for your subscription, or platforms or fields exceed your grants |
| 404 | export_not_found / export_file_not_found | The job or file does not exist, belongs to another application, or has expired |
| 429 | rate_limit_exceeded | Rate limited; back off per Retry-After |
See the public API reference for every field.