1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 23:50:26 +01:00

add builder

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-04-18 09:23:53 +09:00
parent 9052b3a16a
commit 26908878c1
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
31 changed files with 2886 additions and 1549 deletions

41
src/config/header.yaml Normal file
View file

@ -0,0 +1,41 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
headers:
x-connection-hash:
schema:
type: string
x-content-type-options:
schema:
type: string
x-frame-options:
schema:
type: string
x-rate-limit-limit:
schema:
type: integer
x-rate-limit-remaining:
schema:
type: integer
x-rate-limit-reset:
schema:
type: integer
x-response-time:
schema:
type: integer
x-tfe-preserve-body:
schema:
type: boolean
x-transaction-id:
schema:
type: string
x-twitter-response-tags:
schema:
type: string
x-xss-protection:
schema:
type: integer

View file

@ -0,0 +1,30 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths:
/parameters:
get:
parameters:
- name: variables
in: query
required: true
schema:
type: string
example: "{{Variables}}"
- name: features
in: query
required: true
schema:
type: string
example: "{{Features}}"
- name: queryId
in: query
required: true
schema:
type: string
default: "{{Query}}"
example: "{{Query}}"
responses:
"200":
description: ""

234
src/config/placeholder.json Normal file
View file

@ -0,0 +1,234 @@
{
"HomeTimeline": {
"Query": "HCosKfLNW1AcOo3la3mMgg",
"Variables": {
"count": 40,
"includePromotedContent": true,
"latestControlAvailable": true,
"withCommunity": true
},
"Feature": {
"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
}
},
"HomeLatestTimeline": {
"Query": "zhX91JE87mWvfprhYE97xA",
"Variables": {
"count": 20,
"includePromotedContent": true,
"latestControlAvailable": true,
"requestContext": "launch"
},
"Feature": {
"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
}
},
"ListLatestTweetsTimeline": {
"Query": "2TemLyqrMpTeAmysdbnVqw",
"Variables": {
"listId": "53044119",
"count": 20
},
"Feature": {
"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
}
},
"UserByScreenName": {
"Query": "sLVLhk0bGj3MVFEKTdax1w",
"Variables": {
"screen_name": "elonmusk",
"withSafetyModeUserFields": true
},
"Features": {
"blue_business_profile_image_shape_enabled": true,
"responsive_web_graphql_exclude_directive_enabled": true,
"verified_phone_label_enabled": false,
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": false,
"responsive_web_graphql_timeline_navigation_enabled": true
}
},
"UserTweets": {
"Query": "HuTx74BxAnezK1gWvYY7zg",
"Variables": {
"userId": "44196397",
"count": 40,
"includePromotedContent": true,
"withQuickPromoteEligibilityTweetFields": true,
"withVoice": true,
"withV2Timeline": true
},
"Features": {
"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
}
},
"UserTweetsAndReplies": {
"Query": "RIWc55YCNyUJ-U3HHGYkdg",
"Variables": {
"userId": "44196397",
"count": 40,
"includePromotedContent": true,
"withCommunity": true,
"withVoice": true,
"withV2Timeline": true
},
"Features": {
"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
}
},
"UserMedia": {
"Query": "YqiE3JL1KNgf9nSljYdxaA",
"Variables": {
"userId": "44196397",
"count": 20,
"includePromotedContent": false,
"withClientEventToken": false,
"withBirdwatchNotes": false,
"withVoice": true,
"withV2Timeline": true
},
"Features": {
"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
}
},
"Likes": {
"Query": "5fmEkRT-1AdHqEsbVgehMg",
"Variables": {
"userId": "44196397",
"count": 20,
"includePromotedContent": false,
"withClientEventToken": false,
"withBirdwatchNotes": false,
"withVoice": true,
"withV2Timeline": true
},
"Features": {
"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
}
}
}

View file

@ -0,0 +1,94 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
description: |-
Twitter OpenAPI(Swagger) specification
termsOfService: https://github.com/fa0311
contact:
email: yuki@yuki0311.com
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: {}
components:
schemas: {}
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
CookieCt0:
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
security:
- bearerAuth: []
- CsrfToken: []
- ActiveUser: []
- AuthType: []
- ClientLanguage: []
- CookieAuthToken: []
- CookieCt0: []

View file

@ -0,0 +1,27 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths:
/{{FollowingQuery}}/Following:
get:
operationId: getFollowers
description: get user list of followers
responses:
"200":
description: Successful operation
tags:
- "follow"
- "graphql"
/{{FollowersQuery}}/Followers:
get:
operationId: getFollowing
description: get user list of following
responses:
"200":
description: Successful operation
tags:
- "follow"
- "graphql"

View file

