Follow a photo request with your class, find the breed label in the returned image address, and explain why reading that label differs from recognizing the image. Students can then edit and keep their own dog-photo webpage.
Suggested for high-school learners and curious beginners.
Quick classroom route
15-minute teacher kit: Dog API lesson
Why this one: it needs no account or key, the photo request is live, it has a worksheet and answer key, and there's a teaching sample if the school network blocks the service.
Before class (2 min, the day before): open simoneresearch.com/dog/ on a school device. It contacts dog.ceo and images.dog.ceo. If the filter blocks them, use the lab's labeled no-network teaching sample. Print the worksheet from /dog/teachers/.
You need: a browser, internet and a projector (or one device per pair).
Min
Do
Show
Ask
0-3
Predict. Pairs sketch three boxes: request, service, response.
Blank screen
"What has to happen between asking for a dog and seeing its picture?"
3-7
Observe. Run the lab once. Follow the moving marker.
The API address, the returned image URL, the breed label
"Which parts came from the service, and which did the demo write?"
7-11
Remove the clue. Hide the whole image address, filename included.
The worksheet's example URL: images.dog.ceo/breeds/beagle/example.jpg
"Can a text-only program still name the breed? What new evidence would it need?"
11-13
See the raw reply. Open the Dog API endpoint in the browser. One request per pair.
status and message in the JSON
"Is this the picture, or the picture's address?"
13-15
Explain. Each student writes the closing line.
The sentence frame
"The program knew ___ because ___. It could not establish ___ from that evidence."
What to listen for (answer key)
The API returns JSON. Success means status: "success", with an image URL in message. The browser loads the image as a separate request.
"beagle" in the path is a label. Reading it is not recognizing the picture.
With the address hidden, "not enough information" is the right answer.
If time is left: "Could a program fetch this picture without an AI model?" Yes. The guide's three short code examples (JavaScript, curl, Python) do exactly that.
Leave with a working webpage
Download the single HTML file. Students can save it on a computer, open it in a browser and fetch a photo. No installation or key is needed; new photos require internet access. On managed devices, check that local HTML files and Dog CEO are allowed.
Pair challenge: one person follows the request; the other explains how its response becomes a picture. Swap roles. Change the heading in a text editor, save, then refresh the browser. What should the page do if the service does not respond?
The page works with a browser and an API. Pip’s agent choices in the main lesson are scripted; no model runs.
Before the bell
Prepare the classroom activity
Bring
A modern browser, internet access and a projector or one device per pair. No coding experience is needed for the main activity. Code examples are an optional extension.
Open the lab on your school network first. It contacts dog.ceo for data and images.dog.ceo for photos. A network filter or unavailable service may prevent a live result.
Students will practice
Finding the request, response and image URL.
Explaining how a tool supplies information to a program.
Separating a label in data from a visual observation.
Choosing “not enough information” when support is missing.
The teaching distinction
The photo request is live. The agent’s model steps are a scripted illustration. This browser lab makes no model call and does not run LangChain, LangGraph or Langfuse. It illustrates their roles without requiring an installation or model budget.
If live access is unavailable, use the labeled no-network teaching sample in the lab, or the illustrative URL on the worksheet. The teaching sample illustrates a beagle response without fetching a photograph. Neither is a fresh API result. Students do not need to enter personal information.
The lesson route
Predict. Observe. Explain.
01 5 min
Predict the journey
Before running the lab, ask: “What has to happen between asking for a dog and seeing its picture?” In pairs, sketch three boxes: request, service, response.
02 8 min
Follow one request
Run the lab once. Follow the moving marker and read the cards. Locate the API address, returned image URL and breed label. Ask which parts came from the service and which parts were written by the demo.
03 10 min
Remove the clue
Use the lab’s evidence exercise, or the worksheet below. Hide the whole image address, including the filename. Ask whether a text-only program can still name the breed. Discuss what new evidence would be needed.
04 7 min
Make the call yourself
Open the Dog API endpoint directly in a browser. Identify status and message in the JSON. Coding groups can run one example below. One or two requests per pair is enough; do not run a loop.
05 5 min
Leave with an explanation
Each student finishes: “The program knew ___ because ___. It could not establish ___ from that evidence.” Compare answers using the answer key.
Adapt to 30–40 minutes by shortening the code extension or giving pairs more discussion time. With one device, invite students to narrate each step while you operate the lab.
Student field notes
Where did the answer come from?
Print this page with your browser’s Print command. The student worksheet starts on a new page; select its pages in print preview. The answer key is left out of print.
Name ________________________ Date ________________
Predict
What do you expect the API to send back: a picture, a picture’s address, or a written description? Explain your choice.
Observe
After one run, record the request address and one field from its response. What does that field tell you?
Find the clue
This is an illustrative URL, not a link to fetch:
https://images.dog.ceo/breeds/beagle/example.jpg
Circle the part that supplies a breed label. Does reading that label show that a program inspected the picture?
Remove the clue
Replace the whole image address with [address withheld]. A text-only program receives just that replacement, not the image. What can it now say about the breed? What additional evidence would help?
Explain a limit
“The program knew __________________ because __________________. It could not establish __________________ from that evidence.”
Extension: if the API fails, what should the page show instead of pretending the request succeeded?
Dog API lab. simoneresearch.com/dog/. Jonathan Simone, Simone Systems Research. Worksheet text CC BY 4.0
For the discussion
Answer key & useful follow-ups
Look for a reason connected to evidence, rather than one exact phrase.
1–2: What does the API return?
The endpoint returns JSON. A successful response has status: "success" and a message containing an image URL. The browser makes a separate request to load that image. JSON text and image bytes are different things.
3: Did the program recognize the dog?
The beagle path segment supplies a label. Reading that label is not visual recognition. A label is also not a guarantee that the pictured dog has been classified correctly. Ask students what an image review would add.
4: What happens when the label disappears?
The response without its image address does not establish a breed. “Not enough information” is an appropriate answer. Inspecting image content, or receiving a trustworthy description with its source, would add evidence. Hiding one clue does not itself test a model’s ability to recognize images.
5: What should a helpful failure look like?
Show that the live request failed. Offer a retry or an explicitly labeled teaching sample. Keep the difference visible. A trace can help locate the failed step; it does not make an unsupported answer correct.
A good stretch question
Could a program fetch this picture without an AI model? Yes. The code below does exactly that. Ask when a flexible language interface might be useful, and when an ordinary API call is all the task needs.
Optional coding extension
Call the API with JavaScript, curl or Python
Each example asks for one random image URL and prints data. None calls an AI model or requires an API key. Network errors are still possible.
JavaScript
Run in a browser developer console. Read the code first; follow your school’s device policy.
const response = await fetch('https://dog.ceo/api/breeds/image/random');
if (!response.ok) throw new Error('The request failed.');
const dog = await response.json();
if (dog.status !== 'success') throw new Error('No dog returned.');
console.log(dog.message);
curl
Run in a terminal with curl available. In Windows PowerShell, use curl.exe.
Save as dog.py and run with Python 3. Uses only the standard library.
import json
from urllib.request import urlopen
url = 'https://dog.ceo/api/breeds/image/random'
with urlopen(url, timeout=8) as response:
dog = json.load(response)
if dog.get('status') != 'success':
raise RuntimeError('No dog returned.')
print(dog['message'])
Next, identify the /breeds/ segment in the returned URL. Treat the following path segment as a label from the source, not the result of image analysis. See the Dog API documentation for other requests.
Words for what you just saw
Terms used in this lesson
API
An agreed way for one program to request data or an action from another. Here, the browser asks Dog API for an image address.
JSON
A text format for structured data. Named fields such as status and message make the response readable by a program.
Tool call
A request to run a function available to an agent. The function does the work, such as calling an API, then returns its result.
Trace
A record of steps and their inputs and outputs. It helps explain what happened; it does not certify that the answer is correct.
A framework and runtime for organizing stateful workflows, including steps controlled by code and steps involving models. The lab’s map illustrates this idea. Read the official introduction.
Langfuse
A tool for recording and inspecting AI application traces, including model requests and tool steps. The lab’s cards illustrate this kind of record; they are not live Langfuse traces. Read the official introduction.
File details on this page
Format, size and a short SHA-256 identifier, measured when this page was built.