https://serve.faux-api.com/tokenNo/cache_clearUnderstanding 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.
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" }
]
}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
| id | name | role | |
|---|---|---|---|
| 1 | John Doe | john@example.com | admin |
| 2 | Jane Smith | jane@example.com | editor |
| 3 | Alex Brown | alex@example.com | author |
| 4 | Maria Lopez | maria@example.com | author |
| 5 | David Lee | david@example.com | user |
API 2: categories
| id | users_id | name | status |
|---|---|---|---|
| 1 | 1 | Electronics | active |
| 2 | 2 | Fashion | active |
| 3 | 3 | Books | active |
| 4 | 4 | Home & Kitchen | inactive |
| 5 | 5 | Sports | active |
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)
| id | name | price | category_id |
|---|---|---|---|
| 101 | Wireless Mouse | 29.99 | 1 |
| 102 | Bluetooth Headphones | 59.99 | 1 |
| 103 | Running Shoes | 89.99 | 5 |
| 104 | Cooking Pan | 39.99 | 4 |
| 105 | Novel Book | 19.99 | 3 |
Relationship:
categories.id = products.category_id This means products belong to a category.
API 4: blogs
| id | title | author_name |
|---|---|---|
| 201 | Understanding APIs | Charles R. Caldwell |
| 202 | Modern JavaScript Tips | Carrie D. Lee |
| 203 | Best Gadgets 2025 | Henry M. Sharkey |
| 204 | Healthy Living Guide | Clifford L. Hindman |
| 205 | Sports Trends | Gloria M. McClure |
Relationship:
users.id = blogs.author_id This means each blog is written by a user.
API 5: blog_details
| id | blog_id | content | views |
|---|---|---|---|
| 301 | 201 | This article explains how APIs work. | 1200 |
| 302 | 202 | Advanced JS concepts explained simply. | 980 |
| 303 | 203 | Top tech gadgets to watch this year. | 1500 |
| 304 | 204 | Tips for a healthier lifestyle. | 760 |
| 305 | 205 | Latest 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.
For this example:
users is selected as the base API.Step 2: Add Relationships
Now connect all related APIs using common fields.
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.
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 = activeYou 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=valueExamples:
users_id=1products_status=inactiveMultiple filters:
users_id=1&products_status=inactivePagination & Limits
Default limit is 100
Default page no is 1
You can change them using parameters:
limit=100&page=1Nested Pagination
For nested APIs:
nestedapiname_limit=value
nestedapiname_pageno=value Example:
products_limit=10&products_page=2You 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=valueStep 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
Only one top-level field is allowed. Nest all others inside it.
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