Twitter API v2
  1. Tweets
Twitter API v2
  • General
    • Returns the open api spec document.
      GET
  • Spaces
    • Space lookup up Space IDs
      GET
    • Space lookup by their creators
      GET
    • Search for Spaces
      GET
    • Space lookup by Space ID
      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
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.twitter.com/2/users//liked_tweets'
Response Response Example
200 - Example 1
{
  "data": [
    {
      "author_id": "2244994945",
      "created_at": "Wed Jan 06 18:40:40 +0000 2021",
      "id": "1346889436626259968",
      "text": "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"
    }
  ],
  "errors": [
    {
      "detail": "string",
      "title": "string",
      "status": 0,
      "type": "about:blank"
    }
  ],
  "includes": {
    "media": [
      {
        "height": 0,
        "media_key": "string",
        "width": 0,
        "alt_text": "string",
        "type": "photo",
        "url": "http://example.com"
      }
    ],
    "places": [
      {
        "contained_within": [
          "f7eb2fa2fea288b1"
        ],
        "country": "United States",
        "country_code": "US",
        "full_name": "Lakewood, CO",
        "geo": {
          "bbox": [
            -105.193475,
            39.60973,
            -105.053164,
            39.761974
          ],
          "geometry": {
            "coordinates": [
              -105.18816086351444,
              40.247749999999996
            ],
            "type": "Point"
          },
          "properties": {},
          "type": "Feature"
        },
        "id": "f7eb2fa2fea288b1",
        "name": "Lakewood",
        "place_type": "city"
      }
    ],
    "polls": [
      {
        "duration_minutes": 0,
        "end_datetime": "2019-08-24T14:15:22Z",
        "id": "1365059861688410112",
        "options": [
          {
            "label": "string",
            "position": 0,
            "votes": 0
          },
          {
            "label": "string",
            "position": 0,
            "votes": 0
          }
        ],
        "voting_status": "open"
      }
    ],
    "tweets": [
      {
        "author_id": "2244994945",
        "created_at": "Wed Jan 06 18:40:40 +0000 2021",
        "id": "1346889436626259968",
        "text": "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"
      }
    ],
    "users": [
      {
        "created_at": "2013-12-14T04:35:55Z",
        "id": "2244994945",
        "name": "Twitter Dev",
        "protected": false,
        "username": "TwitterDev"
      }
    ]
  },
  "meta": {
    "next_token": "string",
    "previous_token": "string",
    "result_count": 0
  }
}

Request

Path Params
id
string 
required
The ID of the User to list the liked Tweets of
Query Params
max_results
integer 
optional
The maximum number of results
pagination_token
string 
optional
This parameter is used to get the next 'page' of results.
expansions
array[string]
optional
A comma separated list of fields to expand.
tweet.fields
array[string]
optional
A comma separated list of Tweet fields to display.
user.fields
array[string]
optional
A comma separated list of User fields to display.
media.fields
array[string]
optional
A comma separated list of Media fields to display.
place.fields
array[string]
optional
A comma separated list of Place fields to display.
poll.fields
array[string]
optional
A comma separated list of Poll fields to display.

Responses

🟢200The request was successful
application/json
Body
data
array[object (Tweet) {20}] 
optional
>= 1 items
attachments
object 
optional
Specifies the type of attachments (if any) present in this Tweet.
author_id
string 
optional
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.
Example:
2244994945
Match pattern:
^[0-9]{1,19}$
context_annotations
array[object (ContextAnnotation) {2}] 
optional
>= 1 items
conversation_id
string 
optional
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.
Example:
1346889436626259968
Match pattern:
^[0-9]{1,19}$
created_at
string <date-time>
optional
Creation time of the Tweet.
Example:
2021-01-06T18:40:40.000Z
entities
object (FullTextEntities) 
optional
geo
object 
optional
The location tagged on the Tweet, if the user provided one.
id
string 
required
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.
Example:
1346889436626259968
Match pattern:
^[0-9]{1,19}$
in_reply_to_user_id
string 
optional
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.
Example:
2244994945
Match pattern:
^[0-9]{1,19}$
lang
string 
optional
Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag.
Example:
en
non_public_metrics
object 
optional
Nonpublic engagement metrics for the Tweet at the time of the request.
organic_metrics
object 
optional
Organic nonpublic engagement metrics for the Tweet at the time of the request.
possibly_sensitive
boolean 
optional
Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences.
Example:
false
promoted_metrics
object 
optional
Promoted nonpublic engagement metrics for the Tweet at the time of the request.
public_metrics
object 
optional
Engagement metrics for the Tweet at the time of the request.
referenced_tweets
array [object {2}] 
optional
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> 
optional
Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following.
Allowed values:
everyonementionedUsersfollowingother
Match pattern:
^[A-Za-z]{1,12}$
source
string 
optional
The name of the app the user Tweeted from.
text
string 
required
The content of the Tweet.
Example:
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) 
optional
Indicates withholding details for withheld content.
errors
array[null (Problem) {17}] 
optional
>= 1 items
object 
GenericProblem
optional
A generic problem with no additional information beyond that provided by the HTTP status code.
object 
InvalidRequestProblem
optional
A problem that indicates this request is invalid.
object 
ClientForbiddenProblem
optional
A problem that indicates your client is forbidden from making this request.
object 
ResourceNotFoundProblem
optional
A problem that indicates that a given Tweet, User, etc. does not exist.
object 
ResourceUnavailableProblem
optional
A problem that indicates a particular Tweet, User, etc. is not available to you.
object 
ResourceUnauthorizedProblem
optional
A problem that indicates you are not allowed to see a particular Tweet, User, etc.
object 
FieldUnauthorizedProblem
optional
A problem that indicates that you are not allowed to see a particular field on a Tweet, User, etc.
object 
DisallowedResourceProblem
optional
A problem that indicates that the resource requested violates the precepts of this API.
object 
UnsupportedAuthenticationProblem
optional
A problem that indicates that the authentication used is not supported.
object 
UsageCapExceededProblem
optional
A problem that indicates that a usage cap has been exceeded.
object 
ConnectionExceptionProblem
optional
A problem that indicates something is wrong with the connection
object 
ClientDisconnectedProblem
optional
Your client has gone away.
object 
OperationalDisconnectProblem
optional
You have been disconnected for operational reasons.
object 
RulesCapProblem
optional
You have exceeded the maximum number of rules.
object 
InvalidRuleProblem
optional
The rule you have submitted is invalid.
object 
DuplicateRuleProblem
optional
The rule you have submitted is a duplicate.
object 
ConflictProblem
optional
You cannot create a new job if one is already in progress.
includes
object (Expansions) 
optional
media
array[null (Media) {3}] 
optional
>= 1 items
places
array[object (Place) {8}] 
optional
>= 1 items
polls
array[object (Poll) {5}] 
optional
>= 1 items
tweets
array[object (Tweet) {20}] 
optional
>= 1 items
users
array[object (User) {14}] 
optional
>= 1 items
meta
object 
optional
next_token
string 
optional
The next token
Match pattern:
^[a-zA-Z0-9]+$
previous_token
string 
optional
The previous token
Match pattern:
^[a-zA-Z0-9]+$
result_count
integer <int32>
optional
Number of Tweets in result set
🔴500500
Modified at 2022-09-10 21:25:17
Previous
Hide replies
Next
Causes the user (in the path) to like the specified tweet
Built with