메인 콘텐츠로 건너뛰기
이 가이드는 시간 역순 홈 타임라인 엔드포인트에 처음으로 요청을 보내는 과정을 단계별로 안내합니다.
사전 준비 사항시작하기 전에 다음이 필요합니다:
  • 승인이 완료된 App이 포함된 개발자 계정
  • 사용자 액세스 토큰(이 엔드포인트에는 사용자 인증이 필요합니다)

1단계: 사용자 ID 가져오기

조회하려는 홈 타임라인의 계정 사용자 ID가 필요합니다. 사용자 이름 조회 엔드포인트를 사용해 확인하세요:
cURL
curl "https://api.x.com/2/users/by/username/XDevelopers" \
  -H "Authorization: Bearer $BEARER_TOKEN"
응답에는 사용자 ID가 포함됩니다.
{
  "data": {
    "id": "2244994945",
    "name": "X Developers",
    "username": "XDevelopers"
  }
}

Step 2: Request the home timeline

사용자 ID와 User Access Token을 사용하여 GET 요청을 수행합니다:
cURL
curl "https://api.x.com/2/users/2244994945/timelines/reverse_chronological" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"

3단계: 응답 검토

{
  "data": [
    {
      "id": "1524796546306478083",
      "text": "Today marks the launch of Devs in the Details...",
      "edit_history_tweet_ids": ["1524796546306478083"]
    },
    {
      "id": "1524468552404668416",
      "text": "Join us tomorrow for a discussion about bots...",
      "edit_history_tweet_ids": ["1524468552404668416"]
    }
  ],
  "meta": {
    "result_count": 2,
    "newest_id": "1524796546306478083",
    "oldest_id": "1524468552404668416",
    "next_token": "7140dibdnow9c7btw421dyz6jism75z99gyxd8egarsc4"
  }
}

4단계: 필드와 expansions 추가

쿼리 매개변수를 사용해 추가 데이터를 요청합니다:
cURL
curl "https://api.x.com/2/users/2244994945/timelines/reverse_chronological?\
tweet.fields=created_at,public_metrics,author_id&\
expansions=author_id&\
user.fields=username,verified&\
max_results=10" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"

5단계: 결과 페이지네이션 처리

SDK는 페이지네이션을 자동으로 처리합니다. cURL을 사용할 때는 응답에 포함된 next_token 값을 사용해 더 많은 결과를 가져오세요:
curl "https://api.x.com/2/users/2244994945/timelines/reverse_chronological?\
max_results=10&\
pagination_token=7140dibdnow9c7btw421dyz6jism75z99gyxd8egarsc4" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"

공통 매개변수

파라미터설명기본값
max_results페이지당 결과 수 (1-100)10
start_time가장 오래된 게시물 타임스탬프 (ISO 8601)
end_time가장 최신 게시물 타임스탬프 (ISO 8601)
since_id이 ID 이후의 포스트 반환
until_id이 ID 이전의 포스트 반환
excluderetweets, replies 또는 둘 다를 제외

다음 단계

사용자 멘션

사용자를 언급한 포스트 가져오기

통합 가이드

핵심 개념과 모범 사례

API 참조 문서

전체 엔드포인트 문서

페이지네이션 가이드

대용량 결과 집합을 탐색하기