Documentation of InlineQuery

Documentation of InlineQuery in EN


Inline Query

InlineQueryResultArticle

Represents a link to an article or web page.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be article
idStringtrueUnique identifier for this result, 1-64 Bytes
titleStringtrueTitle of the result
input_message_contentInputMessageContenttrueContent of the message to be sent
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
urlStringfalseURL of the result
hide_urlBooleanfalsePass True, if you don't want the URL to be shown in the message
descriptionStringfalseShort description of the result
thumb_urlStringfalseUrl of the thumbnail for the result
thumb_widthIntegerfalseThumbnail width
thumb_heightIntegerfalseThumbnail height

Example:

[{
    type = String,
    id = String,
    title = String,
    input_message_content = InputMessageContent,
    reply_markup = InlineKeyboardMarkup,
    url = String,
    hide_url = Boolean,
    description = String,
    thumb_url = String,
    thumb_width = Integer,
    thumb_height = Integer,
}]

InlineQueryResultPhoto

Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be photo
idStringtrueUnique identifier for this result, 1-64 bytes
photo_urlStringtrueA valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
thumb_urlStringtrueURL of the thumbnail for the photo
photo_widthIntegerfalseWidth of the photo
photo_heightIntegerfalseHeight of the photo
titleStringfalseTitle for the result
descriptionStringfalseShort description of the result
captionStringfalseCaption of the photo to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the photo

Example:

