메인 콘텐츠로 건너뛰기
이 가이드는 팔로워 및 팔로잉 리스트를 조회하고 팔로우를 관리하는 방법을 단계별로 설명합니다.
사전 준비 사항시작하기 전에 다음이 필요합니다:
  • 승인된 App이 포함된 개발자 계정
  • 조회를 위한 App의 Bearer 토큰
  • 팔로우 관리를 위한 사용자 액세스 토큰(User Access Token)

특정 사용자의 팔로워 가져오기

특정 사용자를 팔로우하는 사용자 목록을 조회합니다:
cURL
curl "https://api.x.com/2/users/2244994945/followers?\
user.fields=username,verified,public_metrics&\
max_results=100" \
  -H "Authorization: Bearer $BEARER_TOKEN"

응답

{
  "data": [
    {
      "id": "1234567890",
      "name": "Developer",
      "username": "dev_user",
      "verified": false,
      "public_metrics": {
        "followers_count": 500,
        "following_count": 200,
        "tweet_count": 1500
      }
    }
  ],
  "meta": {
    "result_count": 1,
    "next_token": "abc123"
  }
}

사용자가 팔로우하는 사용자 조회

특정 사용자가 팔로우하는 사용자 목록을 조회합니다.
cURL
curl "https://api.x.com/2/users/2244994945/following?\
user.fields=username,verified&\
max_results=100" \
  -H "Authorization: Bearer $BEARER_TOKEN"

사용자 팔로우하기

인증된 사용자 계정을 대신해 다른 사용자를 팔로우합니다:
cURL
curl -X POST "https://api.x.com/2/users/123456789/following" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target_user_id": "2244994945"}'

응답

{
  "data": {
    "following": true,
    "pending_follow": false
  }
}
대상 계정이 보호된 계정인 경우 팔로우 요청이 승인될 때까지 pending_followtrue로 유지됩니다.

사용자 언팔로우

인증된 사용자 계정을 대신해 다른 사용자를 언팔로우합니다:
cURL
curl -X DELETE "https://api.x.com/2/users/123456789/following/2244994945" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"

응답

{
  "data": {
    "following": false
  }
}

공통 매개변수

매개변수설명
max_results페이지당 결과 수(1-1000, 기본값 100)
pagination_token다음 페이지를 가져오기 위한 토큰
user.fields추가 사용자 필드
expansions포함할 관련 객체

다음 단계

사용자 조회

사용자 프로필 조회

차단

사용자 차단 및 해제

음소거

사용자 음소거 및 해제

API 참조 문서

엔드포인트 전체 문서