mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 23:50:26 +01:00
add api
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
d63b3df5e0
commit
b2fa9766a0
8 changed files with 309 additions and 47 deletions
|
|
@ -2,21 +2,95 @@ openapi: 3.0.3
|
||||||
info:
|
info:
|
||||||
title: Twitter OpenAPI
|
title: Twitter OpenAPI
|
||||||
description: |-
|
description: |-
|
||||||
Twitter OpenAPI
|
Twitter OpenAPI(Swagger) specification
|
||||||
termsOfService: https://github.com/fa0311
|
termsOfService: https://github.com/fa0311
|
||||||
contact:
|
contact:
|
||||||
email: yuki@yuki0311.com
|
email: yuki@yuki0311.com
|
||||||
license:
|
license:
|
||||||
name: other
|
name: GNU Affero General Public License v3.
|
||||||
url: https://github.com/fa0311/twitter-openapi/LICENSE
|
url: https://raw.githubusercontent.com/fa0311/twitter-openapi/main/LICENSE.txt
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
servers:
|
servers:
|
||||||
- url: https://twitter.com/i/api/graphql
|
- url: https://twitter.com/i/api/graphql
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
|
# timeline
|
||||||
/BntFPEOxs3GYdPaS6CjUcg/HomeTimeline:
|
/BntFPEOxs3GYdPaS6CjUcg/HomeTimeline:
|
||||||
$ref: ./src/paths/timeline/HomeTimeline.yaml
|
$ref: ./src/paths/timeline/HomeTimeline.yaml
|
||||||
|
/37RUvMgTiEVYYfrRTVDxpw/HomeLatestTimeline:
|
||||||
|
$ref: ./src/paths/timeline/HomeLatestTimeline.yaml
|
||||||
|
/VEwO8c1TYdm5zjxCOIiwFw/ListLatestTweetsTimeline:
|
||||||
|
$ref: ./src/paths/timeline/ListLatestTweetsTimeline.yaml
|
||||||
|
# follow
|
||||||
/FaBzCqZXuQCb4PhB0RHqHw/Following:
|
/FaBzCqZXuQCb4PhB0RHqHw/Following:
|
||||||
$ref: ./src/paths/follow/Following.yaml
|
$ref: ./src/paths/follow/Following.yaml
|
||||||
/VptSi88PiaQhBevFbGVlGg/Followers:
|
/VptSi88PiaQhBevFbGVlGg/Followers:
|
||||||
$ref: ./src/paths/follow/Followers.yaml
|
$ref: ./src/paths/follow/Followers.yaml
|
||||||
|
|
||||||
|
components:
|
||||||
|
securitySchemes:
|
||||||
|
BearerAuth:
|
||||||
|
type: http
|
||||||
|
scheme: bearer
|
||||||
|
description: "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
|
||||||
|
|
||||||
|
CsrfToken:
|
||||||
|
type: apiKey
|
||||||
|
in: header
|
||||||
|
name: x-csrf-token
|
||||||
|
|
||||||
|
ActiveUser:
|
||||||
|
type: apiKey
|
||||||
|
in: header
|
||||||
|
name: x-twitter-active-user
|
||||||
|
description: "yes"
|
||||||
|
|
||||||
|
AuthType:
|
||||||
|
type: apiKey
|
||||||
|
in: header
|
||||||
|
name: x-twitter-auth-type
|
||||||
|
description: "OAuth2Session"
|
||||||
|
|
||||||
|
ClientLanguage:
|
||||||
|
type: apiKey
|
||||||
|
in: header
|
||||||
|
name: x-twitter-client-language
|
||||||
|
description: "en"
|
||||||
|
|
||||||
|
CookieAuthToken:
|
||||||
|
type: apiKey
|
||||||
|
in: cookie
|
||||||
|
name: auth_token
|
||||||
|
|
||||||
|
CookieAuthCt0:
|
||||||
|
type: apiKey
|
||||||
|
in: cookie
|
||||||
|
name: ct0
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- name: timeline
|
||||||
|
description: timeline
|
||||||
|
- name: tweet
|
||||||
|
description: tweet
|
||||||
|
- name: user
|
||||||
|
description: user
|
||||||
|
- name: follow
|
||||||
|
description: follow
|
||||||
|
- name: search
|
||||||
|
description: search
|
||||||
|
- name: dm
|
||||||
|
description: dm
|
||||||
|
- name: settings
|
||||||
|
description: settings
|
||||||
|
- name: notify
|
||||||
|
description: notify
|
||||||
|
|
||||||
|
# ===
|
||||||
|
- name: login required
|
||||||
|
description: login session required
|
||||||
|
- name: graphql
|
||||||
|
description: graphql
|
||||||
|
- name: login-flow
|
||||||
|
description: login flow
|
||||||
|
- name: report-flow
|
||||||
|
description: report flow
|
||||||
|
|
|
||||||
66
openapi/src/components/schemas/Timeline.yaml
Normal file
66
openapi/src/components/schemas/Timeline.yaml
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
TimelineResponse:
|
||||||
|
required:
|
||||||
|
- "data"
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: "#/HomeTimelineData"
|
||||||
|
|
||||||
|
HomeTimelineData:
|
||||||
|
required:
|
||||||
|
- "home"
|
||||||
|
properties:
|
||||||
|
home:
|
||||||
|
$ref: "#/HomeTimelineHome"
|
||||||
|
|
||||||
|
HomeTimelineHome:
|
||||||
|
required:
|
||||||
|
- "home_timeline_urt"
|
||||||
|
properties:
|
||||||
|
home_timeline_urt:
|
||||||
|
$ref: "#/HomeTimelineUrt"
|
||||||
|
|
||||||
|
# ======
|
||||||
|
|
||||||
|
ListTweetsTimelineResponse:
|
||||||
|
required:
|
||||||
|
- "data"
|
||||||
|
properties:
|
||||||
|
data:
|
||||||
|
$ref: "#/ListTweetsTimelineData"
|
||||||
|
|
||||||
|
ListTweetsTimelineData:
|
||||||
|
required:
|
||||||
|
- "list"
|
||||||
|
properties:
|
||||||
|
home:
|
||||||
|
$ref: "#/ListTweetsTimelineList"
|
||||||
|
|
||||||
|
ListTweetsTimelineList:
|
||||||
|
required:
|
||||||
|
- "tweets_timeline"
|
||||||
|
properties:
|
||||||
|
tweets_timeline:
|
||||||
|
$ref: "#/ListTweetsTimeline"
|
||||||
|
|
||||||
|
ListTweetsTimeline:
|
||||||
|
required:
|
||||||
|
- "timeline"
|
||||||
|
properties:
|
||||||
|
timeline:
|
||||||
|
$ref: "#/HomeTimelineUrt"
|
||||||
|
|
||||||
|
# ======
|
||||||
|
|
||||||
|
HomeTimelineUrt:
|
||||||
|
required:
|
||||||
|
- "instructions"
|
||||||
|
- "metadata"
|
||||||
|
properties:
|
||||||
|
instructions:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "./Instruction.yaml#/InstructionUnion"
|
||||||
|
metadata:
|
||||||
|
type: object # todo
|
||||||
|
responseObjects:
|
||||||
|
type: object # todo
|
||||||
|
|
@ -75,10 +75,8 @@ UserLegacy:
|
||||||
- "has_custom_timelines"
|
- "has_custom_timelines"
|
||||||
- "is_translator"
|
- "is_translator"
|
||||||
- "listed_count"
|
- "listed_count"
|
||||||
- "location"
|
|
||||||
- "media_count"
|
- "media_count"
|
||||||
- "muting"
|
- "muting"
|
||||||
- "name"
|
|
||||||
- "normal_followers_count"
|
- "normal_followers_count"
|
||||||
- "notifications"
|
- "notifications"
|
||||||
- "pinned_tweet_ids_str"
|
- "pinned_tweet_ids_str"
|
||||||
|
|
@ -120,6 +118,7 @@ UserLegacy:
|
||||||
type: integer
|
type: integer
|
||||||
favourites_count:
|
favourites_count:
|
||||||
type: integer
|
type: integer
|
||||||
|
default: 0
|
||||||
follow_request_sent:
|
follow_request_sent:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
@ -128,11 +127,13 @@ UserLegacy:
|
||||||
default: false
|
default: false
|
||||||
followers_count:
|
followers_count:
|
||||||
type: integer
|
type: integer
|
||||||
|
default: 0
|
||||||
following:
|
following:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
friends_count:
|
friends_count:
|
||||||
type: integer
|
type: integer
|
||||||
|
default: 0
|
||||||
has_custom_timelines:
|
has_custom_timelines:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
@ -141,10 +142,12 @@ UserLegacy:
|
||||||
default: false
|
default: false
|
||||||
listed_count:
|
listed_count:
|
||||||
type: integer
|
type: integer
|
||||||
|
default: 0
|
||||||
location:
|
location:
|
||||||
type: string
|
type: string
|
||||||
media_count:
|
media_count:
|
||||||
type: integer
|
type: integer
|
||||||
|
default: 0
|
||||||
muting:
|
muting:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
@ -152,6 +155,7 @@ UserLegacy:
|
||||||
type: string
|
type: string
|
||||||
normal_followers_count:
|
normal_followers_count:
|
||||||
type: integer
|
type: integer
|
||||||
|
default: 0
|
||||||
notifications:
|
notifications:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
@ -179,6 +183,7 @@ UserLegacy:
|
||||||
type: string
|
type: string
|
||||||
statuses_count:
|
statuses_count:
|
||||||
type: integer
|
type: integer
|
||||||
|
default: 0
|
||||||
translator_type:
|
translator_type:
|
||||||
type: string
|
type: string
|
||||||
url:
|
url:
|
||||||
|
|
|
||||||
|
|
@ -24,3 +24,5 @@ get:
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Successful operation
|
description: Successful operation
|
||||||
|
tags:
|
||||||
|
- "follow"
|
||||||
|
|
|
||||||
|
|
@ -24,3 +24,6 @@ get:
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Successful operation
|
description: Successful operation
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- "follow"
|
||||||
|
|
|
||||||
59
openapi/src/paths/timeline/HomeLatestTimeline.yaml
Normal file
59
openapi/src/paths/timeline/HomeLatestTimeline.yaml
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
get:
|
||||||
|
operationId: getHomeLatestTimeline
|
||||||
|
description: get tweet list of timeline
|
||||||
|
parameters:
|
||||||
|
- name: variables
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: '''{
|
||||||
|
"count":20,
|
||||||
|
"includePromotedContent":true,
|
||||||
|
"latestControlAvailable":true,
|
||||||
|
"requestContext":"launch",
|
||||||
|
"withDownvotePerspective":false
|
||||||
|
}'''
|
||||||
|
- name: features
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: '''{
|
||||||
|
"blue_business_profile_image_shape_enabled":true,
|
||||||
|
"responsive_web_graphql_exclude_directive_enabled":true,
|
||||||
|
"verified_phone_label_enabled":false,
|
||||||
|
"responsive_web_graphql_timeline_navigation_enabled":true,
|
||||||
|
"responsive_web_graphql_skip_user_profile_image_extensions_enabled":false,
|
||||||
|
"tweetypie_unmention_optimization_enabled":true,
|
||||||
|
"vibe_api_enabled":true,
|
||||||
|
"responsive_web_edit_tweet_api_enabled":true,
|
||||||
|
"graphql_is_translatable_rweb_tweet_is_translatable_enabled":true,
|
||||||
|
"view_counts_everywhere_api_enabled":true,
|
||||||
|
"longform_notetweets_consumption_enabled":true,
|
||||||
|
"tweet_awards_web_tipping_enabled":false,
|
||||||
|
"freedom_of_speech_not_reach_fetch_enabled":false,
|
||||||
|
"standardized_nudges_misinfo":true,
|
||||||
|
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled":false,
|
||||||
|
"interactive_text_enabled":true,
|
||||||
|
"responsive_web_text_conversations_enabled":false,
|
||||||
|
"longform_notetweets_rich_text_read_enabled":true,
|
||||||
|
"responsive_web_enhance_cards_enabled":false
|
||||||
|
}'''
|
||||||
|
- name: queryId
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "37RUvMgTiEVYYfrRTVDxpw"
|
||||||
|
example: "'37RUvMgTiEVYYfrRTVDxpw'"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "./../../components/schemas/Timeline.yaml#/TimelineResponse"
|
||||||
|
tags:
|
||||||
|
- "timeline"
|
||||||
|
- "login-required"
|
||||||
|
|
@ -7,62 +7,56 @@ get:
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
example: '''{
|
||||||
|
"count": 20,
|
||||||
|
"includePromotedContent": true,
|
||||||
|
"latestControlAvailable": true,
|
||||||
|
"requestContext": "launch",
|
||||||
|
"withCommunity": true,
|
||||||
|
"withDownvotePerspective": false,
|
||||||
|
"withReactionsMetadata": false,
|
||||||
|
"withReactionsPerspective": false
|
||||||
|
}'''
|
||||||
- name: features
|
- name: features
|
||||||
in: query
|
in: query
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
example: '''{
|
||||||
|
"blue_business_profile_image_shape_enabled": true,
|
||||||
|
"responsive_web_graphql_exclude_directive_enabled": true,
|
||||||
|
"verified_phone_label_enabled": false,
|
||||||
|
"responsive_web_graphql_timeline_navigation_enabled": true,
|
||||||
|
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": false,
|
||||||
|
"tweetypie_unmention_optimization_enabled": true,
|
||||||
|
"vibe_api_enabled": true,
|
||||||
|
"responsive_web_edit_tweet_api_enabled": true,
|
||||||
|
"graphql_is_translatable_rweb_tweet_is_translatable_enabled": true,
|
||||||
|
"view_counts_everywhere_api_enabled": true,
|
||||||
|
"longform_notetweets_consumption_enabled": true,
|
||||||
|
"tweet_awards_web_tipping_enabled": false,
|
||||||
|
"freedom_of_speech_not_reach_fetch_enabled": false,
|
||||||
|
"standardized_nudges_misinfo": true,
|
||||||
|
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": false,
|
||||||
|
"interactive_text_enabled": true,
|
||||||
|
"responsive_web_text_conversations_enabled": false,
|
||||||
|
"longform_notetweets_richtext_consumption_enabled": true,
|
||||||
|
"responsive_web_enhance_cards_enabled": false
|
||||||
|
}'''
|
||||||
- name: queryId
|
- name: queryId
|
||||||
in: query
|
in: query
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
default: "BntFPEOxs3GYdPaS6CjUcg"
|
default: "BntFPEOxs3GYdPaS6CjUcg"
|
||||||
|
example: "'BntFPEOxs3GYdPaS6CjUcg'"
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: Successful operation
|
description: Successful operation
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/components/schemas/HomeTimelineResponse"
|
$ref: "./../../components/schemas/Timeline.yaml#/TimelineResponse"
|
||||||
|
tags:
|
||||||
components:
|
- "timeline"
|
||||||
schemas:
|
- "login-required"
|
||||||
HomeTimelineResponse:
|
|
||||||
required:
|
|
||||||
- "data"
|
|
||||||
properties:
|
|
||||||
data:
|
|
||||||
$ref: "#/components/schemas/HomeTimelineData"
|
|
||||||
|
|
||||||
HomeTimelineData:
|
|
||||||
required:
|
|
||||||
- "home"
|
|
||||||
properties:
|
|
||||||
home:
|
|
||||||
$ref: "#/components/schemas/HomeTimelineHome"
|
|
||||||
|
|
||||||
HomeTimelineHome:
|
|
||||||
required:
|
|
||||||
- "home_timeline_urt"
|
|
||||||
properties:
|
|
||||||
home_timeline_urt:
|
|
||||||
$ref: "#/components/schemas/HomeTimelineUrt"
|
|
||||||
|
|
||||||
HomeTimelineUrt:
|
|
||||||
required:
|
|
||||||
- "instructions"
|
|
||||||
- "metadata"
|
|
||||||
- "responseObjects"
|
|
||||||
properties:
|
|
||||||
instructions:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
$ref: "./../../components/schemas/Instruction.yaml#/InstructionUnion"
|
|
||||||
metadata:
|
|
||||||
type: object # todo
|
|
||||||
responseObjects:
|
|
||||||
type: object # todo
|
|
||||||
|
|
|
||||||
59
openapi/src/paths/timeline/ListLatestTweetsTimeline.yaml
Normal file
59
openapi/src/paths/timeline/ListLatestTweetsTimeline.yaml
Normal file
|
|
@ -0,0 +1,59 @@
|
||||||
|
get:
|
||||||
|
operationId: getListLatestTweetsTimeline
|
||||||
|
description: get tweet list of timeline
|
||||||
|
parameters:
|
||||||
|
- name: variables
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: '''
|
||||||
|
{
|
||||||
|
"listId":"000000000000",
|
||||||
|
"count":20,
|
||||||
|
"withDownvotePerspective":false
|
||||||
|
}'''
|
||||||
|
- name: features
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
example: '''
|
||||||
|
{
|
||||||
|
"blue_business_profile_image_shape_enabled": true,
|
||||||
|
"responsive_web_graphql_exclude_directive_enabled": true,
|
||||||
|
"verified_phone_label_enabled": false,
|
||||||
|
"responsive_web_graphql_timeline_navigation_enabled": true,
|
||||||
|
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": false,
|
||||||
|
"tweetypie_unmention_optimization_enabled": true,
|
||||||
|
"vibe_api_enabled": true,
|
||||||
|
"responsive_web_edit_tweet_api_enabled": true,
|
||||||
|
"graphql_is_translatable_rweb_tweet_is_translatable_enabled": true,
|
||||||
|
"view_counts_everywhere_api_enabled": true,
|
||||||
|
"longform_notetweets_consumption_enabled": true,
|
||||||
|
"tweet_awards_web_tipping_enabled": false,
|
||||||
|
"freedom_of_speech_not_reach_fetch_enabled": false,
|
||||||
|
"standardized_nudges_misinfo": true,
|
||||||
|
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": false,
|
||||||
|
"interactive_text_enabled": true,
|
||||||
|
"responsive_web_text_conversations_enabled": false,
|
||||||
|
"longform_notetweets_rich_text_read_enabled": true,
|
||||||
|
"responsive_web_enhance_cards_enabled": false,
|
||||||
|
}'''
|
||||||
|
- name: queryId
|
||||||
|
in: query
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
default: "VEwO8c1TYdm5zjxCOIiwFw"
|
||||||
|
example: "'VEwO8c1TYdm5zjxCOIiwFw'"
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: Successful operation
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "./../../components/schemas/Timeline.yaml#/ListTweetsTimelineResponse"
|
||||||
|
tags:
|
||||||
|
- "timeline"
|
||||||
|
- "login-required"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue