curl --request GET \
--url https://api.example.com/api/fyp \
--header 'Authorization: <authorization>'{
"posts": [
{
"id": 123,
"username": "<string>",
"content": "<string>",
"created_at": "<string>",
"upvotes": 123,
"downvotes": 123
}
],
"trending_topics": [
{}
]
}Get personalized feed with posts from followed users and trending content
curl --request GET \
--url https://api.example.com/api/fyp \
--header 'Authorization: <authorization>'{
"posts": [
{
"id": 123,
"username": "<string>",
"content": "<string>",
"created_at": "<string>",
"upvotes": 123,
"downvotes": 123
}
],
"trending_topics": [
{}
]
}GET /api/fyp
200 OK
{
"posts": [
{
"id": 456,
"username": "alice",
"content": "Check out this cool feature! #tech #innovation",
"created_at": "2026-03-03 14:20:00",
"upvotes": 25,
"downvotes": 2
},
{
"id": 123,
"username": "bob",
"content": "Having a great day! #lifestyle",
"created_at": "2026-03-03 12:15:30",
"upvotes": 10,
"downvotes": 0
}
],
"trending_topics": ["#tech", "#lifestyle", "#innovation"]
}
200 OK (No followed users)
{
"message": "no users being followed , yet"
}
200 OK (No posts from followed users)
{
"message": "no recent posts from followed users"
}
401 Unauthorized
{
"error": "invalid token , please login again"
}
{
"error": "unauthorized"
}
curl -X GET https://api.example.com/api/fyp \
-H "Authorization: your-auth-token"
{
"posts": [
{
"id": 456,
"username": "alice",
"content": "Check out this cool feature! #tech #innovation",
"created_at": "2026-03-03 14:20:00",
"upvotes": 25,
"downvotes": 2
},
{
"id": 789,
"username": "charlie",
"content": "Just launched my new project!",
"created_at": "2026-03-03 10:45:12",
"upvotes": 50,
"downvotes": 5
}
],
"trending_topics": ["#tech", "#innovation", "#launch"]
}
#(\w+), and the top 3 most common hashtags are returned