Skip to main content

하위 모듈

모듈 내용

이 모듈은 X API의 posts 엔드포인트에 대한 액세스를 제공합니다. 모든 posts-related 기능의 주요 진입점 역할을 합니다.

class xdk.posts.PostsClient

게시물 작업을 위한 클라이언트

매개변수

Client

__init__

매개변수

Client

create

Post 생성 또는 편집 인증된 사용자를 위해 새로운 Post를 생성하거나, edit_options가 제공된 경우 기존 Post를 편집합니다. body: 요청 본문 :returns: 응답 데이터 :rtype: CreateResponse

매개변수

CreateRequest

delete

Post 삭제 인증된 사용자가 소유한 경우, 특정 Post를 해당 ID로 삭제합니다.

매개변수

Any
The ID of the Post to be deleted.

반환값

DeleteResponse - 응답 데이터

get_analytics

Post 분석 조회 지정된 시간 범위 내에서 특정 Posts의 분석 데이터를 가져옵니다.

매개변수

List
쉼표로 구분된 Post ID 목록입니다. 단일 요청에서 최대 100개까지 허용됩니다.
str
YYYY-MM-DDTHH:mm:ssZ. The UTC timestamp representing the end of the time range.
str
YYYY-MM-DDTHH:mm:ssZ. The UTC timestamp representing the start of the time range.
str
The granularity for the search counts results.
List or None
default:"None"
표시할 Analytics 필드의 쉼표로 구분된 목록입니다.

반환값

GetAnalyticsResponse - 응답 데이터

get_by_id

ID로 Post 조회 특정 Post의 세부 정보를 해당 ID로 가져옵니다.

매개변수

Any
단일 Post ID입니다.
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Media 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Poll 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Place 필드의 쉼표로 구분된 목록입니다.

반환값

GetByIdResponse - 응답 데이터

get_by_ids

ID로 Post 목록 조회 Retrieves details of multiple Posts by their IDs.

매개변수

List
쉼표로 구분된 Post ID 목록입니다. 단일 요청에서 최대 100개까지 허용됩니다.
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Media 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Poll 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Place 필드의 쉼표로 구분된 목록입니다.

반환값

GetByIdsResponse - 응답 데이터

get_counts_all

모든 Post 수 조회 Retrieves the count of Posts matching a search query from the full archive.

매개변수

str
One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
Any or None
default:"None"
지정된 ID보다 크거나(즉, 더 최근인) Post ID를 갖는 결과를 반환합니다.
Any or None
default:"None"
지정된 ID보다 작거나(즉, 더 오래된) Post ID를 갖는 결과를 반환합니다.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
str or None
default:"None"
The granularity for the search counts results.
List or None
default:"None"
A comma separated list of SearchCount fields to display.

반환값

IteratorGetCountsAllResponse

get_counts_recent

최근 Post 수 조회 Retrieves the count of Posts from the last 7 days matching a search query.

매개변수

str
One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
Any or None
default:"None"
지정된 ID보다 크거나(즉, 더 최근인) Post ID를 갖는 결과를 반환합니다.
Any or None
default:"None"
지정된 ID보다 작거나(즉, 더 오래된) Post ID를 갖는 결과를 반환합니다.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
str or None
default:"None"
The granularity for the search counts results.
List or None
default:"None"
A comma separated list of SearchCount fields to display.

반환값

IteratorGetCountsRecentResponse

get_insights28hr

28시간 Post 인사이트 조회 Retrieves engagement metrics for specified Posts over the last 28 hours.

매개변수

List
List of PostIds for 28hr metrics.
str
granularity of metrics response.
List
request metrics for historical request.
List or None
default:"None"
A comma separated list of Engagement fields to display.

반환값

GetInsights28hrResponse - 응답 데이터

get_insights_historical

과거 Post 인사이트 조회 Retrieves historical engagement metrics for specified Posts within a defined time range.

매개변수

List
List of PostIds for historical metrics.
str
YYYY-MM-DDTHH:mm:ssZ. The UTC timestamp representing the end of the time range.
str
YYYY-MM-DDTHH:mm:ssZ. The UTC timestamp representing the start of the time range.
str
granularity of metrics response.
List
request metrics for historical request.
List or None
default:"None"
A comma separated list of Engagement fields to display.

반환값

GetInsightsHistoricalResponse - 응답 데이터

get_liking_users

좋아요를 누른 사용자 조회 Retrieves a list of Users who liked a specific Post by its ID.

매개변수

Any
단일 Post ID입니다.
int or None
default:"None"
결과의 최대 개수입니다.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.

반환값

IteratorGetLikingUsersResponse

get_quoted

인용된 Post 조회 Retrieves a list of Posts that quote a specific Post by its ID.

매개변수

Any
단일 Post ID입니다.
int or None
default:"None"
The maximum number of results to be returned.
Any or None
default:"None"
This parameter is used to get a specified ‘page’ of results.
List or None
default:"None"
The set of entities to exclude (e.g. ‘replies’ or ‘retweets’).
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Media 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Poll 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Place 필드의 쉼표로 구분된 목록입니다.

반환값

IteratorGetQuotedResponse

get_reposted_by

리포스트한 사용자 조회 Retrieves a list of Users who reposted a specific Post by its ID.

매개변수

Any
단일 Post ID입니다.
int or None
default:"None"
결과의 최대 개수입니다.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.

반환값

IteratorGetRepostedByResponse

get_reposts

리포스트 조회 Retrieves a list of Posts that repost a specific Post by its ID.

매개변수

Any
단일 Post ID입니다.
int or None
default:"None"
결과의 최대 개수입니다.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Media 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Poll 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Place 필드의 쉼표로 구분된 목록입니다.

반환값

IteratorGetRepostsResponse

hide_reply

Hide reply Hides or unhides a reply to a conversation owned by the authenticated user.

매개변수

Any
The ID of the reply that you want to hide or unhide.
HideReplyRequest
요청 본문

search_all

Search all Posts Retrieves Posts from the full archive matching a search query.

매개변수

str
One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
Any or None
default:"None"
지정된 ID보다 크거나(즉, 더 최근인) Post ID를 갖는 결과를 반환합니다.
Any or None
default:"None"
지정된 ID보다 작거나(즉, 더 오래된) Post ID를 갖는 결과를 반환합니다.
int or None
default:"None"
The maximum number of search results to be returned by a request.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
str or None
default:"None"
This order in which to return results.
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Media 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Poll 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Place 필드의 쉼표로 구분된 목록입니다.

반환값

IteratorSearchAllResponse

search_recent

Search recent Posts Retrieves Posts from the last 7 days matching a search query.

매개변수

str
One query/rule/filter for matching Posts. Refer to https://t.co/rulelength to identify the max query length.
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Posts will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute).
str or None
default:"None"
YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Posts will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute).
Any or None
default:"None"
지정된 ID보다 크거나(즉, 더 최근인) Post ID를 갖는 결과를 반환합니다.
Any or None
default:"None"
지정된 ID보다 작거나(즉, 더 오래된) Post ID를 갖는 결과를 반환합니다.
int or None
default:"None"
The maximum number of search results to be returned by a request.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified.
str or None
default:"None"
This order in which to return results.
List or None
default:"None"
표시할 Tweet 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
확장할 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Media 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Poll 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 User 필드의 쉼표로 구분된 목록입니다.
List or None
default:"None"
표시할 Place 필드의 쉼표로 구분된 목록입니다.

반환값

IteratorSearchRecentResponse