{"id":26682492,"url":"https://github.com/tiennm99/export-telegram-group-members","last_synced_at":"2026-07-18T09:31:49.792Z","repository":{"id":230419968,"uuid":"779312469","full_name":"tiennm99/export-telegram-group-members","owner":"tiennm99","description":"Export Telegram group members to CSV using Telethon — admin auth required for full member visibility.","archived":false,"fork":false,"pushed_at":"2026-06-09T07:10:26.000Z","size":127,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-09T09:13:40.713Z","etag":null,"topics":["chat-export","csv-export","osint","python","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tiennm99.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-29T14:41:02.000Z","updated_at":"2026-06-09T07:10:31.000Z","dependencies_parsed_at":"2025-07-08T04:21:14.263Z","dependency_job_id":"f9fe2e7d-790a-481c-9961-9f765b7bd340","html_url":"https://github.com/tiennm99/export-telegram-group-members","commit_stats":null,"previous_names":["tiennm99/export-telegram-group-members"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tiennm99/export-telegram-group-members","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiennm99%2Fexport-telegram-group-members","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiennm99%2Fexport-telegram-group-members/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiennm99%2Fexport-telegram-group-members/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiennm99%2Fexport-telegram-group-members/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiennm99","download_url":"https://codeload.github.com/tiennm99/export-telegram-group-members/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiennm99%2Fexport-telegram-group-members/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35614490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-18T02:00:07.223Z","response_time":61,"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":["chat-export","csv-export","osint","python","telegram","telethon"],"created_at":"2025-03-26T08:20:07.550Z","updated_at":"2026-07-18T09:31:49.787Z","avatar_url":"https://github.com/tiennm99.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# export-telegram-group-members\n\nExport Telegram group members using Telethon — admin auth required for full member visibility. Session and export history are stored in **Redis**, so you can run the tool on any device from just a `.env` file (no re-login, no copying session/CSV files).\n\n## How to use\n\n1. Clone this repository:\n\n```bash\ngit clone https://github.com/tiennm99/export-telegram-group-members.git\n```\n\n2. Install requirements:\n\n```bash\npip install -r requirements.txt\n```\n\n3. Create a new Telegram app at [https://my.telegram.org](https://my.telegram.org) and get the `api_id` and `api_hash`.\n4. Create a free Redis database (e.g. [Upstash](https://upstash.com)) and copy its `rediss://` connection URL.\n5. Copy `.env.example` to `.env` and fill in `REDIS_URL`.\n6. Store Telegram config in Redis:\n\n```bash\npython configure.py\n```\n\n`configure.py` prompts for `api_id`, `api_hash`, phone, and group IDs.\n\n7. Crawl configured groups:\n\n```bash\npython crawl.py\n```\n\nThe first crawl asks for the Telegram login code once, then stores the session in Redis. Any later run — on any device pointed at the same Redis — reuses the Redis config and session, and **does not** prompt again.\n\n## Compare two crawls\n\nCompare membership changes for one group between two saved crawls with the\ngit-diff-style terminal output:\n\n```bash\npython compare.py \u003cgroup_id\u003e \u003ctime1\u003e \u003ctime2\u003e\n```\n\nIf `time1` and `time2` are omitted, the command compares the latest two crawls\nfor that group:\n\n```bash\npython compare.py \u003cgroup_id\u003e\n```\n\nIf `group_id` is also omitted, the command uses the first group in the stored\nconfiguration:\n\n```bash\npython compare.py\n```\n\n## Configuration\n\n| Variable | Description |\n|----------|-------------|\n| `REDIS_URL` | Redis connection string (`rediss://default:\u003cpassword\u003e@\u003chost\u003e:\u003cport\u003e`) |\n\nTelegram `api_id`, `api_hash`, `phone`, and `group_ids` are stored in Redis by `configure.py`.\n\n## How data is stored\n\nAll data lives in Redis under the `telegram-export` prefix. No key references another, so deleting any key can never corrupt another's state:\n\n```\ntelegram-export:config                         -\u003e JSON config:\n                                 { api_id, api_hash, phone, group_ids }\ntelegram-export:session                        -\u003e StringSession string (login)\ntelegram-export:group:\u003cgroup_id\u003e:\u003cyyyymmddhhmmss\u003e -\u003e one group's export as JSON:\n                                 { group_id, title, time,\n                                   members: [{ id, username, first_name, last_name }] }\n```\n\nEach group is written as its own key per run; all groups in one run share the same `yyyymmddhhmmss` timestamp. Read the history programmatically:\n\n```python\nfrom common import list_exports\n\nfor rec in list_exports():       # sorted by (time, group_id)\n    print(rec['time'], rec['group_id'], rec['title'], len(rec['members']), 'members')\n```\n\n## Rate limits and visibility notes\n\n- Telegram limits how fast you can fetch participants; large groups may take longer.\n- For **supergroups**, only admins can retrieve the full member list — regular members see a partial list or get an error.\n- For private groups where you are not a member, access will be denied.\n\n## Security\n\n- The session string grants **full access to your Telegram account**. It lives only in Redis (use a TLS `rediss://` URL) and is never written to disk or committed to git.\n- `.env` is git-ignored. Never commit your `REDIS_URL` or session string.\n\n## License\n\nApache-2.0 — see [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiennm99%2Fexport-telegram-group-members","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiennm99%2Fexport-telegram-group-members","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiennm99%2Fexport-telegram-group-members/lists"}