Twitter API v2
  1. Tweets
Twitter API v2
  • General
    • Returns the open api spec document.
      GET
  • Tweets
    • Tweet lookup by Tweet IDs
      GET
    • Full archive search counts
      GET
    • Recent search counts
      GET
    • Sample stream
      GET
    • Full-archive search
      GET
    • Recent search
      GET
    • Filtered stream
      GET
    • Rules lookup
      GET
    • Add/Delete rules
      POST
    • Tweet lookup by Tweet ID
      GET
    • Hide replies
      PUT
    • Returns Tweet objects liked by the provided User ID
      GET
    • Causes the user (in the path) to like the specified tweet
      POST
    • Causes the user (in the path) to unlike the specified tweet
      DELETE
    • User mention timeline by User ID
      GET
    • Causes the user (in the path) to retweet the specified tweet
      POST
    • Causes the user (in the path) to unretweet the specified tweet
      DELETE
    • User Tweets timeline by User ID
      GET
  • Users
    • Returns user objects that have liked the provided Tweet ID
      GET
    • Returns user objects that have retweeted the provided Tweet ID
      GET
    • User lookup by IDs
      GET
    • User lookup by usernames
      GET
    • User lookup by username
      GET
    • User lookup by ID
      GET
    • Returns user objects that are blocked by provided user ID
      GET
    • Block User by User ID
      POST
    • Returns user objects that follow the provided user ID
      GET
    • Following by User ID
      GET
    • Follow User
      POST
    • Mute User by User ID
      POST
    • Unblock User by User ID
      DELETE
    • Unfollow User
      DELETE
    • Unmute User by User ID
      DELETE
  1. Tweets

Returns Tweet objects liked by the provided User ID

GET
/2/users/{id}/liked_tweets
Tweets
Returns a list of Tweets liked by the provided User ID
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.twitter.com/2/users//liked_tweets'
响应示例响应示例
200 - 示例 1

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Path 参数
id
必需
The ID of the User to list the liked Tweets of
Query 参数
max_results
可选
The maximum number of results
pagination_token
可选
This parameter is used to get the next 'page' of results.
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
withheld
object (TweetWithheld) 
可选
Indicates withholding details for withheld content.
errors
array[null (Problem) {16}] 
可选
>= 1 items
object 
GenericProblem
可选
A generic problem with no additional information beyond that provided by the HTTP status code.
object 
InvalidRequestProblem
可选
A problem that indicates this request is invalid.
object 
ClientForbiddenProblem
可选
A problem that indicates your client is forbidden from making this request.
object 
ResourceNotFoundProblem
可选
A problem that indicates that a given Tweet, User, etc. does not exist.
object 
ResourceUnavailableProblem
可选
A problem that indicates a particular Tweet, User, etc. is not available to you.
object 
ResourceUnauthorizedProblem
可选
A problem that indicates you are not allowed to see a particular Tweet, User, etc.
object 
FieldUnauthorizedProblem
可选
A problem that indicates that you are not allowed to see a particular field on a Tweet, User, etc.
object 
DisallowedResourceProblem
可选
A problem that indicates that the resource requested violates the precepts of this API.
object 
UnsupportedAuthenticationProblem
可选
A problem that indicates that the authentication used is not supported.
object 
UsageCapExceededProblem
可选
A problem that indicates that a usage cap has been exceeded.
object 
ConnectionExceptionProblem
可选
A problem that indicates something is wrong with the connection
object 
ClientDisconnectedProblem
可选
Your client has gone away.
object 
OperationalDisconnectProblem
可选
You have been disconnected for operational reasons.
object 
RulesCapProblem
可选
You have exceeded the maximum number of rules.
object 
InvalidRuleProblem
可选
The rule you have submitted is invalid.
object 
DuplicateRuleProblem
可选
The rule you have submitted is a duplicate.
includes
object (Expansions) 
可选
media
array[object (Media) {4}] 
可选
>= 1 items
places
array[object (Place) {8}] 
可选
>= 1 items
polls
array[object (Poll) {5}] 
可选
>= 1 items
tweets
array[object (Tweet) {20}] 
可选
>= 1 items
users
array[object (User) {14}] 
可选
>= 1 items
meta
object 
可选
next_token
string 
可选
The next token
正则匹配:
^[a-zA-Z0-9]+$
previous_token
string 
可选
The previous token
正则匹配:
^[a-zA-Z0-9]+$
result_count
integer <int32>
可选
Number of Tweets in result set
🔴500500
修改于 2021-08-02 10:27:04
上一页
Hide replies
下一页
Causes the user (in the path) to like the specified tweet
Built with