Twitter API v2
  1. Users
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. Users

Following by User ID

GET
/2/users/{id}/following
Users
Returns a list of users that are being followed by the provided user ID
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://api.twitter.com/2/users//following'
响应示例响应示例
200 - 示例 1

请求参数

Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
Path 参数
id
必需
The ID of the user for whom to return results
Query 参数
max_results
可选
The maximum number of results
pagination_token
可选
This value is populated by passing the 'next_token' or 'previous_token' returned in a request to paginate through results.

返回响应

🟢200The request was successful
application/json
Body
data
array[object (User) {14}] 
可选
created_at
string <date-time>
可选
Creation time of this user.
description
string 
可选
The text of this user's profile description (also known as bio), if the user provided one.
entities
object 
可选
A list of metadata found in the user's profile description.
id
#/components/schemas/UserID
必需
Could not resolve '#/components/schemas/UserID'
location
string 
可选
The location specified in the user's profile, if the user provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries.
name
string 
必需
The friendly name of this user, as shown on their profile.
pinned_tweet_id
#/components/schemas/TweetID
可选
Could not resolve '#/components/schemas/TweetID'
profile_image_url
string <uri>
可选
The URL to the profile image for this user.
protected
boolean 
可选
Indicates if this user has chosen to protect their Tweets (in other words, if this user's Tweets are private).
public_metrics
object 
可选
A list of metrics for this user
url
string 
可选
The URL specified in the user's profile.
username
#/components/schemas/UserName
必需
Could not resolve '#/components/schemas/UserName'
verified
boolean 
可选
Indicate if this user is a verified Twitter User.
withheld
#/components/schemas/UserWithheld
可选
Could not resolve '#/components/schemas/UserWithheld'
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 
可选
The number of user results returned in this response
🔴500500
修改于 2021-08-02 10:27:04
上一页
Returns user objects that follow the provided user ID
下一页
Follow User
Built with