@ -0,0 +1,104 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths:
/{{HomeTimelineQuery}}/HomeTimeline:
get:
operationId: getHomeTimeline
description: get tweet list of timeline
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/TimelineResponse"
tags:
- "timeline"
- "login-required"
- "graphql"
/{{HomeLatestTimelineQuery}}/HomeLatestTimeline:
get:
operationId: getHomeLatestTimeline
description: get tweet list of timeline
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/TimelineResponse"
tags:
- "timeline"
- "login-required"
- "graphql"
/{{ListLatestTweetsTimelineQuery}}/ListLatestTweetsTimeline:
get:
operationId: getListLatestTweetsTimeline
description: get tweet list of timeline
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/ListTweetsTimelineResponse"
tags:
- "timeline"
- "login-required"
- "graphql"
components:
schemas:
TimelineResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/HomeTimelineResponseData"
HomeTimelineResponseData:
required:
- "home"
properties:
home:
$ref: "#/components/schemas/HomeTimelineHome"
HomeTimelineHome:
required:
- "home_timeline_urt"
properties:
home_timeline_urt:
$ref: "./../schemas/timeline.yaml#/components/schemas/Timeline"
ListTweetsTimelineResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/ListTweetsTimelineData"
ListTweetsTimelineData:
required:
- "list"
properties:
home:
$ref: "#/components/schemas/ListTweetsTimelineList"
ListTweetsTimelineList:
required:
- "tweets_timeline"
properties:
tweets_timeline:
$ref: "#/components/schemas/ListTweetsTimeline"
ListTweetsTimeline:
required:
- "timeline"
properties:
timeline:
$ref: "./../schemas/timeline.yaml#/components/schemas/Timeline"

View file

@ -0,0 +1,36 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths:
/{{UserByScreenNameQuery}}/UserByScreenName:
get:
operationId: getUserByScreenName
description: "get user by screen name"
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/UserResponse"
tags:
- "user"
- "graphql"
components:
schemas:
UserResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/UserResponseData"
UserResponseData:
required:
- "user"
properties:
user:
$ref: "./../schemas/user.yaml#/components/schemas/UserResults"

View file

@ -0,0 +1,98 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths:
/{{UserTweetsQuery}}/UserTweets:
get:
operationId: getUserTweets
description: "get user tweets"
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "user"
- "graphql"
/{{UserTweetsAndRepliesQuery}}/UserTweetsAndReplies:
get:
operationId: getUserTweetsAndReplies
description: "get user replies tweets"
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "user"
- "graphql"
/{{UserMediaQuery}}/UserMedia:
get:
operationId: getUserMedia
description: "get user media tweets"
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "user"
- "graphql"
/{{LikesQuery}}/Likes:
get:
operationId: getLikes
description: "get user likes tweets"
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "user"
- "graphql"
components:
schemas:
UserTweetsResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/UserTweetsData"
UserTweetsData:
required:
- "user"
properties:
user:
$ref: "#/components/schemas/UserTweetsUser"
UserTweetsUser:
required:
- "result"
properties:
result:
$ref: "#/components/schemas/UserTweetsResult"
UserTweetsResult:
required:
- "__typename"
- "timeline_v2"
properties:
__typename:
$ref: "./../schemas/typename.yaml#/components/schemas/TypeName" # User
timeline_v2:
$ref: "./../schemas/timeline.yaml#/components/schemas/TimelineV2"

View file

@ -0,0 +1,110 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
ContentUnion:
oneOf:
- $ref: "#/components/schemas/TimelineTimelineItem"
- $ref: "#/components/schemas/TimelineTimelineCursor"
- $ref: "#/components/schemas/TimelineTimelineModule"
discriminator:
propertyName: entryType
mapping": # deprecated
TimelineTimelineItem: "#/components/schemas/TimelineTimelineItem"
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
TimelineTimelineModule: "#/components/schemas/TimelineTimelineModule"
ContentEntryType:
type: string
enum:
[TimelineTimelineItem, TimelineTimelineCursor, TimelineTimelineModule]
TimelineTimelineItem:
required:
- "__typename"
- "entryType"
- "itemContent"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineItem
entryType:
type: string # enum
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineItem
itemContent:
$ref: "#/components/schemas/ItemContent"
clientEventInfo:
type: object # todo
feedbackInfo:
type: object # todo
TimelineTimelineCursor:
required:
- "__typename"
- "entryType"
- "cursorType"
- "value"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineCursor
entryType:
type: string # enum
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor
cursorType:
type: string
enum: [Top, Bottom]
value:
type: string
TimelineTimelineModule:
required:
- "__typename"
- "entryType"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineModule
entryType:
type: string # enum
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor
# ================= ContentItem =================
ContentItemType:
type: string
enum: [TimelineTweet]
ItemContent:
required:
- "__typename"
- "itemType"
- "tweetDisplayType"
- "tweet_results"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTweet
itemType:
type: string # enum
$ref: "#/components/schemas/ContentItemType" # TimelineTweet
tweetDisplayType:
type: string
tweet_results:
$ref: "#/components/schemas/ItemResult"
socialContext:
type: object
properties:
contextType:
type: string # enum
text:
type: string
type:
type: string # enum
ItemResult:
required:
- "result"
properties:
result:
$ref: "./tweet.yaml#/components/schemas/TweetUnion"

