Statoistics · Behind the Numbers

Four prompts.
One AI. Ten publishable data stories.

A UN dataset too big for any single journalist to read in full. An AI that read it, found the surprises, rendered them in brand format, and wrote the verification guides — while the human wrote four short sentences.

4 human prompts
0 lines of code written by AI
10 print-ready data cards
HUMAN PROMPT ✍️ 4 sentences The human's instruction — typically 10–50 words. The entire editorial direction. AI BUILDS ⬇️ Downloader 803 lines · SQLite AI wrote an 803-line Python script to download 15 UN dataflows, with SQLite-backed resume state and parallel async fetching. AI MINES 🔍 Insights 3 rounds · 20+ CSVs 1,126-line analysis pipeline run three times, iterating from 5 → 7 → 10 verified story leads. AI RENDERS 🎨 SVG Cards 480×480px · brand-exact Print-ready SVG cards matching the Statoistics brand spec to the pixel — fonts, colors, masthead, footer. PUBLISHED 📰 10 cards + 10 verify SOPs 10 data cards with journalist verification guides, ready for publication.
🎙️
Listen: The Plumbing Behind the Prose
A 3-minute audio walkthrough of how AI built this entire pipeline — from raw UN data to publication-ready cards. Same story you're about to read, in spoken form.
The Setup

A dataset too big to read. A deadline too short to wait.

The UN's SDG dataflow is one of the most comprehensive datasets ever assembled. It tracks 195 countries across indicators spanning remittances, refugee flows, biodiversity, parliamentary representation, water law, and a hundred things in between. UN SDG Global Dataflow: 15 streams, 195 countries, millions of data points per year.

It is also, in its raw form, almost completely unreadable by a human on a deadline. The data is encoded in SDMX: Statistical Data and Metadata eXchange. Dense XML format used by statistical agencies worldwide.SDMX format, spread across dozens of indicator codes, and arrives as compressed CSV slices you have to know how to ask for.

Someone at a news organisation would normally need a data journalist, an API expert, two weeks, and a research budget. Instead, here is what actually happened: one editor typed four short prompts into an AI coding assistant. What came back changed what a newsroom data workflow can look like.

"The human wrote roughly 200 words total. The AI wrote 1,929 lines of production code, ran the analysis three times, produced 10 publication-ready cards, and wrote the fact-checking guides."

This is not a demo. These are real cards, with real data, ready to print. What follows is the story of how they were made — and what it means for the newsrooms that haven't tried this yet.

The full scope, in numbers

0
UN dataflows cataloged
discovered & inventoried by AI
0
lines of code written
803 downloader + 1,126 analyzer
0
rounds of analysis
v1 → v2 → v3, each deeper
0
output CSVs generated
one per story angle explored
0
published data cards
with 10 journalist SOPs
Step 1 of 3 · Download

The ten-word brief that produced 803 lines of production code

Imagine you hand a talented new analyst a single sentence and walk away. You come back an hour later to find a fully documented API client sitting on your desk, handling rate limits, resume-from-failure, parallel downloads, and compressed storage. That is, essentially, what happened.

Human prompt · ~12 words
Download all data from https://data.un.org/ efficiently. It has an API. Learn how to use that. Write a Python script that downloads all data and saves it in an efficient structured format. Research the data available breadth-first, plan, then execute. Ensure that the script is resumable.
~55 words · total human writing investment: ~2 minutes
AI produced: 803-line download_un_data.py
# What the AI built, unprompted: 1. Read the UN's SDMX REST API documentation 2. Discovered 15 dataflows across 6 agencies 3. Built SQLite state database to track download progress 4. Implemented async parallel fetching (httpx + asyncio) 5. Gzip-compressed CSV output for storage efficiency 6. Exponential backoff retries (tenacity) 7. Rich console progress logging 8. --match flag to filter by dataflow name/ID 9. --force flag to re-download existing files 10. Year-range slicing (startPeriod / endPeriod) 11. README.md documenting every flag and example # Sample of key design decision (AI's own, unprompted): def connect_db(path: Path) -> sqlite3.Connection: """Open the state database and apply schema migrations.""" conn.execute("PRAGMA journal_mode=WAL") # safe for concurrent writes conn.execute("PRAGMA busy_timeout=30000") # Dataflows discovered automatically: IAEG-SDGs DF_SDG_GLH SDG Harmonized Global Dataflow ← primary source ESTAT DF_SEEA_AEA Air emission accounts WB DF_UNDATA_WDI World Development Indicators UNSD DF_UNDATA_ENERGY Energy Statistics ... 11 more

