RFC 4180 CSVExcel (.xlsx)Dot-Notation Flattening

Mock CSV & Excel Spreadsheet Exports

Instantly stream or download any Playground API resource as standard RFC 4180 compliant CSV text or native Microsoft Excel (.xlsx) binary workbooks. Features automatic nested object flattening, relational filtering, and custom collection support.

One-Click Resource Downloads

Live Sandbox State
Posts
100 rows

Post IDs, user associations, title, and body content.

Users
25 rows (Flattened)

Flattened contact, street address, and company metadata.

Comments
300 rows

Feedback records with author email and post relationship.

Todos
125 rows

Task checklists, completion booleans, and user ownership.

3 Ways to Request Exports

1

URL Extension Route

Append .csv or .xlsx directly to any collection endpoint URL.

GET /api/v1/posts.csv
2

Query Parameter

Pass ?_format=csv or ?_format=xlsx alongside sorting and relational filters.

GET /api/v1/posts?_format=xlsx
3

HTTP Accept Header

Use standard HTTP content negotiation with the Accept header.

Accept: text/csv

Automatic Nested Object Flattening

Standard CSV and spreadsheet engines cannot natively represent hierarchical JSON trees. Playground API automatically unrolls nested sub-objects into clean, dot-notated column headers:

Raw Hierarchical JSON
json
1
{
2
"id": 1,
3
"name": "Leanne Graham",
4
"address": {
5
"street": "Kulas Light",
6
"city": "Gwenborough",
7
"zipcode": "92998-3874"
8
},
9
"company": {
10
"name": "Romaguera-Crona"
11
}
12
}
Flattened RFC 4180 CSV
csv
1
id,name,address.street,address.city,address.zipcode,company.name
2
1,"Leanne Graham","Kulas Light","Gwenborough","92998-3874","Romaguera-Crona"

Relational Sub-Resources & Custom Collections

All filtering, ordering, relational parameters, and dynamic custom collections fully support spreadsheet exports:

Nested User Posts Export

Export all posts written by User #1 as CSV

GET /api/v1/users/1/posts.csv
Custom Dynamic Collection Export

Export custom seeded products collection to Excel

GET /api/v1/custom/products.xlsx
Filtered & Sorted Export

Export incomplete todos sorted by title in descending order

GET /api/v1/todos.csv?completed=false&_sort=title&_order=desc

Integration Recipes

Python Pandas — Direct DataFrame Loading
python
1
import pandas as pd
2
3
# Load CSV directly into Pandas DataFrame
4
df_posts = pd.read_csv("/api/v1/posts.csv")
5
print(df_posts.head())
6
7
# Load Excel spreadsheet directly
8
df_users = pd.read_excel("/api/v1/users.xlsx")
9
print(df_users[['name', 'address.city', 'company.name']])
Browser JavaScript — Programmatic File Download Helper
typescript
1
async function downloadSpreadsheet(resource: string, format: 'csv' | 'xlsx' = 'csv') {
2
const response = await fetch(/api/v1/${resource}.${format});
3
const blob = await response.blob();
4
5
const url = window.URL.createObjectURL(blob);
6
const a = document.createElement('a');
7
a.href = url;
8
a.download = ${resource}-export.${format};
9
document.body.appendChild(a);
10
a.click();
11
window.URL.revokeObjectURL(url);
12
document.body.removeChild(a);
13
}
14
15
// Trigger instant download
16
downloadSpreadsheet('posts', 'xlsx');
cURL — Download via Terminal
bash
1
# Download CSV with output file
2
curl -O "/api/v1/users.csv"
3
4
# Download Excel workbook with content-negotiation header
5
curl -H "Accept: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \
6
-o "products-export.xlsx" \
7
"/api/v1/custom/products"