top of page
Search

Mastering JSON Prompts for AI: A Step-by-Step Guide for Beginners

Artificial intelligence is powerful, but it needs clear instructions. One of the best ways to make your prompts more structured and reusable is by writing them in JSON (JavaScript Object Notation). JSON prompts are especially useful when you want consistent results or plan to automate AI interactions through apps and APIs.

At Digital Alchemist Online, an AI solutions company in Auckland, New Zealand, we teach creators and businesses how to master JSON prompts to get reliable results from AI tools in New Zealand and worldwide.


Step 1: Understand What a JSON Prompt Is

A JSON prompt is simply a structured way to tell AI what you want. Instead of writing one big messy sentence, you break your request into fields.

For example, instead of writing: “Write a friendly 100-word description of a reusable water bottle for teenagers.”

You can structure it like this:

{

"task": "Write a product description",

"product": "Reusable Water Bottle",

"tone": "friendly",

"length": "100 words",

"audience": "teenagers in New Zealand"

}

This makes it much clearer for the AI to follow.


Close-up view of a JSON code snippet on a digital screen
A close-up view of a JSON code snippet on a digital screen

Step 2: Choose Your Fields

Consider the details you want the AI to take into account. Common fields include:

  • Task – what you want (blog, email, code, poem, etc.)

  • topic/product – the subject

  • tone – friendly, professional, funny, formal

  • length – word count or size of output

  • audience – who it’s written for

  • structure – outline or list of sections

Example for an image:

{

"task": "Generate an image",

"subject": "Fantasy-themed book cover",

"details": {

"main_element": "Embossed dragon design",

"perspective": "High-angle view",

"materials": "Old leather, embossed metal detailing",

"style": "Ornate, medieval fantasy, richly textured",

"colours": ["gold", "brown", "black", "aged parchment"],

"setting": "Book resting on a rustic wooden table with autumn leaves scattered"

},

"mood": "Mystical, ancient, enchanted",

"output_format": "16:9 ratio, high resolution"

}

High angle view of a fantasy-themed book cover with a dragon
A high-angle view of a fantasy-themed book cover featuring a dragon

Step 3: Apply JSON to Coding Tasks

JSON prompts also work well for programming requests.

{

"task": "Write a Python function",

"description": "The function should take a list of numbers and return only the even numbers.",

"language": "python",

"output_format": "code only, no explanation"

}

This ensures the AI produces clean code with fewer mistakes.


Eye-level view of a creative workspace with notebooks and a laptop
An eye-level view of a creative workspace with notebooks and a laptop

Step 4: Test and Refine

AI doesn’t always get it right the first time. If the result isn’t what you want, update your JSON fields with more detail. For example, add:

  • "style": "bullet points"

  • "examples": "include local New Zealand references"

Iterating on prompts is part of the process.

Step 5: Validate Your JSON

A common beginner mistake is leaving out commas or quotation marks. Use a free online JSON validator to check your prompt before running it. This ensures the AI can read your request correctly.

Why This Matters

For businesses, educators, and creators in New Zealand, JSON prompts make AI:

  • More reliable – less guesswork, more accuracy.

  • Easier to automate – works well with APIs and workflows.

  • Reusable – the same prompt can be adapted for use across multiple projects.

At Digital Alchemist Online, we view JSON prompts as a crucial step toward mastering AI for real-world applications.

 
 
 

Comments


bottom of page