{"id":21424790,"url":"https://github.com/hidayathamir/get-telegram-group-data","last_synced_at":"2025-09-13T08:07:50.213Z","repository":{"id":161902250,"uuid":"408690578","full_name":"Hidayathamir/get-telegram-group-data","owner":"Hidayathamir","description":"With these project you can get data in csv file from your telegram group.","archived":false,"fork":false,"pushed_at":"2021-09-23T05:21:26.000Z","size":9227,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T20:47:04.573Z","etag":null,"topics":["bahasa-indonesia","data","python3","scrape","telegram","telethon"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hidayathamir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-09-21T04:47:51.000Z","updated_at":"2021-09-23T05:31:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"deb88ab3-ad26-4e7a-80df-4a3f2799e1c1","html_url":"https://github.com/Hidayathamir/get-telegram-group-data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Hidayathamir/get-telegram-group-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hidayathamir%2Fget-telegram-group-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hidayathamir%2Fget-telegram-group-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hidayathamir%2Fget-telegram-group-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hidayathamir%2Fget-telegram-group-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hidayathamir","download_url":"https://codeload.github.com/Hidayathamir/get-telegram-group-data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hidayathamir%2Fget-telegram-group-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274935979,"owners_count":25376836,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bahasa-indonesia","data","python3","scrape","telegram","telethon"],"created_at":"2024-11-22T21:24:31.381Z","updated_at":"2025-09-13T08:07:50.173Z","avatar_url":"https://github.com/Hidayathamir.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-telegram-group-data\n\n## What can this project do?\nWith these project you can get data in csv file from your telegram group. What kind of data? this data `id,reply_to_msg_id,text,first_name,last_name,username,phone,day_utc,month_utc,year_utc,hour_utc,minute_utc,second_utc`. [pythonID-58625-117249.csv](https://raw.githubusercontent.com/Hidayathamir/get-telegram-group-data/main/pythonID-0-58624.csv) is the example of data that I got from [pythonID](https://t.me/pythonID). \n\n\n## How to run this project\n1. Install `requirements.txt`.\n    ```\n    pip3 install -r requirements.txt\n    ```\n2. Open [my.telegram.org](https://my.telegram.org/) in your browser to get `API_ID` and `API_HASH`.\n3. In file `show_latest_id.py`\n    ```\n    client = TelegramClient(\"core4\", environ[\"api_id\"], environ[\"api_hash\"])\n    ```\n    use your `API_ID` and `API_HASH`. then\n    ```\n    with client:\n            client.loop.run_until_complete(\n                show_latest_id(target_username=\"pythonID\")\n            )\n    ```\n    change target_username to your group username (see on group info). If your group link is `https://t.me/pythonID` then `target_username=\"pythonID\"`.\n4. Run `show_latest_id.py`\n    ```\n    python3 show_latest_id.py\n    ```\n    session file `core4.session` will be created in your directory. Input your phone number and login code from telegram. After finish `show_latest_id.py` will print latest message id in your group.\n5. Do step 3 \u0026 4 with different session file name, use session file name `core1`, `core2`, and `core3`. Now you have 4 session file name.\n    ```\n    core1.session\n    core2.session\n    core3.session\n    core4.session\n    ```\n6. In `run.py`\n    ```\n    run_main_in_multiprocess(\n        session_name=[\"core1\", \"core2\", \"core3\", \"core4\"],\n        api_id=environ[\"api_id\"],\n        api_hash=environ[\"api_hash\"],\n        group_link=\"https://t.me/pythonID\",\n        min_id=0,\n        max_id=234500,\n    )\n    ```\n    `session_name` is your 4 session file. `api_id` \u0026 `api_hash` you got from step 1. `group_link` is your telegram group link (in step 2). `min_id=0` mean we will get data from the first message in your group. `max_id=234500` is `max_id` message (your latest message id in step 4) that we want to get, for me it's around 234429 so i round up to 234500.\n7. Run `run.py`\n    ```\n    python3 run.py\n    ```\n    now wait until we got all data that we want.\n    ![run.py](README_assets/runpy.png)\n    ![run.py](README_assets/runpy-finish.png)\n    now 4 csv file will be created in your directory. There you go, now you have your data.\n\nIn my case my cpu has 4 core. That's why I create 4 session file. If you don't understand about multiprocess in python, just keep it 4 like me, you will be oke.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidayathamir%2Fget-telegram-group-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhidayathamir%2Fget-telegram-group-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhidayathamir%2Fget-telegram-group-data/lists"}