API Hop

문서

API Hop 문서

ID로 사용자 조회

사용자 ID로 Twitter 프로필을 조회하고 정규화된 X API v2 스타일의 사용자 객체를 반환합니다.

GEThttps://api.apihop.ai/v1/twitter/users/{id}

정규화된 사용자 ID가 이미 있다면 사용자 이름을 다시 확인하지 말고 이 리소스를 직접 조회하세요.

text
GET https://api.apihop.ai/v1/twitter/users/{id}

인증

모든 Twitter API 엔드포인트에는 Bearer 토큰 인증이 필요합니다.

http
Authorization: Bearer YOUR_API_KEY

경로 매개변수

idstring필수

44196397 등의 Twitter 사용자 ID입니다.

쿼리 매개변수

user.fieldsstring

쉼표로 구분된 사용자 필드입니다. 예: verified,public_metrics,profile_image_url.

요청 예제

bash
curl --request GET \
  "$API_BASE_URL/v1/twitter/users/44196397?user.fields=verified,public_metrics,profile_image_url" \
  --header "Authorization: Bearer YOUR_API_KEY"

응답

dataobject필수

정규화된 사용자 객체입니다.

data 필드
idstring필수

고유한 사용자 식별자입니다.

namestring필수

표시 이름입니다.

usernamestring필수

@를 제외한 사용자 이름입니다.

created_atstring

user.fields=created_at 요청 시 반환되는 ISO 8601 타임스탬프입니다.

descriptionstring

사용자 소개입니다.

entitiesobject

URL 설명 및 링크 등의 프로필 엔터티입니다.

locationstring

사용자 프로필의 위치입니다.

pinned_tweet_idstring

고정된 트윗의 ID입니다.

profile_banner_urlstring

프로필 배너 URL입니다.

profile_image_urlstring

프로필 이미지 URL입니다.

protectedboolean

계정 보호 여부입니다.

public_metricsobject

공개 사용자 지표입니다.

public_metrics 필드
followers_countinteger

팔로워 수입니다.

following_countinteger

팔로우 중인 계정 수입니다.

tweet_countinteger

전체 트윗 수입니다.

listed_countinteger

사용자가 포함된 목록 수입니다. 데이터 소스에서 제공하지 않으면 없을 수 있습니다.

urlstring

사용자 프로필의 웹사이트 URL입니다.

verifiedboolean

계정 인증 여부입니다.

verified_typestring

Business 등의 인증 유형입니다.

성공 예제

json
{
  "data": {
    "id": "44196397",
    "name": "Elon Musk",
    "username": "elonmusk",
    "profile_image_url": "https://img.example/profile.jpg",
    "public_metrics": {
      "followers_count": 10,
      "following_count": 20,
      "tweet_count": 40
    },
    "verified": true
  }
}

오류 응답

전체 코드 참조, 프로토콜 차이 및 진단 절차는 오류 코드 및 문제 해결을 참조하세요.

json
{
  "success": false,
  "error": {
    "code": 40000,
    "message": "Insufficient credit. Required: 100000, Available: 99999"
  },
  "requestId": "req_xxx"
}

사용 시점

  • 사용자의 id가 이미 있는 경우
  • 사용자 이름 변경의 영향을 피하려는 경우
  • User Info를 표준 /users/{id} 리소스로 취급하려는 경우