{"id":26044531,"url":"https://github.com/rockneurotiko/telegram_api_json","last_synced_at":"2025-07-19T10:33:49.167Z","repository":{"id":40944604,"uuid":"153012057","full_name":"rockneurotiko/telegram_api_json","owner":"rockneurotiko","description":"This projects scrapes the website for the Telegram Bot API and provides a JSON with all the data needed","archived":false,"fork":false,"pushed_at":"2025-07-04T08:46:56.000Z","size":333,"stargazers_count":23,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T13:36:18.378Z","etag":null,"topics":["api","bot","elixir","hacktoberfest","json","scraper","telegram","telegram-api-json","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rockneurotiko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-14T19:41:24.000Z","updated_at":"2025-07-04T08:47:00.000Z","dependencies_parsed_at":"2023-12-30T00:39:59.305Z","dependency_job_id":"67f84fe5-1299-4005-97a2-026360cb715e","html_url":"https://github.com/rockneurotiko/telegram_api_json","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/rockneurotiko/telegram_api_json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockneurotiko%2Ftelegram_api_json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockneurotiko%2Ftelegram_api_json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockneurotiko%2Ftelegram_api_json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockneurotiko%2Ftelegram_api_json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rockneurotiko","download_url":"https://codeload.github.com/rockneurotiko/telegram_api_json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rockneurotiko%2Ftelegram_api_json/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265916668,"owners_count":23848762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bot","elixir","hacktoberfest","json","scraper","telegram","telegram-api-json","telegram-bot"],"created_at":"2025-03-07T18:31:50.118Z","updated_at":"2025-07-19T10:33:49.127Z","avatar_url":"https://github.com/rockneurotiko.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Bot API Json\n\nThis projects scrapes the website for the [Telegram Bot API](https://core.telegram.org/bots/api) and provides a json with a more human readable interface, so API library creators can get all the methods and models without having to write them all by hand (which are a lot).\n\nAlso this helps the developers to update their libraries to the last updates easily!\n\n## API JSON\n\nIn this repository you can find two JSON files exported:\n\n- Minimum JSON: [https://raw.githubusercontent.com/rockneurotiko/telegram_api_json/master/exports/tg_api.json](https://raw.githubusercontent.com/rockneurotiko/telegram_api_json/master/exports/tg_api.json)\n  This json is the least bytes possible, perfect to be consumed by the libraries.\n\n- Pretty JSON: [https://raw.githubusercontent.com/rockneurotiko/telegram_api_json/master/exports/tg_api_pretty.json](https://raw.githubusercontent.com/rockneurotiko/telegram_api_json/master/exports/tg_api_pretty.json)\n  This json is the same as the minimum json, but prettify, so a human can read it better :smile:\n\n\nAlso, you can navigate in the json with some viewer, for example: [http://jsonviewer.stack.hu/](http://jsonviewer.stack.hu/)\n\n## Understand the JSON\n\nThe JSON have three root fields: `models`, `methods` and `generics`, each of this are a list with the defined data, let's see what can have every one of this.\n\n### Types\n\nBefore diving into the data structures, let's define the basic types and some of the modifiers you will find.\n\n#### Basic Types\n\n- int : Integer\n- str : String\n- bool : Boolean\n- float : Float\n- file : InputFile, you can see the definition of this type in the [telegram documentation](https://core.telegram.org/bots/api#inputfile), but basically it can be a file ID, URL or multipart/form-data\n\n#### Type modifiers\n\nIn the type definitions you will find basic types, telegram Model or some combination or variation, this are the variations available:\n\n- `or` modifiers. You will see all the possible types returned in a list, for example, an integer or a string is `[\"int\", \"str\"]`\n- List of some type, it will have the \"array\" word as the first element, for example, a list of `Update` is represented as `[\"array\", [\"Update\"]]`\n\nThe types can be any combination, for example, an array which can be an integer or a Update would be `[\"array\", [\"int\", \"Update\"]]`\n\n#### Param\n\nIn the following sections you will find references to `Param`, this is an object with the following fields:\n\n- name: String - Name of the parameter\n- description: String - Description of the parameter\n- type: T - [Type](#types) of the parameter, this can be any type that we've already covered or other models\n- optional: Boolean - If set to true, this parameter is optional\n\nExample of parameter, this is a parameters called `text` which is mandatory and the type is a string:\n\n``` json\n{\n    \"type\": [\n        \"str\"\n    ],\n    \"optional\": false,\n    \"name\": \"text\",\n    \"description\": \"Text of the message to be sent\"\n}\n```\n\n### Models\n\nEvery model item have two root fields:\n\n- name: String - This is the name of the model, for example `Update` or `User`\n- params: [Param] - The [parameters](#param) of the model\n\nExample of a model:\n\n``` json\n{\n    \"name\": \"MessageEntity\",\n    \"params\": [\n        {\n            \"type\": [\n                \"str\"\n            ],\n            \"optional\": false,\n            \"name\": \"type\",\n            \"description\": \"Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)\"\n        },\n        {\n            \"type\": [\n                \"int\"\n            ],\n            \"optional\": false,\n            \"name\": \"offset\",\n            \"description\": \"Offset in UTF-16 code units to the start of the entity\"\n        },\n        {\n            \"type\": [\n                \"int\"\n            ],\n            \"optional\": false,\n            \"name\": \"length\",\n            \"description\": \"Length of the entity in UTF-16 code units\"\n        },\n        {\n            \"type\": [\n                \"str\"\n            ],\n            \"optional\": true,\n            \"name\": \"url\",\n            \"description\": \"Optional. For “text_link” only, url that will be opened after user taps on the text\"\n        },\n        {\n            \"type\": [\n                \"User\"\n            ],\n            \"optional\": true,\n            \"name\": \"user\",\n            \"description\": \"Optional. For “text_mention” only, the mentioned user\"\n        }\n    ]\n}\n```\n\n### Methods\n\nThis are all the methods available in the API. This are the actions that an user can do.\n\nThis are the fields of the method object:\n\n- name: String - Name of the method, you should use it in the path when doing the request.\n- type: String - Can be `get` or `post`, this are the verb recommended to do the request, even though, you can implement it as you want.\n- return: T - [Type](#types) returned\n- params: [Param] - The [parameters](#param) of the method\n\nExample of a method:\n\nThis is the method `sendMessage`, which returns a `Message`, and have some mandatory and some optional parameters.\n\n``` json\n{\n    \"name\": \"sendMessage\",\n    \"type\": \"post\",\n    \"return\": [\n        \"Message\"\n    ],\n    \"params\": [\n        {\n            \"type\": [\n                \"int\",\n                \"str\"\n            ],\n            \"optional\": false,\n            \"name\": \"chat_id\",\n            \"description\": \"Unique identifier for the target chat or username of the target channel (in the format @channelusername)\"\n        },\n        {\n            \"type\": [\n                \"str\"\n            ],\n            \"optional\": false,\n            \"name\": \"text\",\n            \"description\": \"Text of the message to be sent\"\n        },\n        {\n            \"type\": [\n                \"str\"\n            ],\n            \"optional\": true,\n            \"name\": \"parse_mode\",\n            \"description\": \"Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.\"\n        },\n        {\n            \"type\": [\n                \"bool\"\n            ],\n            \"optional\": true,\n            \"name\": \"disable_web_page_preview\",\n            \"description\": \"Disables link previews for links in this message\"\n        },\n        {\n            \"type\": [\n                \"bool\"\n            ],\n            \"optional\": true,\n            \"name\": \"disable_notification\",\n            \"description\": \"Sends the message silently. Users will receive a notification with no sound.\"\n        },\n        {\n            \"type\": [\n                \"int\"\n            ],\n            \"optional\": true,\n            \"name\": \"reply_to_message_id\",\n            \"description\": \"If the message is a reply, ID of the original message\"\n        },\n        {\n            \"type\": [\n                \"InlineKeyboardMarkup\",\n                \"ReplyKeyboardMarkup\",\n                \"ReplyKeyboardRemove\",\n                \"ForceReply\"\n            ],\n            \"optional\": true,\n            \"name\": \"reply_markup\",\n            \"description\": \"Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.\"\n        }\n    ]\n}\n```\n\n### Generics\n\nThis are some types that, when specified as type, it can be any of the subtype of it.\n\nParameters of this objects:\n\n- name: String - Name of the parent type, this usually are not a model, but is used as type in some parameter or return field.\n- subtype: [String] - List of names of models which are subtype of this one.\n\nExample:\n\n``` json\n{\n    \"subtypes\": [\n        \"InputTextMessageContent\",\n        \"InputLocationMessageContent\",\n        \"InputVenueMessageContent\",\n        \"InputContactMessageContent\"\n    ],\n    \"name\": \"InputMessageContent\"\n}\n```\n\n## Development\n\nThis project is written in Elixir and uses Floki as HTML parser to extract the Telegram API informatiion.\n\nAll contributions are welcome, if you make a PR and changes some bug or add a feature that changes the final JSON, remember to execute the script `./export.sh` to generate the new JSON files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockneurotiko%2Ftelegram_api_json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frockneurotiko%2Ftelegram_api_json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frockneurotiko%2Ftelegram_api_json/lists"}