메인 콘텐츠로 건너뛰기
이 가이드는 /me 엔드포인트를 사용해 현재 인증된 사용자의 프로필을 조회하는 방법을 설명합니다.
사전 준비 사항시작하기 전에 다음이 필요합니다.
  • 승인이 완료된 App이 연결된 개발자 계정
  • 사용자 액세스 토큰 (OAuth 1.0a 또는 OAuth 2.0 PKCE)

인증된 사용자 가져오기

User Access Token을 사용해 /me 엔드포인트로 요청을 보냅니다:
cURL
curl "https://api.x.com/2/users/me?\
user.fields=created_at,description,verified,public_metrics,profile_image_url" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"

응답

{
  "data": {
    "id": "2244994945",
    "name": "X Developers",
    "username": "XDevelopers",
    "created_at": "2013-12-14T04:35:55.000Z",
    "description": "The voice of the X developer community",
    "verified": true,
    "profile_image_url": "https://pbs.twimg.com/profile_images/...",
    "public_metrics": {
      "followers_count": 583423,
      "following_count": 2048,
      "tweet_count": 14052,
      "listed_count": 1672
    }
  }
}

사용 사례

/me endpoint는 다음과 같은 경우에 필수적입니다:
  • 인증 확인 — 사용자가 올바르게 인증되었는지 확인
  • 사용자 ID 가져오기 — 다른 API 호출을 위해 인증된 사용자의 ID를 조회
  • 경험 개인화 — 앱에서 사용자의 프로필을 표시
  • 대리 요청 처리 — 어떤 사용자를 대신해 요청하는지 파악

고정된 게시물 포함하기

사용자의 고정된 게시물을 요청합니다:
cURL
curl "https://api.x.com/2/users/me?\
user.fields=pinned_tweet_id&\
expansions=pinned_tweet_id&\
tweet.fields=created_at,text" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"

확장이 포함된 응답

{
  "data": {
    "id": "2244994945",
    "name": "X Developers",
    "username": "XDevelopers",
    "pinned_tweet_id": "1234567890"
  },
  "includes": {
    "tweets": [
      {
        "id": "1234567890",
        "text": "Welcome to my profile!",
        "created_at": "2024-01-01T00:00:00.000Z"
      }
    ]
  }
}

사용 가능한 필드

필드설명
created_at계정 생성일
description사용자 소개(바이오)
profile_image_url프로필 이미지 URL
verified인증 상태
public_metrics팔로워/팔로잉 수
location사용자가 지정한 위치
url사용자의 웹사이트
protected보호된 계정 상태
pinned_tweet_id고정된 게시물 ID

인증 요구사항

/me 엔드포인트는 User Context 인증이 필요합니다. App-Only(Bearer 토큰) 인증은 지원되지 않습니다.
다음 중 하나를 사용하세요:

다음 단계

사용자 조회

다른 사용자 찾기

통합 가이드

핵심 개념과 모범 사례

API 참조 문서

엔드포인트 전체 문서