Export a page#
Include id, source and source_url alongside the title and relevant dates. This command writes CSV to standard output.
curl --fail-with-body --silent --show-error --max-time 30 "https://china-snapshot.com/api/datasets?dataset=documents&format=csv&fields=id,title,original_title,source,source_url,published_at,collected_at&limit=5"import json
from urllib.request import Request, urlopen
request = Request('https://china-snapshot.com/api/datasets?dataset=documents&format=csv&fields=id,title,original_title,source,source_url,published_at,collected_at&limit=5')
with urlopen(request, timeout=30) as response:
print(response.read().decode('utf-8-sig'))const response = await fetch("https://china-snapshot.com/api/datasets?dataset=documents&format=csv&fields=id,title,original_title,source,source_url,published_at,collected_at&limit=5");
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.text());Export more than one page#
Read X-Dataset-Next-Cursor from the response headers and send it with the same filters. An empty header ends the walk. X-Dataset-Row-Count counts this page. A CSV response is never a full archive dump. Merge pages with a CSV parser so you keep one header row and handle the UTF-8 BOM and quoted cells correctly.
Citation checklist#
Retain the original source URL, publisher, returned record ID, original title where present, publication date and collection time. State the query and extraction date in your analysis. A missing source URL is a provenance gap; do not manufacture one. Exported string cells are formula-safe; preserve the original data types when importing.