Base URLUse this to call your APIs
https://serve.faux-api.com/tokenNo/cache_clear

Understanding the API Builder: A Guide to Related Data

Welcome to the API Builder. This tool helps you connect related data and build powerful APIs without writing code.

Think of the API Builder as a Lego Set. You have different bricks (Categories, Products, Reviews), and this tool allows you to snap them together to build one complete structure.

You don’t need to understand databases — the builder handles the logic for you.

Custom Data Architecture (You Control the Hierarchy)

You have complete control over how your API response is structured.

  • Choose which API is the Parent

  • Choose which APIs are Nested inside it

This allows you to design a custom JSON response that fits your application exactly. The data is not fixed in one structure — you choose the hierarchy.

Quick Example: Same Data, Different APIs

Option A: Product-Centric API

Parent API: Products

Nested API: Categories

Use case: A product detail page that shows category information.

{
  "id": 101,
  "name": "Wireless Mouse",
  "category": {
    "name": "Electronics"
  }
}

Option B: Category-Centric API

Parent API: Categories

Nested API: Products

Use case: A category page that shows all products inside it.

{
  "id": 5,
  "name": "Electronics",
  "products": [
    { "id": 101, "name": "Wireless Mouse" },
    { "id": 102, "name": "Keyboard" }
  ]
}
You are not limited by the data — you design the response.

What Are Relationships and Why Do We Need Them?

In most applications, data is stored in separate APIs to stay organized. A Relationship is the connection between these APIs.

  • Without relationships → Multiple API calls

  • With relationships → One API call with connected data

This makes your application faster, cleaner, and easier to maintain.

How to Build Your API (Step by Step)

First, you need to create APIs.

For reference, we have created 5 APIs for this example:

  • users

  • categories

  • products

  • blogs

  • blog_details

Requirement Explanation

The requirement is to fetch all related data together using ID.

For example:

If you select id = 1 from the users API, then all data related to this user ID is returned in one single nested response, exactly in the structure you want.

This includes:

  • User data

  • Related categories

  • Products under those categories

  • Blogs written by the user

  • log details related to those blogs

Use Email or Any Other Key

In addition to ID, you can also fetch related data using email or any other common key, based on your requirement.

For example:

  • users.email = blogs.author_email

  • users.username = orders.username

As long as the selected key exists in both APIs and matches correctly, the system will build the relationships and return the same nested response structure.

This flexibility allows you to design APIs that match your real-world data models without changing the response format.

API 1: users

idnameemailrole
1John Doejohn@example.comadmin
2Jane Smithjane@example.comeditor
3Alex Brownalex@example.comauthor
4Maria Lopezmaria@example.comauthor
5David Leedavid@example.comuser

API 2: categories

idusers_idnamestatus
11Electronicsactive
22Fashionactive
33Booksactive
44Home & Kitcheninactive
55Sportsactive

Relationship:

users.id = categories.users_id

This means each category is linked to a user using the same id.

API 3: products (Connected to Categories)

idnamepricecategory_id
101Wireless Mouse29.991
102Bluetooth Headphones59.991
103Running Shoes89.995
104Cooking Pan39.994
105Novel Book19.993

Relationship:

categories.id = products.category_id

This means products belong to a category.

API 4: blogs

idtitleauthor_name
201Understanding APIsCharles R. Caldwell
202Modern JavaScript TipsCarrie D. Lee
203Best Gadgets 2025Henry M. Sharkey
204Healthy Living GuideClifford L. Hindman
205Sports TrendsGloria M. McClure

Relationship:

users.id = blogs.author_id

This means each blog is written by a user.

API 5: blog_details

idblog_idcontentviews
301201This article explains how APIs work.1200
302202Advanced JS concepts explained simply.980
303203Top tech gadgets to watch this year.1500
304204Tips for a healthier lifestyle.760
305205Latest sports updates and analysis.640

Relationship:

blogs.id = blog_details.blog_id

This means blog details belong to a specific blog.

Important Note on Keys

You are not limited to using id only.

You can use any common key based on your requirement, such as:

  • email

  • username

  • phone

  • custom reference fields

