Profiles
Overview
Section titled “Overview”The Profiles resource provides fake user profile data with usernames, display names, bios, avatars, and social metadata.
Endpoints
Section titled “Endpoints”| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/profiles | List all profiles |
| GET | /v1/profiles/:id | Get a specific profile |
| GET | /v1/profiles/:id/posts | Get profile's posts |
Profile Object
Section titled “Profile Object”{ "id": 1, "userId": 1, "username": "johndoe", "displayName": "John Doe", "bio": "Software developer and tech enthusiast.", "avatar": "https://example.com/images/avatar.jpg", "coverImage": "https://example.com/images/cover.jpg", "website": "https://example.com", "location": "San Francisco, CA", "verified": true}| Field | Type | Description |
|---|---|---|
id |
number |
Unique identifier |
userId |
number |
ID of the associated user |
username |
string |
Unique username |
displayName |
string |
User’s display name |
bio |
string |
User bio text |
avatar |
string |
Avatar image URL |
coverImage |
string |
Cover image URL |
website |
string |
Personal website URL |
location |
string |
User location |
verified |
boolean |
Whether the profile is verified |
List Profiles
Section titled “List Profiles”curl https://api.phantomjson.app/v1/profilesQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
page |
number |
1 |
Page number |
limit |
number |
20 |
Items per page (max: 100) |
sort |
string |
— | Sort field and direction |
q |
string |
— | Search query |
fields |
string |
— | Fields to return |
username |
string |
— | Filter by username |
verified |
boolean |
— | Filter by verified status |
Response
Section titled “Response”{ "data": [ { "id": 1, "userId": 1, "username": "johndoe", "displayName": "John Doe", "bio": "Software developer and tech enthusiast.", "avatar": "https://example.com/images/avatar.jpg", "verified": true } ], "meta": { "total": 50, "page": 1, "limit": 20, "totalPages": 3 }}Get Profile by ID
Section titled “Get Profile by ID”curl https://api.phantomjson.app/v1/profiles/1Response
Section titled “Response”{ "data": { "id": 1, "userId": 1, "username": "johndoe", "displayName": "John Doe", "bio": "Software developer and tech enthusiast.", "avatar": "https://example.com/images/avatar.jpg", "coverImage": "https://example.com/images/cover.jpg", "website": "https://example.com", "location": "San Francisco, CA", "verified": true }}Get Profile’s Posts
Section titled “Get Profile’s Posts”curl https://api.phantomjson.app/v1/profiles/1/postsResponse
Section titled “Response”{ "data": [ { "id": 1, "authorId": 1, "content": "Just shipped a new feature!", "visibility": "public", "status": "published" } ], "meta": { "total": 25, "page": 1, "limit": 20, "totalPages": 2 }}Examples
Section titled “Examples”Search Profiles
Section titled “Search Profiles”curl "https://api.phantomjson.app/v1/profiles?q=john"Filter by Username
Section titled “Filter by Username”curl "https://api.phantomjson.app/v1/profiles?username=johndoe"Filter Verified Profiles
Section titled “Filter Verified Profiles”curl "https://api.phantomjson.app/v1/profiles?verified=true"Sort by Username
Section titled “Sort by Username”# Alphabetical ordercurl "https://api.phantomjson.app/v1/profiles?sort=username:asc"
# Reverse alphabeticalcurl "https://api.phantomjson.app/v1/profiles?sort=username:desc"Field Selection
Section titled “Field Selection”curl "https://api.phantomjson.app/v1/profiles?fields=id,username,displayName,avatar"Combined Query
Section titled “Combined Query”# Verified profiles sorted by usernamecurl "https://api.phantomjson.app/v1/profiles?verified=true&sort=username:asc&fields=id,username,displayName"Relations
Section titled “Relations”- User — Each profile belongs to a user (
userId) - Posts — Each profile has many posts (access via
/v1/profiles/:id/posts)
