@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Twitter OpenAPI
@base https://x.com/i/api
@version 0.0.1
@auth ApiKey Accept in header | ApiKey Accept-Encoding in header | ApiKey Accept-Language in header | ApiKey x-twitter-active-user in header | ApiKey x-twitter-auth-type in header | Bearer bearer | ApiKey x-twitter-client-language in header | ApiKey x-client-transaction-id in header | ApiKey x-client-uuid in header | ApiKey auth_token in cookie | ApiKey ct0 in cookie | ApiKey gt0 in cookie | ApiKey x-csrf-token in header | ApiKey x-guest-token in header | ApiKey Priority in header | ApiKey Referer in header | ApiKey Sec-Ch-Ua in header | ApiKey Sec-Ch-Ua-Mobile in header | ApiKey Sec-Ch-Ua-Platform in header | ApiKey Sec-Fetch-Dest in header | ApiKey Sec-Fetch-Mode in header | ApiKey Sec-Fetch-Site in header | ApiKey user-agent in header
@endpoints 40
@hint download_for_search
@toc 1.1(4), 2(1), graphql(34), other(1)

@group 1.1
@endpoint GET /1.1/friends/following/list.json
@required {include_profile_interstitial_type: int=1, include_blocking: int=1, include_blocked_by: int=1, include_followed_by: int=1, include_want_retweets: int=1, include_mute_edge: int=1, include_can_dm: int=1, include_can_media_tag: int=1, include_ext_has_nft_avatar: int=1, include_ext_is_blue_verified: int=1, include_ext_verified_type: int=1, include_ext_profile_image_shape: int=1, skip_status: int=1, cursor: int=-1, user_id: str=44196397, count: int=3, with_total_count: bool=true}
@returns(200)

@endpoint POST /1.1/friendships/create.json
@returns(200)

@endpoint POST /1.1/friendships/destroy.json
@returns(200)

@endpoint GET /1.1/search/typeahead.json
@required {include_ext_is_blue_verified: int=1, include_ext_verified_type: int=1, include_ext_profile_image_shape: int=1, q: str=test, src: str=search_box, result_type: str=events,users,topics}
@returns(200)

@endgroup

@group 2
@endpoint GET /2/search/adaptive.json
@required {include_profile_interstitial_type: int=1, include_blocking: int=1, include_blocked_by: int=1, include_followed_by: int=1, include_want_retweets: int=1, include_mute_edge: int=1, include_can_dm: int=1, include_can_media_tag: int=1, include_ext_has_nft_avatar: int=1, include_ext_is_blue_verified: int=1, include_ext_verified_type: int=1, include_ext_profile_image_shape: int=1, skip_status: int=1, cards_platform: str=Web-12, include_cards: int=1, include_ext_alt_text: bool=true, include_ext_limited_action_results: bool=false, include_quote_count: bool=true, include_reply_count: int=1, tweet_mode: str=extended, include_ext_views: bool=true, include_entities: bool=true, include_user_entities: bool=true, include_ext_media_color: bool=true, include_ext_media_availability: bool=true, include_ext_sensitive_media_warning: bool=true, include_ext_trusted_friends_metadata: bool=true, send_error_codes: bool=true, simple_quoted_tweet: bool=true, q: str=elon musk, query_source: str=trend_click, count: int=20, requestContext: str=launch, pc: int=1, spelling_corrections: int=1, include_ext_edit_control: bool=true, ext: str=mediaStats,highlightedLabel,hasNftAvatar,voiceInfo,birdwatchPivot,enrichments,superFollowMetadata,unmentionInfo,editControl,vibe}
@returns(200)

@endgroup