View file

@ -0,0 +1,12 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
TwitterTimeFormat:
type: string
pattern: "^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (0[1-9]|[12][0-9]|3[01]) (0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]) ([+-][0-9]{4}) ([0-9]{4})$"
example: "Sat Dec 31 23:59:59 +0000 2023"

View file

@ -0,0 +1,70 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
InstructionUnion:
oneOf:
- $ref: "#/components/schemas/TimelineAddEntries"
- $ref: "#/components/schemas/TimelineClearCache"
- $ref: "#/components/schemas/TimelinePinEntry"
discriminator:
propertyName: type
mapping": # deprecated
TimelineAddEntries: "#/components/schemas/TimelineAddEntries"
TimelineClearCache: "#/components/schemas/TimelineClearCache"
TimelinePinEntry: "#/components/schemas/TimelinePinEntry"
InstructionType:
type: string
enum: [TimelineAddEntries, TimelineClearCache, TimelinePinEntry]
TimelineAddEntries:
required:
- type
- entries
properties:
type:
type: string
$ref: "#/components/schemas/InstructionType" # TimelineAddEntries
entries:
type: array
items:
$ref: "#/components/schemas/TimelineAddEntry"
TimelineClearCache:
required:
- type
properties:
type:
type: string
$ref: "#/components/schemas/InstructionType" # TimelineClearCache
TimelinePinEntry:
required:
- type
- entry
properties:
type:
type: string
$ref: "#/components/schemas/InstructionType" # TimelinePinEntry
entry:
$ref: "#/components/schemas/TimelineAddEntry"
TimelineAddEntry:
required:
- "content"
- "entryId"
- "sortIndex"
properties:
content:
$ref: "./content.yaml#/components/schemas/ContentUnion"
entryId:
type: string
pattern: '^[a-z\-]+[0-9]+$'
sortIndex:
type: string
pattern: "[0-9]+$"

View file

@ -0,0 +1,27 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
TimelineV2:
required:
- "timeline"
properties:
timeline:
$ref: "#/components/schemas/Timeline"
Timeline:
required:
- "instructions"
properties:
instructions:
type: array
items:
$ref: "./../schemas/instruction.yaml#/components/schemas/InstructionUnion"
metadata:
type: object # todo
responseObjects:
type: object # todo

View file

@ -0,0 +1,152 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
TweetUnion:
oneOf:
- $ref: "#/components/schemas/Tweet"
- $ref: "#/components/schemas/TweetWithVisibilityResults"
discriminator:
propertyName: __typename
mapping": # deprecated
Tweet: "#/components/schemas/Tweet"
TweetWithVisibilityResults: "#/components/schemas/TweetWithVisibilityResults"
TweetWithVisibilityResults:
required:
- "__typename"
- "tweet"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TweetWithVisibilityResults
tweet:
$ref: "#/components/schemas/Tweet"
Tweet:
required:
# - "__typename"
- "rest_id"
- "core"
- "edit_control"
- "edit_prespective"
- "is_translatable"
- "legacy"
- "views"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # Tweet
rest_id:
type: string
pattern: "^[0-9]+$"
core:
$ref: "./user.yaml#/components/schemas/UserResultCore"
unmention_data:
type: object # todo
edit_control:
type: object
properties:
edit_tweet_ids:
type: array
items:
type: string
pattern: "^[0-9]+$"
editable_until_msecs:
type: string
pattern: "^[0-9]+$"
is_edit_eligible:
type: boolean
edits_remaining:
type: string
pattern: "^[0-9]+$"
edit_prespective:
type: object
properties:
favorited:
type: boolean
retweeted:
type: boolean
is_translatable:
type: boolean
default: false
legacy:
$ref: "#/components/schemas/TweetLegacy"
views:
type: object
properties:
count:
type: string
pattern: "^[0-9]+$"
state:
type: string # enum
TweetLegacy:
required:
- "bookmark_count"
- "bookmarked"
- "conversation_id_str"
- "created_at"
- "display_text_range"
- "entities"
- "favorite_count"
- "favorited"
- "full_text"
- "is_quote_status"
- "lang"
- "quote_count"
- "reply_count"
- "retweet_count"
- "retweeted"
- "user_id_str"
- "id_str"
properties:
bookmark_count:
type: integer
bookmarked:
type: boolean
created_at:
$ref: "./general.yaml#/components/schemas/TwitterTimeFormat"
conversation_id_str:
type: string
pattern: "^[0-9]+$"
display_text_range:
type: array
items:
type: integer
entities:
type: object
favorite_count:
type: integer
favorited:
type: boolean
full_text:
type: string
is_quote_status:
type: boolean
lang:
type: string # enum
possibly_sensitive:
type: boolean
default: false
possibly_sensitive_editable:
type: boolean
default: false
quote_count:
type: integer
reply_count:
type: integer
retweet_count:
type: integer
retweeted:
type: boolean
user_id_str:
type: string
pattern: "^[0-9]+$"
id_str:
type: string
pattern: "^[0-9]+$"

