Query Filtering & Relations

Playground API provides full JSONPlaceholder parity with query parameters for pagination, multi-field sorting, full-text search, and relational sub-resources.

Relational Sub-Resource Endpoints

Navigate nested relationships naturally using intuitive nested REST paths:

relations.js
1
// 1. Fetch all posts written by user ID 1
2
fetch('https://playground-api-xi.vercel.app/api/v1/users/1/posts')
3
4
// 2. Fetch all comments under post ID 1
5
fetch('https://playground-api-xi.vercel.app/api/v1/posts/1/comments')
6
7
// 3. Fetch all todos assigned to user ID 1
8
fetch('https://playground-api-xi.vercel.app/api/v1/users/1/todos')
9
10
// 4. Alternatively, use query parameter filtering
11
fetch('https://playground-api-xi.vercel.app/api/v1/posts?user_id=1')