Lesson 6 +15 XP

Structured Outputs (JSON, Markdown Tables, Lists)

Getting Clean Data for Software & APIs

When integrating AI outputs into applications, raw conversational prose is hard to parse. You need structured data like JSON or CSV.

Prompting for Clean JSON

To reliably receive valid JSON without conversational filler ("Here is your JSON:"):

Extract key entity information from the text below.
Return ONLY a valid JSON object. Do NOT include markdown codeblocks, commentary, or extra text.

Required JSON Schema:
{
  "name": string,
  "email": string,
  "age": number
}

Input Text: "John Doe is a 28 year old software engineer who can be reached at john@example.com."

Markdown Tables for Documentation

You can instruct LLMs to organize comparisons into Markdown tables:

Compare Python, JavaScript, and Rust in a Markdown table with columns: 
Language | Primary Use Case | Execution Speed | Learning Curve