1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 23:50:26 +01:00
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-04-13 00:10:21 +09:00
parent d63b3df5e0
commit b2fa9766a0
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
8 changed files with 309 additions and 47 deletions

View file

@ -2,21 +2,95 @@ openapi: 3.0.3
info:
title: Twitter OpenAPI
description: |-
Twitter OpenAPI
Twitter OpenAPI(Swagger) specification
termsOfService: https://github.com/fa0311
contact:
email: yuki@yuki0311.com
license:
name: other
url: https://github.com/fa0311/twitter-openapi/LICENSE
name: GNU Affero General Public License v3.
url: https://raw.githubusercontent.com/fa0311/twitter-openapi/main/LICENSE.txt
version: 0.0.1
servers:
- url: https://twitter.com/i/api/graphql
paths:
# timeline
/BntFPEOxs3GYdPaS6CjUcg/HomeTimeline:
$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:
$ref: ./src/paths/follow/Following.yaml
/VptSi88PiaQhBevFbGVlGg/Followers:
$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

View 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

View file

@ -75,10 +75,8 @@ UserLegacy:
- "has_custom_timelines"
- "is_translator"
- "listed_count"
- "location"
- "media_count"
- "muting"
- "name"
- "normal_followers_count"
- "notifications"
- "pinned_tweet_ids_str"
@ -120,6 +118,7 @@ UserLegacy:
type: integer
favourites_count:
type: integer
default: 0
follow_request_sent:
type: boolean
default: false
@ -128,11 +127,13 @@ UserLegacy:
default: false
followers_count:
type: integer
default: 0
following:
type: boolean
default: false
friends_count:
type: integer
default: 0
has_custom_timelines:
type: boolean
default: false
@ -141,10 +142,12 @@ UserLegacy:
default: false
listed_count:
type: integer
default: 0
location:
type: string
media_count:
type: integer
default: 0
muting:
type: boolean
default: false
@ -152,6 +155,7 @@ UserLegacy:
type: string
normal_followers_count:
type: integer
default: 0
notifications:
type: boolean
default: false
@ -179,6 +183,7 @@ UserLegacy:
type: string
statuses_count:
type: integer
default: 0
translator_type:
type: string
url:

View file

@ -24,3 +24,5 @@ get:
responses:
"200":
description: Successful operation
tags:
- "follow"

View file

@ -24,3 +24,6 @@ get:
responses:
"200":
description: Successful operation
tags:
- "follow"

View 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"

View file

@ -7,62 +7,56 @@ get:
required: true
schema:
type: string
example: '''{
"count": 20,
"includePromotedContent": true,
"latestControlAvailable": true,
"requestContext": "launch",
"withCommunity": true,
"withDownvotePerspective": false,
"withReactionsMetadata": false,
"withReactionsPerspective": 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_richtext_consumption_enabled": true,
"responsive_web_enhance_cards_enabled": false
}'''
- name: queryId
in: query
required: true
schema:
type: string
default: "BntFPEOxs3GYdPaS6CjUcg"
example: "'BntFPEOxs3GYdPaS6CjUcg'"
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/HomeTimelineResponse"
components:
schemas:
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
$ref: "./../../components/schemas/Timeline.yaml#/TimelineResponse"
tags:
- "timeline"
- "login-required"

View 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"