Put it into practice
Your turn: explore a recipe API
Time to put your doc-reading skills to work. You're going to use the DummyJSON Recipes API, a free API with 50 recipes from around the world. No API key needed.
Here's what you have:
- Base URL:
https://dummyjson.com - Docs: dummyjson.com/docs/recipes
Open the docs in a new tab. You'll need them for every challenge below.
The tool below is yours. You choose the method, you type the URL, and you write the body. The base URL is already there. The rest is up to you.
Challenge 1: Find all the recipes
Your first task: get the list of all recipes. Look at the docs and find which endpoint returns all recipes. Type the path after the base URL and hit send.
How many recipes are there in total? (Look at the total field in the response.)
Challenge 2: Find the ramen recipe
There's a Japanese Ramen Soup in this API. Your job: find it using the search endpoint.
Check the docs for an endpoint that lets you search recipes by name. Then type the right path and query parameter below.
Once you've found it, answer these questions:
- How many calories per serving does it have?
- How long does it take to cook (not prep)?
- What cuisine is it listed under?
Challenge 3: Add your own pizza recipe
Time to create something. The docs have an endpoint for adding a new recipe. You need to:
- Find the right method (it's not GET this time)
- Find the right path
- Write a JSON body with your pizza recipe
You only need two fields: name and prepTimeMinutes. Quick reminder on JSON syntax: curly braces, keys in double quotes, colon between key and value, comma between fields. Like this:
{
"name": "My recipe name",
"prepTimeMinutes": 10
}
Select the right method from the dropdown, type the path, and write the body in the text area that appears.
If it worked, you should get back your recipe with an id of 51 (the API simulates the creation and assigns the next available ID).
Solutions
Done with the challenges? Here are the answers.
Challenge 1: Find all the recipes
Method: GET
URL: https://dummyjson.com/recipes
The response includes "total": 50. There are 50 recipes in the API. By default, you get the first 30 ("limit": 30).
Challenge 2: Find the ramen recipe
Method: GET
URL: https://dummyjson.com/recipes/search?q=ramen
The Japanese Ramen Soup is the result:
- Calories per serving: 480
- Cook time: 25 minutes (
cookTimeMinutes: 25) - Cuisine: Japanese
The search endpoint is /recipes/search and takes a q query parameter. You can find this in the docs under "Search recipes."
Challenge 3: Add your own pizza recipe
Method: POST
URL: https://dummyjson.com/recipes/add
Body (example):
{
"name": "Pepperoni Pizza",
"prepTimeMinutes": 15
}
The key things to get right:
- The method is POST (you're creating, not reading)
- The path is
/recipes/add(not just/recipes) - The body is valid JSON with at least a
namethat contains "pizza"
The API responds with your recipe plus "id": 51, confirming it was "created." (DummyJSON simulates the creation. It doesn't actually save it.)
What you just did
You opened docs you'd never seen before, found the right endpoints, figured out the parameters, chose the right methods, and built requests from scratch. Nobody gave you the URL. You read the docs and constructed it yourself.
This is the exact workflow you'll use at work when your team integrates a new API: open the docs, find the endpoint, build the request, check the response.
Key takeaways
- Reading docs is a hands-on skill. The only way to get comfortable is to practice with real APIs.
- Not every request is a GET. Creating data requires POST, and the docs tell you which method to use.
- The request body for POST needs to match what the docs expect. Field names, types, and structure all matter.
- When you're stuck, the answer is always in the docs. That's what they're for.