The AI didn't just execute the instruction — it made engineering choices. It chose WAL mode for the SQLite database, knowing that parallel download jobs might write simultaneously. It chose gzip compression for the CSV outputs. It built a proper --force flag. These are decisions an experienced data engineer would make — not things the human specified.

The result

15 dataflows cataloged. The SDG slice alone covers 195 countries.

The AI's downloader fetched the UN's full catalog, probed each dataflow for recent years, and produced a structured inventory. The SDG Harmonized Global Dataflow (version 1.24) turned out to be the richest source — 2025 and 2026 data available, covering everything the analysis needed.

Step 2 of 3 · Analyze

Not "process the data." Find the stories.

Raw data isn't news. A country's remittance cost as a percentage of $200 isn't a headline. The fact that sending money from Johannesburg to Mumbai costs 8.5 times more than sending it from London — that's a headline.

The instruction to the AI was deceptively simple. What it had to do was anything but.

Human prompt · round 1
Analyze this UN data for newsworthy insights. This is a dataset that people would have already analyzed extensively. So we need to find angles that are obscure, niche, and surprising. The more surprising, the better — but they also need to be true and verifiable from the data. Keep in mind that the analysis must ALSO be SIMPLE enough for a lay audience.
~60 words
↓ Round 1: 5 story leads
↓ Round 2: 7 story leads (after human feedback: "broaden for Indian readers")
↓ Round 3: 10 verified story leads + 20 output CSVs

The AI ran the analysis three times, each round deeper than the last. Between rounds, the human added two lines of direction — nudges, not rewrites. The AI went online between rounds to research what other journalists had already done with similar datasets, so it could find the angles that hadn't been covered yet.

AI
Round 1 · v1

5 story leads from raw data exploration

Remittance cost gap · Biodiversity Target 14 · Gender-balanced but old parliaments · Ukraine vs Afghanistan refugee rate · UN's 3% remittance benchmark nearly unmet

H
Human nudge

"Broaden with more universal appeal. Audience: Times of India readers."

~15 words. That's the entire editorial direction for round 2.

AI
Round 2 · v2

7 story leads — India angles added, web research incorporated

India remittance corridor spread (£3.82 vs $32.78) · India productivity rank (11th of 181) · Migration deaths concentration · Youth employment strategy gap · more

H
Human nudge

"Broaden further. Use follow-up ideas from notes.md."

~12 words. The AI had already been documenting its own research ideas in a notes file.

AI
Round 3 · v3

10 verified story leads + 1,126-line pipeline + 20+ output CSVs

