Module: 4/5
Lesson: 6/7
Exercises:
Module 4 | Lesson 5

Lesson 5: Parsing Responses — Getting the Data You Need from What You Get

Common Response Patterns You'll Encounter

Pattern 1: Simple Flat Object

{
  "price": 42000,
  "currency": "USD",
  "timestamp": "2024-03-08T14:30:00Z"
}

This is straightforward. You reference price, currency, or timestamp directly. Easy mapping.

Pattern 2: Nested Object

{
  "user": {
    "id": 123,
    "profile": {
      "firstName": "Alice",
      "lastName": "Smith",
      "address": {
        "city": "London",
        "country": "UK"
      }
    }
  }
}

To get Alice's city, you use user.profile.address.city. It's a path through nested layers. Make and n8n have visual path pickers that make this easier — you click through the structure instead of typing it out manually.

Pattern 3: Array of Objects

[
  {"id": 1, "name": "Task A", "status": "complete"},
  {"id": 2, "name": "Task B", "status": "pending"},
  {"id": 3, "name": "Task C", "status": "pending"}
]

The API returns multiple items. If you want to process each one individually (send a Slack message per task, create a row per task, etc.), you need to iterate over the array. This is where the Iterator module (in Make) or Split in Batches module (in n8n) comes in. The iterator runs your downstream steps once for each item in the array, with access to that item's data.

Pattern 4: Paginated Responses

{
  "data": [
    {"id": 1, "name": "Item 1"},
    {"id": 2, "name": "Item 2"}
  ],
  "pagination": {
    "page": 1,
    "per_page": 2,
    "total_pages": 5,
    "next_page_url": "https://api.example.com/items?page=2"
  }
}

The API returns only a subset of results (page 1 of 5). The response includes information about how to get the next page. To get all results, you need to:

  1. Make the first request
  2. Check if there's a next page
  3. If yes, make another request to the next page URL
  4. Repeat until you've fetched all pages

Make and n8n both have modules for handling pagination, but you can also build it with conditional logic and loops.

🔒

This lesson is premium

Get full access to AI Workflows — all modules, all lessons, lifetime access.

Already purchased? Sign in to restore access.