01 / Explore
Fetch a dog photo and follow the request
Live API / scripted model
Pip is your guide. The API request is live; Pip’s agent steps are scripted. No AI model runs here.
The plan
A map of the journeyPip is ready. Let’s make the button work.
Your photo arrives here.
Choose a dog, then select Fetch a dog.
The record
Scripted teaching logEach stop leaves a card. Follow what was requested, returned and used.
- Fetch a dog to see the request and response here.
Ready when you are
- 01Ask
- 02Choose
- 03Call
- 04Inspect
- 05Explain
- 06Return
The live API did not respond. The lesson can still continue.
School network blocking the API? A sample illustrates the response without fetching a photo.
Your little collection
Just for this visit. Refreshing clears it.
02 / Look closer
What information came back from the API?
Getting a photo address is different from seeing the photo. Your browser can open the address and display it. A model given only that address has not seen the picture itself.A tool can return an image address as text. Your browser turns that address into a photo. A model receiving only the text has not seen the image pixels.
Run the lesson to inspect a response.
03 / Change the evidence
Take away the clue.
This written example contains a breed in its address. Hide the whole address, including the filename. What can you still reasonably conclude?
A local illustration. No model call or experiment runs here.
Illustrated tool response
{
"status": "success",
"message": "https://images.dog.ceo/breeds/beagle/example.jpg"
}The address contains “beagle”. That supports a statement about its label, not an image-recognition claim.
04 / Make it yours
Download and edit your own dog-photo page
One file. A button, a photo and the code that connects them. Save it, open it and change it.
Download the working HTMLRead the code
No installation, account or API key. The file opens locally. Fetching photos still needs internet access to Dog CEO.
- Save
pip-dog-fetch.htmlon your computer. - Open the saved file in your browser.
- Select Fetch a dog.
- Open the file in a text editor, change its heading, save and refresh.
Look closer: find fetch, where your page asks another service for data. Then find response.ok, which checks whether the HTTP request succeeded.
Just the request
An API is a way for one program to ask another for something. Each example below makes one request. JavaScript and Python print the photo address; curl prints the full JSON reply. No AI model, account or API key is needed.An API lets programs ask other programs for data. These examples make one request. JavaScript and Python print the image address; curl prints the JSON response. No model, account or API key is needed.
JavaScript Browser console or a modern Node.js .mjs file
const response = await fetch('https://dog.ceo/api/breeds/image/random');
if (!response.ok) throw new Error('Request failed');
const dog = await response.json();
if (dog.status !== 'success') throw new Error('No dog returned');
console.log(dog.message);Python Python 3, no extra packages
import json
from urllib.request import urlopen
with urlopen('https://dog.ceo/api/breeds/image/random', timeout=8) as response:
dog = json.load(response)
print(dog['message'])curl A terminal with curl; use curl.exe in Windows PowerShell
curl --fail --max-time 8 https://dog.ceo/api/breeds/image/random
Explore the Dog CEO API documentation. Make one request at a time; this lesson does not need a polling loop.
Connect the ideas
Tools for building and inspecting agent workflows
The browser lesson illustrates the pieces. In a real application, tools such as these can help you connect and inspect them.
- Dog CEO
- The live API that returns the image address. Meet the API
- LangChain
- Tools for building model-powered applications, including agents that use tools. Read the introduction
- LangGraph
- Infrastructure for orchestrating stateful agent workflows. The map illustrates a workflow; it is not running LangGraph. Explore graphs
- Langfuse
- Observability tools for recording and inspecting LLM application runs. Our board is a teaching illustration, not a Langfuse trace. Explore traces
Keep asking
It worked. What can we trust?
Pip brought back an address. That tells us where the photo came from. It does not prove that a model understood the picture.
Now imagine thousands of answers, with sources that change. How do we keep track of what still holds up? That is the problem behind Simone Consumption Engine, our product in development. This lesson does not run the engine.
Try the free AI courseBring the whole class
Teach the request-and-response cycle
How do we know what an AI answer is based on? Take the discussion further with a suggested lesson plan, printable student worksheet and answer key.
What happens when you use this lesson?
Starting a live run contacts dog.ceo and loads a photo from images.dog.ceo. Those services receive ordinary connection information such as your IP address. The teaching sample makes no API call. This lesson uses no model service, account, microphone or camera. The page is hosted by Cloudflare. The collection stays in page memory and clears on refresh. Responses to the learning questions stay in your browser.
File details on this page
Format, size and a short SHA-256 identifier, measured when this page was built.
- pip-dog-fetch.txtText, 10.6 KB, sha256 6e17aa1c2336