Added: Seed SMTA crop diversity (India #2 globally) · Livestock backup gap · Water law vs actual participation · Biodiversity plan vs reality. Each lead supported by a reproducible CSV.

The editorial judgment at work

The AI made choices a data editor would recognize.

Take the Ukraine finding. The AI didn't just report that Ukraine has 11,970 refugees per 100,000 people. It framed it against Afghanistan — a country synonymous with refugee crisis in public perception — and showed that Ukraine now exceeds that rate. That reframing is an editorial choice, not a calculation. The AI made it.

Or take the seed story. Among 15 dataflows and hundreds of indicators, the AI surfaced a little-known indicator — Standard Material Transfer Agreements — and noticed that India receives more crop genetic material than any country except Germany. A human analyst would need to know to look for it. The AI found it by exploration.

Step 3 of 3 · Visualize

From insight to print-ready card — matching the brand spec to the pixel

A data insight is not a published card. Someone has to turn "India ranks 11th in worker productivity growth" into something a reader will stop and absorb. That means choosing the right chart type, placing text so it doesn't overflow, matching the masthead font exactly, and hitting a sub-second print deadline.

Human prompt
Render them as consistent SVGs in the format described by statoistics-format.md. Make sure the text, chart, etc. are easy to understand for a lay audience. Use your judgement on content, style, design elements, annotations. Save them as 2026-04-14-un-v3/*.svg
~40 words
↓ after one round of human feedback on card #1
AI produced: 10 SVG cards — spec-compliant, pixel-exact
# The Statoistics brand spec the AI had to match: Canvas: 480×480px, white #ffffff Masthead: #ed1c24 red, 29px tall Wordmark: STA[white] TOI[#231f20] STICS[white] Font: PoynterAgateOne-BoldCondensed 19px bold transform="translate(6 21) scale(1 1.11)" ← exact positioning Tagline: PoynterAgateOne-Condensed 15px white Headline: PoynterOSDisplay-Bold 28px #231f20 centered Deck: PoynterAgateOne-Condensed 15px #231f20 centered Border: stroke=#231f20 0.8px rect x=0.4 y=0.4 Footer sep: y=412; Note: y=428; Source: y=443 # Chart types chosen by AI (not specified by human): Card 01: Barbell/range chart ← shows corridor spread vividly Card 02: Slope chart ← shows rank surprise Card 03: Diverging bar ← before/after comparison Card 04: Peer comparison bars ← India in context Card 05: Scatter plot ← two-axis outlier story Card 06: Lollipop chart ← ranked gap data; dots beat bars here Card 07: Proportional strip ← part-of-whole; shows concentration Card 08: 4-tier pipeline ← progression from nothing → operational Card 09: Funnel ← progressive filter (rules → practice) Card 10: Waffle/unit chart ← 195 squares, one per country # Size of output: Total: ~1,270 lines of SVG XML Largest: card 10 biodiversity waffle = 265 lines

The human gave feedback once — on the very first card. The tagline was too small. The colour palette needed to be more print-friendly. Three sentences of feedback, and the AI updated the brand spec file and regenerated everything correctly. Cards 2 through 10 went out without another round of corrections.

Notice what wasn't specified: the chart types. The human never said "use a lollipop chart." The AI chose it for card 06 because a lollipop shows ranked data with large gaps between items more clearly than a bar chart — fewer ink-to-insight wasted pixels. It chose a waffle chart for card 10 because 195 small squares make the minority of 50 "achieved" countries feel like a minority in a way a percentage never can.

Seed crop diversity card

Card 06 · Lollipop — ranked seed-sharing data

Biodiversity plans card

Card 10 · Waffle — 195 unit squares by status

Migration deaths card

Card 07 · Proportional strip — part-of-whole

Water rules card

Card 09 · Funnel — rules vs. practice filter

The trust layer

The AI wrote the fact-checking guide for its own output

There is an obvious problem with AI-generated data journalism: how does a human editor verify it? The same AI that wrote the insight also wrote the SOP — the Standard Operating Procedure that tells a journalist exactly how to check every number before it goes to print.

Each of the 10 cards has a matching verification guide. They follow the same seven-section structure: how to download the source data, what the card is claiming, the fastest way to verify it, which exact CSV rows contain the numbers, a card-text-to-source-value table, and common verification mistakes to avoid.

Human prompt (paraphrased)
Add citations as corresponding .md files alongside the SVGs. Each should contain enough detail for a journalist to EASILY verify the facts. Think about HOW they would verify and what to check. Providing text to search for (via copy-paste) is helpful. Make this a comprehensive verification checklist and SOP.
Sample SOP structure (Card 06 · Seed Diversity)
## 1. If you do not have the data git clone --depth 1 https://github.com/sanand0/journalists.git cd journalists/data/un uv run download_un_data.py download --match DF_SDG_GLH --latest-only uv run v3/analyze_un_data.py ## 2. What this card is saying India received 12,095 SMTA agreements in 2025, ranking 2nd globally. 66.7% of Southern Asia's total. 56 of 151 treaty members have no domestic framework. ## 3. Fastest way to verify Open: data/un/v3/outputs/seed_smta_country_rank.csv Filter: rank_high_to_low == 2 Confirm: area_code=356 (India), smta_count=12095 ## 4. Exact rows to check Germany: rank 1, smta_count=16566 India: rank 2, smta_count=12095 ← this is the published number China: rank 10, smta_count=2334 ## 5. Card text → source check "#2 destination" → rank_high_to_low == 2 ✓ "12,095" → smta_count == 12095 ✓ "5× more than China" → 12095 / 2334 = 5.18× ✓ "66.7%" → india_share_of_southern_asia ✓ ## 6. Common mistakes Do NOT use SI_RMT_COST_SC — contains negative values, unreliable. Do NOT confuse SMTA sending (source) with receiving (destination). India is in REF_AREA=356 as recipient, not sender. ## Pre-publication checklist ☐ Confirmed smta_count=12095 in seed_smta_country_rank.csv ☐ Confirmed rank_high_to_low=2 ☐ Confirmed treaty_members=151, framework_members=95, gap=56 ☐ All numbers round as stated (no silent truncation)

This is the key trust mechanism. AI-generated journalism that cannot be verified by a human is a liability. AI-generated journalism that comes with a complete verification trail is an asset. The SOPs mean that a journalist who has never seen this dataset can reproduce every number in under ten minutes.

Try it: open any card in the gallery, click "Verify," and follow the checklist. The numbers hold.

The Full Loop

What the human did vs. what the AI did

H
Human · ~55 words

Prompt 1: "Download all data from data.un.org efficiently."

Plus: be resumable, log progress, use sub-directories. That's it.

AI
AI · 803 lines · ~40 min

Built production-grade async downloader with SQLite state tracking

Discovered SDMX API · 15 dataflows cataloged · Resume-safe · Parallel · Compressed output · Full README

H
Human · ~60 words

Prompt 2: "Find newsworthy insights — obscure, verifiable, simple for lay readers."

Plus two short follow-up nudges over three rounds. Total human writing: ~120 words.

AI
AI · 1,126 lines · 3 rounds

Ran analysis pipeline three times; surfaced 10 verified story leads

20+ output CSVs · Web research for unexplored angles · Editorial framing for each insight · notes.md of caveats and follow-ups

H
Human · ~40 words + 3 sentences of feedback

Prompt 3: "Render as SVGs following statoistics-format.md."

Gave feedback on card #1: tagline too small, use print colours. ~3 sentences total.

AI
AI · ~1,270 lines SVG · pixel-exact

10 brand-compliant SVG cards with appropriate chart types

Chose chart types independently · Lollipop, waffle, funnel, proportional strip — each matched to the story's data shape · Rendered PNG for visual QA · Fixed own errors

H
Human · ~30 words

Prompt 4: "Add verification SOPs for journalists."

Specified the checklist format. That's all.

AI
AI · 10 SOPs · ~4,000 words

Wrote 7-section fact-checking guide for every card

Exact CSV row filters · Copy-paste search strings · Pre-publication checklists · Common pitfall warnings · Reproducible data pipeline instructions

So What?

A newsroom function just got automated. Not replaced — automated.

There is a difference between a tool that helps a journalist work faster and a system that can run an entire pipeline from raw data to published card with minimal human input. This is the second thing.

The human in this workflow didn't know SDMX format. Didn't write SQL. Didn't design a chart. Didn't calculate a percentage. Didn't pixel-check a font size. What the human did was something harder to automate: decided what mattered. "Find the surprising angles. Write for lay readers. Make it verifiable." Those are editorial judgments, and they guided everything.

"The workflow scales. Point it at any structured dataset — MOSPI, RBI, NFHS — write four prompts, and the machine produces the same pipeline: download, analyze, visualize, verify."

We tested exactly this. The same process produced 7 cards from India's PLFS survey and 5 cards from PLFS v4 before the UN work began. The prompts were nearly identical. The outputs were equally publication-ready.

What changes when this becomes routine? Data stories that currently take a week of journalist-plus-designer time now take an afternoon — and the human spend that afternoon on the editorial judgment, not the plumbing. The machine handles the plumbing.

What this is not

It is not autonomous journalism. Every card in this gallery was published because a human editor decided it was ready. The verification SOPs exist precisely because the AI's output needs a human check before it goes to print. The editorial voice — the decision to compare Ukraine to Afghanistan, to focus on India's seed-diversity rank — came from a person with journalistic judgment.

What AI automates is the distance between "I have a dataset" and "I have something a journalist can read and verify." That distance used to take weeks. Now it takes hours.

Browse all 27 Statoistics cards in the gallery