@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 39
@hint download_for_search
@toc 1.1(4), 2(1), graphql(33), 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}/Bookmarks
@required {pathQueryId: str=2neUNDqrrFzbLui8yallcQ, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

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

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

@endpoint GET /graphql/{pathQueryId}/CommunityTweetsTimeline
@required {pathQueryId: str=rp4YNcEs-BXdkm1DA4PMhw, 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=ojPdsZsimiJrUGLR1sjUtA, queryId: str=ojPdsZsimiJrUGLR1sjUtA, variables: map{dark_request!: bool, tweet_id!: str}}
@returns(200) {data: any, errors: [map]}

@endpoint POST /graphql/{pathQueryId}/CreateTweet
@required {pathQueryId: str=IID9x6WsdMnTlXnzXGq8ng, features: map{articles_preview_enabled!: bool, c9s_tweet_anatomy_moderator_badge_enabled!: bool, communities_web_enable_tweet_community_results_fetch!: bool, creator_subscriptions_quote_tweet_preview_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, premium_content_api_read_enabled!: bool, profile_label_improvements_pcf_label_in_post_enabled!: bool, responsive_web_edit_tweet_api_enabled!: bool, responsive_web_enhance_cards_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_image_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_twitter_article_tweet_consumption_enabled!: bool, rweb_tipjar_consumption_enabled!: bool, standardized_nudges_misinfo!: bool, tweet_awards_web_tipping_enabled!: 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=IID9x6WsdMnTlXnzXGq8ng, 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=iQtK4dl5hBmXewYZuEOKVw, queryId: str=iQtK4dl5hBmXewYZuEOKVw, 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=G27_CXbgIP3G9Fod_2RMUA, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

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

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

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

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

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

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

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

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

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

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

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

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

@endpoint GET /graphql/{pathQueryId}/TweetResultByRestId
@required {pathQueryId: str=7xflPyRiUxGVbJd4uWmbfg, 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=tD8zKvQzwY3kdx5yz6YmOw, variables: any, features: any}
@returns(200) {data: any, errors: [map]}

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

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

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

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

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

@endpoint GET /graphql/{pathQueryId}/UsersByRestIds
@required {pathQueryId: str=XArUHrueMW0KQdZUdqidrA, 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
