Returns a list of Tweets authored by the provided User ID
请求示例请求示例
Shell
JavaScript
Java
Swift
curl--location--request GET 'https://api.twitter.com/2/users//tweets'
响应示例响应示例
200 - 示例 1
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Path 参数
id
必需
The ID of the User to list Tweets of
Query 参数
since_id
可选
The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified.
示例值:
791775337160081409
until_id
可选
The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified.
示例值:
1346889436626259968
max_results
可选
The maximum number of results
exclude
可选
The set of entities to exclude (e.g. 'replies' or 'retweets')
pagination_token
可选
This parameter is used to get the next 'page' of results.
start_time
可选
YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified.
示例值:
2021-02-01T18:40:40.000Z
end_time
可选
YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified.
示例值:
2021-02-14T18:40:40.000Z
expansions
可选
A comma separated list of fields to expand.
tweet.fields
可选
A comma separated list of Tweet fields to display.
user.fields
可选
A comma separated list of User fields to display.
media.fields
可选
A comma separated list of Media fields to display.
place.fields
可选
A comma separated list of Place fields to display.
poll.fields
可选
A comma separated list of Poll fields to display.
返回响应
🟢200The request was successful
application/json
Body
data
array[object (Tweet) {20}]
可选
>= 1 items
attachments
object
可选
Specifies the type of attachments (if any) present in this Tweet.
author_id
string
可选
Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.
示例值:
2244994945
正则匹配:
^[0-9]{1,19}$
context_annotations
array[object (ContextAnnotation) {2}]
可选
>= 1 items
conversation_id
string
可选
Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.
示例值:
1346889436626259968
正则匹配:
^[0-9]{1,19}$
created_at
string<date-time>
可选
Creation time of the Tweet.
示例值:
2021-01-06T18:40:40.000Z
entities
object(FullTextEntities)
可选
geo
object
可选
The location tagged on the Tweet, if the user provided one.
id
string
必需
Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.
示例值:
1346889436626259968
正则匹配:
^[0-9]{1,19}$
in_reply_to_user_id
string
可选
Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers.
示例值:
2244994945
正则匹配:
^[0-9]{1,19}$
lang
string
可选
Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag.
示例值:
en
non_public_metrics
object
可选
Nonpublic engagement metrics for the Tweet at the time of the request.
organic_metrics
object
可选
Organic nonpublic engagement metrics for the Tweet at the time of the request.
possibly_sensitive
boolean
可选
Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.
示例值:
false
promoted_metrics
object
可选
Promoted nonpublic engagement metrics for the Tweet at the time of the request.
public_metrics
object
可选
Engagement metrics for the Tweet at the time of the request.
referenced_tweets
array [object {2}]
可选
A list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent.
>= 1 items
reply_settings
enum<string>
可选
Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following.
枚举值:
everyonementionedUsersfollowingother
正则匹配:
^[A-Za-z]{1,12}$
source
string
可选
The name of the app the user Tweeted from.
text
string
必需
The content of the Tweet.
示例值:
Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i