@group graphql
@endpoint GET /graphql/{pathQueryId}/BlueVerifiedFollowers
@required {pathQueryId: str=crKOXrAHR3W3aPuKEJG8GA, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/Bookmarks
@required {pathQueryId: str=XD0ViOeSOW4YoeNTGjVaYw, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/CommunityAboutTimeline
@required {pathQueryId: str=2k_fZ9eubu6wh1mk-zcHYg, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/CommunityMediaTimeline
@required {pathQueryId: str=ZniZ7AAK_VVu1xtSx1V-gQ, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/CommunityTweetsTimeline
@required {pathQueryId: str=PUinTHtCGWmECLX57lhRHA, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/CreateBookmark
@required {pathQueryId: str=aoDbu3RHznuiSkQ9aNM67Q, queryId: str=aoDbu3RHznuiSkQ9aNM67Q, variables: map{tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/CreateRetweet
@required {pathQueryId: str=mbRO74GrOvSfRcJnlMapnQ, queryId: str=mbRO74GrOvSfRcJnlMapnQ, variables: map{dark_request!: bool, tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/CreateTweet
@required {pathQueryId: str=5CdvsV_zjv4L64XFifAglw, features: map{articles_preview_enabled!: bool, c9s_tweet_anatomy_moderator_badge_enabled!: bool, communities_web_enable_tweet_community_results_fetch!: bool, content_disclosure_ai_generated_indicator_enabled!: bool, content_disclosure_indicator_enabled!: bool, freedom_of_speech_not_reach_fetch_enabled!: bool, graphql_is_translatable_rweb_tweet_is_translatable_enabled!: bool, longform_notetweets_consumption_enabled!: bool, longform_notetweets_inline_media_enabled!: bool, longform_notetweets_rich_text_read_enabled!: bool, post_ctas_fetch_enabled!: bool, premium_content_api_read_enabled!: bool, profile_label_improvements_pcf_label_in_post_enabled!: bool, responsive_web_edit_tweet_api_enabled!: bool, responsive_web_graphql_skip_user_profile_image_extensions_enabled!: bool, responsive_web_graphql_timeline_navigation_enabled!: bool, responsive_web_grok_analysis_button_from_backend!: bool, responsive_web_grok_analyze_button_fetch_trends_enabled!: bool, responsive_web_grok_analyze_post_followups_enabled!: bool, responsive_web_grok_annotations_enabled!: bool, responsive_web_grok_community_note_auto_translation_is_enabled!: bool, responsive_web_grok_image_annotation_enabled!: bool, responsive_web_grok_imagine_annotation_enabled!: bool, responsive_web_grok_share_attachment_enabled!: bool, responsive_web_grok_show_grok_translated_post!: bool, responsive_web_jetfuel_frame!: bool, responsive_web_profile_redirect_enabled!: bool, responsive_web_twitter_article_tweet_consumption_enabled!: bool, rweb_cashtags_composer_attachment_enabled!: bool, rweb_cashtags_enabled!: bool, rweb_conversational_replies_downvote_enabled!: bool, rweb_tipjar_consumption_enabled!: bool, standardized_nudges_misinfo!: bool, tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled!: bool, verified_phone_label_enabled!: bool, view_counts_everywhere_api_enabled!: bool}, queryId: str=5CdvsV_zjv4L64XFifAglw, variables: map{attachment_url: str, conversation_control: map, dark_request!: bool, disallowed_reply_options: map, media!: map, reply: map, semantic_annotation_ids!: [map], tweet_text!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/DeleteBookmark
@required {pathQueryId: str=Wlmlj2-xzyS1GN3a6cj-mQ, queryId: str=Wlmlj2-xzyS1GN3a6cj-mQ, variables: map{tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/DeleteRetweet
@required {pathQueryId: str=ZyZigVsNiFO6v1dEks1eWg, queryId: str=ZyZigVsNiFO6v1dEks1eWg, variables: map{dark_request!: bool, source_tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/DeleteTweet
@required {pathQueryId: str=VaenaVgh5q5ih7kvyVjgtg, queryId: str=VaenaVgh5q5ih7kvyVjgtg, variables: map{dark_request!: bool, tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/FavoriteTweet
@required {pathQueryId: str=lI07N6Otwv1PhnEgXILM7A, queryId: str=lI07N6Otwv1PhnEgXILM7A, variables: map{tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/Favoriters
@required {pathQueryId: str=SPOr3rvo2j1E8bFd-qGczQ, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/Followers
@required {pathQueryId: str=_orfRBQae57vylFPH0Huhg, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/FollowersYouKnow
@required {pathQueryId: str=XHuroE2oWOl32tc_rjQytw, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/Following
@required {pathQueryId: str=F42cDX8PDFxkbjjq6JrM2w, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/HomeLatestTimeline
@required {pathQueryId: str=0dateTVgvXjpkf7kyBZy0g, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/HomeTimeline
@required {pathQueryId: str=7zlnp2TxC044W4C1ZUJMHw, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/Likes
@required {pathQueryId: str=rk2aeVVvKsyUdG3jf5uiLw, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/ListLatestTweetsTimeline
@required {pathQueryId: str=FVWmROVvhgjRPC-4jAUh8A, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/NotificationsTimeline
@required {pathQueryId: str=gzC0OYBCnfdYS4M4Gue7BA, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/ProfileSpotlightsQuery
@required {pathQueryId: str=mzoqrVGwk-YTSGME1dRfXQ, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/Retweeters
@required {pathQueryId: str=TZsWuSj7vGmncVnq7KWDUQ, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/SearchTimeline
@required {pathQueryId: str=Yw6L66Pw54NHKuq4Dp7b4Q, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/TweetDetail
@required {pathQueryId: str=oCon7R-cgWRFy6EfZjaKfg, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/TweetResultByRestId
@required {pathQueryId: str=tCVRZ3WCvoj0BVO7BKnL-Q, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/UnfavoriteTweet
@required {pathQueryId: str=ZYKSe-w7KEslx3JhSIk5LA, queryId: str=ZYKSe-w7KEslx3JhSIk5LA, variables: map{dark_request!: bool, tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/UserByRestId
@required {pathQueryId: str=XIpMDIi_YoVzXeoON-cfAQ, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/UserByScreenName
@required {pathQueryId: str=IGgvgiOx4QZndDHuD3x9TQ, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/UserHighlightsTweets
@required {pathQueryId: str=acwIZetKoEZPfIAhjXYpuA, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/UserMedia
@required {pathQueryId: str=9EovraBTXJYGSEQXZqlLmQ, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/UserTweets
@required {pathQueryId: str=36rb3Xj3iJ64Q-9wKDjCcQ, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/UserTweetsAndReplies
@required {pathQueryId: str=D5eKzDa5ZoJuC1TCeAXbWA, variables: any, features: any, fieldToggles: any}
@returns(200) {data: any, errors: [map]}

@endpoint GET /graphql/{pathQueryId}/UsersByRestIds
@required {pathQueryId: str=_8egOzcbgeLIhP0TbTStGw, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

@endgroup

@group other
@endpoint GET /other
@returns(200) {Session: map{SsoInitTokens: map, communitiesActions: map{create: bool}, country: str, guestId: str, hasCommunityMemberships: bool, isActiveCreator: bool, isRestrictedSession: bool, isSuperFollowSubscriber: bool, language: str, oneFactorLoginEligibility: map{fetchStatus: str}, superFollowersCount: int, superFollowsApplicationStatus: str, userFeatures: map{mediatool_studio_library: bool}, user_id: str}}

@endgroup

@end