[{
    type = String,
    id = String,
    photo_url = String,
    thumb_url = String,
    photo_width = Integer,
    photo_height = Integer,
    title = String,
    description = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultGif

Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be gif
idStringtrueUnique identifier for this result, 1-64 bytes
gif_urlStringtrueA valid URL for the GIF file. File size must not exceed 1MB
gif_widthIntegerfalseWidth of the GIF
gif_heightIntegerfalseHeight of the GIF
gif_durationIntegerfalseDuration of the GIF
thumb_urlStringtrueURL of the static thumbnail for the result (jpeg or gif)
titleStringfalseTitle for the result
captionStringfalseCaption of the GIF file to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the GIF animation

Example:

[{
    type = String,
    id = String,
    gif_url = String,
    gif_width = Integer,
    gif_height = Integer,
    gif_duration = Integer,
    thumb_url = String,
    title = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultMpeg4Gif

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be mpeg4_gif
idStringtrueUnique identifier for this result, 1-64 bytes
mpeg4_urlStringtrueA valid URL for the MP4 file. File size must not exceed 1MB
mpeg4_widthIntegerfalseVideo width
mpeg4_heightIntegerfalseVideo height
mpeg4_durationIntegerfalseVideo duration
thumb_urlStringtrueURL of the static thumbnail (jpeg or gif) for the result
titleStringfalseTitle for the result
captionStringfalseCaption of the MPEG-4 file to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the video animation

Example:

[{
    type = String,
    id = String,
    mpeg4_url = String,
    mpeg4_width = Integer,
    mpeg4_height = Integer,
    mpeg4_duration = Integer,
    thumb_url = String,
    title = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultVideo

Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be video
idStringtrueUnique identifier for this result, 1-64 bytes
video_urlStringtrueA valid URL for the embedded video player or video file
mime_typeStringtrueMime type of the content of video url, “text/html” or “video/mp4”
thumb_urlStringtrueURL of the thumbnail (jpeg only) for the video
titleStringtrueTitle for the result
captionStringfalseCaption of the video to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
video_widthIntegerfalseVideo width
video_heightIntegerfalseVideo height
video_durationIntegerfalseVideo duration in seconds
descriptionStringfalseShort description of the result
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).

Example:

[{
    type = String,
    id = String,
    video_url = String,
    mime_type = String,
    thumb_url = String,
    title = String,
    caption = String,
    parse_mode = String,
    video_width = Integer,
    video_height = Integer,
    video_duration = Integer,
    description = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultAudio

Represents a link to an mp3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be audio
idStringtrueUnique identifier for this result, 1-64 bytes
audio_urlStringtrueA valid URL for the audio file
titleStringtrueTitle
captionStringfalseCaption, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
performerStringfalsePerformer
audio_durationIntegerfalseAudio duration in seconds
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the audio

Example:

[{
    type = String,
    id = String,
    audio_url = String,
    title = String,
    caption = String,
    parse_mode = String,
    performer = String,
    audio_duration = Integer,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultVoice

Represents a link to a voice recording in an .ogg container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be voice
idStringtrueUnique identifier for this result, 1-64 bytes
voice_urlStringtrueA valid URL for the voice recording
titleStringtrueRecording title
captionStringfalseCaption, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
voice_durationIntegerfalseRecording duration in seconds
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the voice recording

Example:

[{
    type = String,
    id = String,
    voice_url = String,
    title = String,
    caption = String,
    parse_mode = String,
    voice_duration = Integer,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultDocument

Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be document
idStringtrueUnique identifier for this result, 1-64 bytes
titleStringtrueTitle for the result
captionStringfalseCaption of the document to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
document_urlStringtrueA valid URL for the file
mime_typeStringtrueMime type of the content of the file, either “application/pdf” or “application/zip”
descriptionStringfalseShort description of the result
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the file
thumb_urlStringfalseURL of the thumbnail (jpeg only) for the file
thumb_widthIntegerfalseThumbnail width
thumb_heightIntegerfalseThumbnail height

Example:

[{
    type = String,
    id = String,
    title = String,
    caption = String,
    parse_mode = String,
    document_url = String,
    mime_type = String,
    description = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
    thumb_url = String,
    thumb_width = Integer,
    thumb_height = Integer,
}]

InlineQueryResultLocation

Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be location
idStringtrueUnique identifier for this result, 1-64 Bytes
latitudeFloat numbertrueLocation latitude in degrees
longitudeFloat numbertrueLocation longitude in degrees
titleStringtrueLocation title
live_periodIntegerfalsePeriod in seconds for which the location can be updated, should be between 60 and 86400.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the location
thumb_urlStringfalseUrl of the thumbnail for the result
thumb_widthIntegerfalseThumbnail width
thumb_heightIntegerfalseThumbnail height

Example:

[{
    type = String,
    id = String,
    latitude = Float number,
    longitude = Float number,
    title = String,
    live_period = Integer,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
    thumb_url = String,
    thumb_width = Integer,
    thumb_height = Integer,
}]

InlineQueryResultVenue

Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be venue
idStringtrueUnique identifier for this result, 1-64 Bytes
latitudeFloattrueLatitude of the venue location in degrees
longitudeFloattrueLongitude of the venue location in degrees
titleStringtrueTitle of the venue
addressStringtrueAddress of the venue
foursquare_idStringfalseFoursquare identifier of the venue if known
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the venue
thumb_urlStringfalseUrl of the thumbnail for the result
thumb_widthIntegerfalseThumbnail width
thumb_heightIntegerfalseThumbnail height

Example:

[{
    type = String,
    id = String,
    latitude = Float,
    longitude = Float,
    title = String,
    address = String,
    foursquare_id = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
    thumb_url = String,
    thumb_width = Integer,
    thumb_height = Integer,
}]

InlineQueryResultContact

Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be contact
idStringtrueUnique identifier for this result, 1-64 Bytes
phone_numberStringtrueContact's phone number
first_nameStringtrueContact's first name
last_nameStringfalseContact's last name
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the contact
thumb_urlStringfalseUrl of the thumbnail for the result
thumb_widthIntegerfalseThumbnail width
thumb_heightIntegerfalseThumbnail height

Example:

[{
    type = String,
    id = String,
    phone_number = String,
    first_name = String,
    last_name = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
    thumb_url = String,
    thumb_width = Integer,
    thumb_height = Integer,
}]

InlineQueryResultGame

Represents a Game.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be game
idStringtrueUnique identifier for this result, 1-64 bytes
game_short_nameStringtrueShort name of the game
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message

Example:

[{
    type = String,
    id = String,
    game_short_name = String,
    reply_markup = InlineKeyboardMarkup,
}]

InlineQueryResultCachedPhoto

Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be photo
idStringtrueUnique identifier for this result, 1-64 bytes
photo_file_idStringtrueA valid file identifier of the photo
titleStringfalseTitle for the result
descriptionStringfalseShort description of the result
captionStringfalseCaption of the photo to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the photo

Example:

[{
    type = String,
    id = String,
    photo_file_id = String,
    title = String,
    description = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultCachedGif

Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be gif
idStringtrueUnique identifier for this result, 1-64 bytes
gif_file_idStringtrueA valid file identifier for the GIF file
titleStringfalseTitle for the result
captionStringfalseCaption of the GIF file to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the GIF animation

Example:

[{
    type = String,
    id = String,
    gif_file_id = String,
    title = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultCachedMpeg4Gif

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be mpeg4_gif
idStringtrueUnique identifier for this result, 1-64 bytes
mpeg4_file_idStringtrueA valid file identifier for the MP4 file
titleStringfalseTitle for the result
captionStringfalseCaption of the MPEG-4 file to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the video animation

Example:

[{
    type = String,
    id = String,
    mpeg4_file_id = String,
    title = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultCachedSticker

Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be sticker
idStringtrueUnique identifier for this result, 1-64 bytes
sticker_file_idStringtrueA valid file identifier of the sticker
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the sticker

Example:

[{
    type = String,
    id = String,
    sticker_file_id = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultCachedDocument

Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be document
idStringtrueUnique identifier for this result, 1-64 bytes
titleStringtrueTitle for the result
document_file_idStringtrueA valid file identifier for the file
descriptionStringfalseShort description of the result
captionStringfalseCaption of the document to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the file

Example:

[{
    type = String,
    id = String,
    title = String,
    document_file_id = String,
    description = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultCachedVideo

Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be video
idStringtrueUnique identifier for this result, 1-64 bytes
video_file_idStringtrueA valid file identifier for the video file
titleStringtrueTitle for the result
descriptionStringfalseShort description of the result
captionStringfalseCaption of the video to be sent, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the video

Example:

[{
    type = String,
    id = String,
    video_file_id = String,
    title = String,
    description = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultCachedVoice

Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be voice
idStringtrueUnique identifier for this result, 1-64 bytes
voice_file_idStringtrueA valid file identifier for the voice message
titleStringtrueVoice message title
captionStringfalseCaption, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the voice message

Example:

[{
    type = String,
    id = String,
    voice_file_id = String,
    title = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]

InlineQueryResultCachedAudio

Represents a link to an mp3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

FieldTypeRequiredDesc
typeStringtrueType of the result, must be audio
idStringtrueUnique identifier for this result, 1-64 bytes
audio_file_idStringtrueA valid file identifier for the audio file
captionStringfalseCaption, 0-200 characters
parse_modeStringfalseSend Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
reply_markupInlineKeyboardMarkupfalseInline keyboard attached to the message
input_message_contentInputMessageContentfalseContent of the message to be sent instead of the audio

Example:

[{
    type = String,
    id = String,
    audio_file_id = String,
    caption = String,
    parse_mode = String,
    reply_markup = InlineKeyboardMarkup,
    input_message_content = InputMessageContent,
}]