Skip to main content

Endpoint

GET /api/users/{username}/followers

Authentication

This endpoint requires authentication.

Path Parameters

username
string
required
The username of the user whose followers you want to retrieve

Response

followersCount
number
The total number of followers
Followers
array
Array of follower user objects

Request Example

cURL
curl -X GET "https://api.example.com/api/users/johndoe/followers" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response Example

{
  "followersCount": 2,
  "Followers": [
    {
      "UserId": 123,
      "userName": "janedoe",
      "firstName": "Jane",
      "lastName": "Doe",
      "profileImage_MediaUrl": "https://example.com/images/janedoe.png"
    },
    {
      "UserId": 456,
      "userName": "bobsmith",
      "firstName": "Bob",
      "lastName": "Smith",
      "profileImage_MediaUrl": "https://defaults.com/default.png"
    }
  ]
}

Error Responses

404
error
Not Found - The specified user account does not exist

Implementation Details

This endpoint uses an optimized projection query to prevent N+1 query problems:
  • The query first retrieves the follower account IDs (follow.list.cs:9-14)
  • A second query fetches the full user details for those IDs (follow.list.cs:16)
  • AsNoTracking() is used for read-only queries to improve performance (follow.list.cs:14)
  • Username comparison is case-insensitive (follow.list.cs:9)

Build docs developers (and LLMs) love