For example, instead of users.id, you can link data using users.email.

Step 1: Select Main API

Choose your Main API.

This API acts as the base table and the parent for all relationships.

Step 1: Select Main API

For this example:

users is selected as the base API.

Step 2: Add Relationships

Now connect all related APIs using common fields.

Step 2: Add Relationships

Example relationships used:

users.id = categories.users_id

categories.users_id = products.category_id

users.id = blogs.id

blogs.id = blog_details.blog_id

These relationships define how data is connected across APIs.

Step 3: Filters (Optional)

Filters control which records are returned.

Step 3: Filters and Pagination

If your base API is users, and you apply a filter where the user ID is 1 and the categories status is active, then only the active categories related to that user will be returned in the nested response.

users.id = 1

categories.status = active

You can also apply multiple filters based on your needs.

Example

  • Filter active categories only

  • Filter products by ID

  • Filter blogs by author

Passing Filters as Parameters

Filters can be passed using query parameters.

Filter naming rule:

apiname_filterkey=value

Examples:

users_id=1products_status=inactive

Multiple filters:

users_id=1&products_status=inactive

Pagination & Limits

  • Default limit is 100

  • Default page no is 1

You can change them using parameters:

limit=100&page=1

Nested Pagination

For nested APIs:

nestedapiname_limit=value

nestedapiname_pageno=value

Example:

products_limit=10&products_page=2

You can also apply a global nested limit, which is applied to all nested API data.

Example:

global_limit=10&global_page=2
{Base URL}?apiName1_key=value&apiName2_key=value

Step 4: Response Shape (Drag & Drop)

Here you design how the final JSON response looks.

Rules:

  • Main API is always the parent

  • Related APIs are nested inside it

  • Structure depends on drag & drop order

How APIs Connect❌ Wrong Structure
Users
Categories
Products
Blog
Blog_details

Only one top-level field is allowed. Nest all others inside it.

Step 4: Response Shape (Drag & Drop)

In this example:

Base API → users

Nested APIs → categories → products

Another nested chain → blogs → blog_details

Field Control on Hover

When you hover over any dropped API, you can:

  • See a list of available keys

  • Check or uncheck keys

  • Unchecked keys will not appear in the final response

Just remember:

  • Only one base API

  • Base API cannot be nested inside another API

Step 5: Live API URL

Once configured, the builder generates a live API URL that you can use directly in your application.

Final JSON Response

[
  {
    "id": 1,
    "name": "John Doe",
    "email": "john@example.com",
    "role": "admin",
    "categories": [
                    {
                        "id": 1,
                        "name": "Electronics",
                        "status": "active",
                        "products": [
                        {
                            "id": 2,
                            "name": "Bluetooth Headphones",
                            "price": "59.99",
                            "category_id": "1"
                        },
                        {
                            "id": 1,
                            "name": "Wireless Mouse",
                            "price": "29.99",
                            "category_id": "1"
                        }
                        ]
                    }
                ],
    "blogs": [
                {
                    "id": 1,
                    "title": "Understanding APIs",
                    "author_name": "Charles R. Caldwell",
                    "blogdetails": [
                    {
                        "id": 1,
                        "blog_id": "1",
                        "content": "This article explains how APIs work.",
                        "views": "1200"
                    }
                    ]
                }
    ]
  }
]

Logical View of the Same JSON

[
  {
    users: {
      categories: {
        products
      },
      blogs: {
        blog_details
      }
    }
  }
]

You can change the response structure anytime using drag & drop. Once relationships are configured, you do not need to call multiple APIs. The system automatically combines all related data and returns the final result in a single API response.

Use the GET API to verify how the data is fetched.

You can directly:

  • Use it in frontend apps

  • Connect it to mobile apps

  • Test it in API clients

No extra setup required.

Pro Tips for Performance

  • Purge Cache: Refresh data instantly after updates.

  • Enable Cache: Keep enabled for faster API responses.

Summary Checklist

  • Select Main API

  • Add Relationships

  • Set Filters (Optional)

  • Design Response Shape

  • Use the Live API URL