Albums
Overview
Section titled “Overview”The Albums resource provides fake photo album data with titles and user relationships.
Endpoints
Section titled “Endpoints”Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/albums | List all albums |
| GET | /v1/albums/:id | Get a specific album |
| GET | /v1/photos/album/:albumId | Get album's photos |
Album Object
Section titled “Album Object”{ "id": 1, "userId": 1, "title": "Vacation Photos", "createdAt": "2026-01-15T10:30:00.000Z", "updatedAt": "2026-01-15T10:30:00.000Z"}| Field | Type | Description |
|---|---|---|
id |
number |
Unique identifier |
userId |
number |
ID of the user |
title |
string |
Album title |
createdAt |
string |
ISO 8601 timestamp |
updatedAt |
string |
ISO 8601 timestamp |
List Albums
Section titled “List Albums”curl https://api.phantomjson.app/v1/albumsQuery 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 |
userId |
number |
— | Filter by user ID |
Response
Section titled “Response”{ "data": [ { "id": 1, "userId": 1, "title": "Vacation Photos" } ], "meta": { "total": 150, "page": 1, "limit": 20, "totalPages": 8 }}Get Album by ID
Section titled “Get Album by ID”curl https://api.phantomjson.app/v1/albums/1Response
Section titled “Response”{ "data": { "id": 1, "userId": 1, "title": "Vacation Photos" }}Get Album’s Photos
Section titled “Get Album’s Photos”curl https://api.phantomjson.app/v1/photos/album/1Response
Section titled “Response”{ "data": [ { "id": 1, "albumId": 1, "title": "Beach Sunset", "url": "https://picsum.photos/seed/abc123/800/600", "thumbnailUrl": "https://picsum.photos/seed/abc123/150/150" } ], "meta": { "total": 4, "page": 1, "limit": 20, "totalPages": 1 }}Examples
Section titled “Examples”Search Albums
Section titled “Search Albums”curl "https://api.phantomjson.app/v1/albums?q=vacation"Filter by User
Section titled “Filter by User”curl "https://api.phantomjson.app/v1/albums?userId=1"Sort by Title
Section titled “Sort by Title”curl "https://api.phantomjson.app/v1/albums?sort=title:asc"Field Selection
Section titled “Field Selection”curl "https://api.phantomjson.app/v1/albums?fields=id,title"Relations
Section titled “Relations”- User — Each album belongs to a user (
userId) - Photos — Each album has many photos (access via
/v1/photos/album/:albumId) - Access albums for a specific user via
/v1/users/:id/albums
