サブモジュール
- xdk.posts.client module
PostsClientPostsClient.__init__()PostsClient.create()PostsClient.delete()PostsClient.get_analytics()PostsClient.get_by_id()PostsClient.get_by_ids()PostsClient.get_counts_all()PostsClient.get_counts_recent()PostsClient.get_insights28hr()PostsClient.get_insights_historical()PostsClient.get_liking_users()PostsClient.get_quoted()PostsClient.get_reposted_by()PostsClient.get_reposts()PostsClient.hide_reply()PostsClient.search_all()PostsClient.search_recent()
- xdk.posts.models module
CreateRequestCreateResponseDeleteResponseGetAnalyticsResponseGetByIdResponseGetByIdsResponseGetCountsAllResponseGetCountsRecentResponseGetInsights28hrResponseGetInsightsHistoricalResponseGetLikingUsersResponseGetQuotedResponseGetRepostedByResponseGetRepostsResponseHideReplyRequestHideReplyResponseSearchAllResponseSearchRecentResponse
モジュールの内容
このモジュールは、X API の posts エンドポイントへのアクセスを提供します posts-related のすべての機能の主要なエントリポイントとして機能します。class xdk.posts.PostsClient
posts 操作向けのクライアント
パラメーター
Client
__init__
パラメーター
Client
create
Create or Edit Post
Creates a new Post for the authenticated user, or edits an existing Post when edit_options are provided.
body: Request body
:returns: レスポンスデータ
:rtype: CreateResponse
パラメーター
CreateRequest
delete
Delete Post
Deletes a specific Post by its ID, if owned by the authenticated user.
パラメーター
Any
The ID of the Post to be deleted.
戻り値
DeleteResponse - Response data
get_analytics
Get Post analytics
Retrieves analytics data for specified Posts within a defined time range.
パラメーター
List
A comma separated list of Post IDs. Up to 100 are allowed in a single request.
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"
A comma separated list of Analytics fields to display.
戻り値
GetAnalyticsResponse - Response data
get_by_id
Get Post by ID
Retrieves details of a specific Post by its ID.
パラメーター
Any
A single Post ID.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.
戻り値
GetByIdResponse - Response data
get_by_ids
Get Posts by IDs
Retrieves details of multiple Posts by their IDs.
パラメーター
List
A comma separated list of Post IDs. Up to 100 are allowed in a single request.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.
戻り値
GetByIdsResponse - Response data
get_counts_all
Get count of all Posts
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"
Returns results with a Post ID greater than (that is, more recent than) the specified ID.
Any or None
default:"None"
Returns results with a Post ID less than (that is, older than) the specified 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
Get count of recent Posts
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"
Returns results with a Post ID greater than (that is, more recent than) the specified ID.
Any or None
default:"None"
Returns results with a Post ID less than (that is, older than) the specified 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
Get 28-hour Post insights
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 - Response data
get_insights_historical
Get historical Post insights
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 - Response data
get_liking_users
Get Liking Users
次の一覧を取得します: Users who liked a specific Post by its ID.
パラメーター
Any
A single Post ID.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.
戻り値
IteratorGetLikingUsersResponse
get_quoted
Get Quoted Posts
次の一覧を取得します: Posts that quote a specific Post by its ID.
パラメーター
Any
A single 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"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.
戻り値
IteratorGetQuotedResponse
get_reposted_by
Get Reposted by
次の一覧を取得します: Users who reposted a specific Post by its ID.
パラメーター
Any
A single Post ID.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Tweet fields to display.
戻り値
IteratorGetRepostedByResponse
get_reposts
Get Reposts
次の一覧を取得します: Posts that repost a specific Post by its ID.
パラメーター
Any
A single Post ID.
int or None
default:"None"
The maximum number of results.
Any or None
default:"None"
This parameter is used to get the next ‘page’ of results.
List or None
default:"None"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.
戻り値
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
Request body
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"
Returns results with a Post ID greater than (that is, more recent than) the specified ID.
Any or None
default:"None"
Returns results with a Post ID less than (that is, older than) the specified 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"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.
戻り値
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"
Returns results with a Post ID greater than (that is, more recent than) the specified ID.
Any or None
default:"None"
Returns results with a Post ID less than (that is, older than) the specified 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"
A comma separated list of Tweet fields to display.
List or None
default:"None"
A comma separated list of fields to expand.
List or None
default:"None"
A comma separated list of Media fields to display.
List or None
default:"None"
A comma separated list of Poll fields to display.
List or None
default:"None"
A comma separated list of User fields to display.
List or None
default:"None"
A comma separated list of Place fields to display.
戻り値
IteratorSearchRecentResponse