View file

@ -0,0 +1,19 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
TypeName:
type: string
enum:
[
TimelineTweet,
TimelineTimelineItem,
TimelineTimelineCursor,
TweetWithVisibilityResults,
TimelineTimelineModule,
Tweet,
User,
]

View file

@ -0,0 +1,219 @@
openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
UserResultCore:
required:
- "user_results"
properties:
user_results:
$ref: "#/components/schemas/UserResults"
UserResults:
required:
- "result"
properties:
result:
$ref: "#/components/schemas/UserUnion"
UserUnion:
oneOf:
- $ref: "#/components/schemas/User"
discriminator:
propertyName: __typename
mapping": # deprecated
User: "#/components/schemas/User"
User:
required:
- "__typename"
- "affiliates_highlighted_label"
- "has_graduated_access"
- "id"
- "is_blue_verified"
- "legacy"
- "rest_id"
- "super_follow_eligible"
- "super_followed_by"
- "super_following"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # User
affiliates_highlighted_label:
type: object # todo
has_graduated_access:
type: boolean
has_nft_avatar:
type: boolean
default: false
id:
type: string
pattern: '^[a-z\-]+[0-9]+$'
is_blue_verified:
type: boolean
default: false
legacy:
$ref: "#/components/schemas/UserLegacy"
rest_id:
type: string
pattern: "^[0-9]+$"
business_account:
type: object # todo
super_follow_eligible:
type: boolean
default: false
super_followed_by:
type: boolean
default: false
super_following:
type: boolean
default: false
UserLegacy:
required:
- "blocked_by"
- "blocking"
- "can_dm"
- "can_media_tag"
- "created_at"
- "default_profile"
- "default_profile_image"
- "description"
- "entities"
- "fast_followers_count"
- "favourites_count"
- "follow_request_sent"
- "followed_by"
- "followers_count"
- "following"
- "friends_count"
- "has_custom_timelines"
- "is_translator"
- "listed_count"
- "location"
- "media_count"
- "muting"
- "name"
- "normal_followers_count"
- "notifications"
- "pinned_tweet_ids_str"
- "possibly_sensitive"
- "profile_image_url_https"
- "profile_interstitial_type"
- "protected"
- "screen_name"
- "status"
- "statuses_count"
- "translator_type"
- "verified"
- "want_retweets"
properties:
blocked_by:
type: boolean
default: false
blocking:
type: boolean
default: false
can_dm:
type: boolean
default: false
can_media_tag:
type: boolean
default: false
created_at:
$ref: "./general.yaml#/components/schemas/TwitterTimeFormat"
default_profile:
type: boolean
default: false
default_profile_image:
type: boolean
default: false
description:
type: string
entities:
type: object # todo
fast_followers_count:
type: integer
favourites_count:
type: integer
default: 0
follow_request_sent:
type: boolean
default: false
followed_by:
type: boolean
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
is_translator:
type: boolean
default: false
listed_count:
type: integer
default: 0
location:
type: string
media_count:
type: integer
default: 0
muting:
type: boolean
default: false
name:
type: string
normal_followers_count:
type: integer
default: 0
notifications:
type: boolean
default: false
pinned_tweet_ids_str:
type: array
items:
type: string
possibly_sensitive:
type: boolean
default: false
profile_banner_extensions:
type: object
profile_banner_url:
type: string
format: uri
profile_image_extensions:
type: object
profile_image_url_https:
type: string
format: uri
profile_interstitial_type:
type: string
protected:
type: boolean
default: false
screen_name:
type: string
statuses_count:
type: integer
default: 0
translator_type:
type: string
url:
type: string
verified:
type: boolean
want_retweets:
type: boolean
default: false