<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: tgscope</title>
    <description>The latest articles on DEV Community by tgscope (@tgscope_629d565fb02dbb743).</description>
    <link>https://dev.to/tgscope_629d565fb02dbb743</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4198645%2F2f1d7e25-3f45-46ca-b0ae-4d17440da249.png</url>
      <title>DEV Community: tgscope</title>
      <link>https://dev.to/tgscope_629d565fb02dbb743</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tgscope_629d565fb02dbb743"/>
    <language>en</language>
    <item>
      <title>TGScope is hiring: four remote research contracts (search, network science, internet measurement, data journalism)</title>
      <dc:creator>tgscope</dc:creator>
      <pubDate>Sun, 15 Nov 2026 17:05:38 +0000</pubDate>
      <link>https://dev.to/tgscope_629d565fb02dbb743/tgscope-is-hiring-four-remote-research-contracts-search-network-science-internet-measurement-286d</link>
      <guid>https://dev.to/tgscope_629d565fb02dbb743/tgscope-is-hiring-four-remote-research-contracts-search-network-science-internet-measurement-286d</guid>
      <description>&lt;p&gt;&lt;a href="https://tgscope.io" rel="noopener noreferrer"&gt;TGScope&lt;/a&gt; is an independent R&amp;amp;D lab and Telegram search engine. We index 3 million public channels, run multilingual semantic search and an interactive map on top of them, and publish research on the Telegram ecosystem: channel networks, reach, post statistics and access restrictions.&lt;/p&gt;

&lt;p&gt;We have four project-based contracts open. Each runs for about two months, is fully remote and is paid by the hour.&lt;/p&gt;

&lt;h2&gt;
  
  
  Research Engineer, Multilingual Semantic Search
&lt;/h2&gt;

&lt;p&gt;The project: build a relevance benchmark for channel search in 6+ languages (query sets, judgments, nDCG and recall@k), measure retrieval quality by language and query type, and improve the fusion of semantic and lexical results.&lt;/p&gt;

&lt;p&gt;Stack: Python, Qdrant, multilingual-e5 on ONNX Runtime, PostgreSQL with pg_trgm, Reciprocal Rank Fusion.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tgscope.io/careers/research-engineer-semantic-search?utm_source=devto&amp;amp;utm_medium=jobboard" rel="noopener noreferrer"&gt;Details and application&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Research Scientist, Coordinated Networks &amp;amp; Information Integrity
&lt;/h2&gt;

&lt;p&gt;The project: build detection of coordinated channel networks across 3 million public Telegram channels, using forwards, shared links, mentions and near-duplicate posts, and validate it against known networks.&lt;/p&gt;

&lt;p&gt;Stack: Python, PostgreSQL, DuckDB, Parquet, Qdrant with multilingual-e5 embeddings, NetworkX or igraph.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tgscope.io/careers/research-scientist-coordinated-networks?utm_source=devto&amp;amp;utm_medium=jobboard" rel="noopener noreferrer"&gt;Details and application&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Internet Measurement Researcher (Censorship &amp;amp; Proxies)
&lt;/h2&gt;

&lt;p&gt;The project: design and run measurement of Telegram and MTProto proxy reachability by country: methodology, vantage points, probes, and a first measurement round. Our proxy checker performs a full MTProto handshake over FakeTLS and obfuscated2.&lt;/p&gt;

&lt;p&gt;Stack: Python (asyncio), MTProto, PostgreSQL, Cloudflare Workers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tgscope.io/careers/internet-measurement-researcher?utm_source=devto&amp;amp;utm_medium=jobboard" rel="noopener noreferrer"&gt;Details and application&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Journalist / Research Editor
&lt;/h2&gt;

&lt;p&gt;The project: find stories in our data on 3 million public Telegram channels together with our analysts, write four data stories with charts, and pitch them to newsrooms.&lt;/p&gt;

&lt;p&gt;Tools: SQL (PostgreSQL, DuckDB), Python with matplotlib.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://tgscope.io/careers/data-journalist-research-editor?utm_source=devto&amp;amp;utm_medium=jobboard" rel="noopener noreferrer"&gt;Details and application&lt;/a&gt;&lt;/p&gt;

</description>
      <category>hiring</category>
      <category>tgscope</category>
      <category>career</category>
      <category>python</category>
    </item>
    <item>
      <title>Telegram's 1,024 and 4,096 limits count UTF-16 code units, not characters</title>
      <dc:creator>tgscope</dc:creator>
      <pubDate>Thu, 12 Nov 2026 19:55:02 +0000</pubDate>
      <link>https://dev.to/tgscope_629d565fb02dbb743/telegrams-1024-and-4096-limits-count-utf-16-code-units-not-characters-290i</link>
      <guid>https://dev.to/tgscope_629d565fb02dbb743/telegrams-1024-and-4096-limits-count-utf-16-code-units-not-characters-290i</guid>
      <description>&lt;p&gt;If you write a Telegram bot or a posting tool, you have probably met the two numbers: 4,096 for a text message and 1,024 for a media caption. What the docs say less loudly is the unit. Telegram counts the length of the text after formatting is removed, in UTF-16 code units, so most emoji take two units each. We at TGscope read 21,813,641 posts with text and looked at what real authors do near those walls. The full study is in our &lt;a href="https://tgscope.io/rnd/telegram-post-length-character-limit" rel="noopener noreferrer"&gt;research on Telegram's character limit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This post is the developer's version: how to count correctly in JavaScript, Python and SQL, how to split long text without breaking it, and what the data shows at the edge.&lt;/p&gt;

&lt;h2&gt;
  
  
  The limits
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where&lt;/th&gt;
&lt;th&gt;Limit&lt;/th&gt;
&lt;th&gt;With Premium&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Text message&lt;/td&gt;
&lt;td&gt;4,096&lt;/td&gt;
&lt;td&gt;4,096&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Media caption&lt;/td&gt;
&lt;td&gt;1,024&lt;/td&gt;
&lt;td&gt;4,096&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Poll question&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Poll option&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two details matter for code. The count is taken on the text without formatting, so bold markers, link targets and similar markup do not add to it. And the unit is a UTF-16 code unit, not a character a person would see.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why "characters" is the wrong unit
&lt;/h2&gt;

&lt;p&gt;UTF-16 stores every code point from the Basic Multilingual Plane in one unit and every code point above it in two (a surrogate pair). Most emoji live above the plane, so one emoji is two units. A caption made of emoji runs into the 1,024 wall at half the visible length for a sender without Premium.&lt;/p&gt;

&lt;p&gt;The languages you are likely to use disagree about what "length" means:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"launch \u{1F680}"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c1"&gt;// the text "launch " and a rocket emoji&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;          &lt;span class="c1"&gt;// 9, UTF-16 units: this is what Telegram counts&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;     &lt;span class="c1"&gt;// 8, code points&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"launch \U0001F680"&lt;/span&gt;                    &lt;span class="c1"&gt;# the same text&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                              &lt;span class="c1"&gt;# 8, code points&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"utf-16-le"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;     &lt;span class="c1"&gt;# 9, UTF-16 units&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In JavaScript &lt;code&gt;str.length&lt;/code&gt; is already correct. In Python &lt;code&gt;len(s)&lt;/code&gt; is not, so encode to UTF-16 little endian (no byte order mark) and divide by two. If your text sits in DuckDB or a similar engine and &lt;code&gt;length&lt;/code&gt; counts code points, add one for each code point above the plane. This is the expression we used on the whole corpus:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="nb"&gt;length&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;length&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;regexp_replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'[^\x{10000}-\x{10FFFF}]'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'g'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The inner part keeps only the characters outside the plane, and the sum counts each of them twice. Count the text as Telegram will store it: if you build the message with HTML or Markdown entities, measure the plain text, not the markup.&lt;/p&gt;

&lt;h2&gt;
  
  
  What real posts look like
&lt;/h2&gt;

&lt;p&gt;Most posts are far from the limits. The median text-only post is 183 characters long and the median caption is 250. Our sample covers the last 100 posts of 256,822 public channels, read from the public web version of each channel between October 26 and November 1, 2026.&lt;/p&gt;

&lt;p&gt;Near the caption limit the picture changes. Exactly 1,024 characters is the length of 11,034 captions. At 1,023 there are 7,717, and the average over lengths 1,025 to 1,029 is 4,209. Authors without Premium write until the counter stops them and then trim to the limit.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F72tg89e94cbpqqctz42d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F72tg89e94cbpqqctz42d.png" alt="caption counts at every exact length from 990 to 1,060: a peak at 1,024 and a cliff right after it" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The wall is soft for some people. 7.5% of captions are longer than 1,024, which is only possible with Premium. 45.1% of active channels with at least 10 captions posted at least one such caption. If your tool assumes 1,024 for every user, a good share of your users will hit your limit before Telegram's.&lt;/p&gt;

&lt;p&gt;The text limit shows the same shape in smaller numbers. Exactly 4,096 characters is the length of 1,278 text posts, against about 382 per length just below. In our count 10,367 posts are longer than 4,096. That is a measurement artifact: the web version shows some formatting, such as hidden link targets or quotes, differently from the app, so our count can drift by a few dozen units. If you measure text scraped from the web page, expect the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Splitting long text safely
&lt;/h2&gt;

&lt;p&gt;When a post does not fit, split it on a paragraph boundary, and never inside a surrogate pair. A cut between the two halves of an emoji produces a broken character on both sides.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;splitByParagraph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;para&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"\n\n"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;"\n\n"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;para&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;para&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;para&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cut&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mh"&gt;0xd800&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mh"&gt;0xdbff&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt; &lt;span class="o"&gt;-=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cut&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cut&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;parts&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;length&lt;/code&gt; and &lt;code&gt;slice&lt;/code&gt; in JavaScript work on UTF-16 units, so the limit passed in is already in the right unit. The check on the last unit moves the cut back by one if it would land between a high and a low surrogate.&lt;/p&gt;

&lt;p&gt;For captions the practical pattern is different. Send the media with a short caption that fits 1,024 and put the long text in a separate message, where the limit is 4,096 for everyone. That avoids the Premium question entirely.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does length matter for reach
&lt;/h2&gt;

&lt;p&gt;Authors often shorten posts for fear of losing readers. Inside a channel the data does not support that. We divided each post's views by the median of its own channel, so size and language cancel out. Posts with text get 1× of the typical views at every length, including posts over 2,000 characters. Posts without text get 0.98×. Length is a constraint of the platform, not a lever on views. How the other numbers of the corpus look is in the &lt;a href="https://tgscope.io/rnd/telegram-post-statistics" rel="noopener noreferrer"&gt;Telegram post statistics&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this does not cover
&lt;/h2&gt;

&lt;p&gt;The numbers describe public channels with a web page, the largest in our index, and the text as the web version renders it. Premium status is inferred from caption length, not observed. The limits themselves are Telegram's; if you work with the Bot API, check the current documentation before relying on any of them. Our other free checkers are listed on the &lt;a href="https://tgscope.io/tools" rel="noopener noreferrer"&gt;TGscope tools page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>telegram</category>
      <category>tgscope</category>
    </item>
    <item>
      <title>Geocoding 4,000 Telegram channels to Ukrainian cities without labelled data</title>
      <dc:creator>tgscope</dc:creator>
      <pubDate>Wed, 11 Nov 2026 20:00:33 +0000</pubDate>
      <link>https://dev.to/tgscope_629d565fb02dbb743/geocoding-4000-telegram-channels-to-ukrainian-cities-without-labelled-data-bfk</link>
      <guid>https://dev.to/tgscope_629d565fb02dbb743/geocoding-4000-telegram-channels-to-ukrainian-cities-without-labelled-data-bfk</guid>
      <description>&lt;p&gt;Telegram channels have no location field that anyone fills in. If you want a map of local channels, you have names, usernames, tags and descriptions, and a gazetteer. We built exactly that for Ukraine: 4,076 channels placed in 277 cities and towns, with no hand-labelled training set. This post is about the part that took the time, which was not matching city names but throwing out the false matches.&lt;/p&gt;

&lt;p&gt;The result is the &lt;a href="https://tgscope.io/map/ukraine" rel="noopener noreferrer"&gt;map of Telegram channels in Ukraine&lt;/a&gt;. Opening it downloads about 234 KB of static files and makes zero API requests.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm6osoxab2yei9cq5kdpx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm6osoxab2yei9cq5kdpx.png" alt="the finished map: one circle per city, sized by channel count" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The inputs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A gazetteer.&lt;/strong&gt; GeoNames for places with every alternate spelling, in Ukrainian, Russian, English and a few other languages. Natural Earth admin-1 regions for the country outline, by ISO code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Channel text.&lt;/strong&gt; Title, username, tags and description, plus the channel's own &lt;code&gt;geo&lt;/code&gt; field where we have one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings.&lt;/strong&gt; Each channel already had a meaning vector from a multilingual model (we built it for semantic search). The geo map only covers channels with a vector, which is a subset of everything we index.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A city is any GeoNames place above a population threshold, plus every regional and district centre regardless of size. District names inside a big city are merged into that city.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: generate candidates, generously
&lt;/h2&gt;

&lt;p&gt;For every channel we look for every spelling of every place in its text. That includes case endings (Kharkiv, Kharkova, Kharkivskyi), adjectives with the -sk and -skyi endings, and Latin transliterations in usernames. This step is intentionally loose: it should miss nothing, and it produces a lot of nonsense.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: reject the nonsense
&lt;/h2&gt;

&lt;p&gt;Three classes of false match did most of the damage. Each is a normal word or name that happens to equal a place name:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;human&lt;/code&gt; matches Uman, a city, through a Cyrillic transliteration.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;український&lt;/code&gt; ("Ukrainian") matches Ukrainsk, a small town.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Сергей&lt;/code&gt;, a common first name, matches Sergo, a town.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No list of stop words would have kept up, so the filter works on statistics:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mention frequency versus population.&lt;/strong&gt; If a spelling is mentioned in far more channels than a place of that population could plausibly have local channels, it is a common word. Spellings that fail this test are accepted only on an exact match in the title or username, with high classifier confidence and a sign that the channel is Ukrainian.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Namesakes in neighbouring countries.&lt;/strong&gt; Using the list of cities above 15,000, a place is flagged as a namesake if a city of the same name abroad is at least 0.3 times its size. Those candidates need a stronger "this channel is Ukrainian" signal: language, the &lt;code&gt;geo&lt;/code&gt; field, or Ukrainian-only letters such as the ones in "і" and "ї".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Two classifiers on the embeddings.&lt;/strong&gt; One predicts "this channel is about a specific place" (positives: channels with the place in the title; negatives: random channels). The other predicts "this channel is Ukrainian" against channels from neighbouring countries. Both are trained on labels we already have, so no manual labelling is involved.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every rejection has a reason code: word, multiple matches, foreign, ambiguous, semantic, category. The build prints counts per reason, and a report per city. We looked at the summaries, not at every channel. The usual red flags were a small town with an implausibly large number of channels, a city from a neighbouring country, a person's name, and national media that fell into the capital without ever mentioning it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Edge cases that needed config, not code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Regions that contain contested territory.&lt;/strong&gt; The "own country" classifier is switched off there, because the channels often carry another country's &lt;code&gt;geo&lt;/code&gt; and language. Borders follow ISO codes, which is why Crimea and Sevastopol are counted in this map.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Whole-region channels.&lt;/strong&gt; A channel about Crimea in general should not become a channel in Simferopol. It gets its own circle.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Old and colloquial names.&lt;/strong&gt; Aliases are matched only exactly or with a case ending.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Short names.&lt;/strong&gt; Names of four letters or fewer in small towns are skipped, since they collide with ordinary words.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Making the page cheap
&lt;/h2&gt;

&lt;p&gt;The build writes tiles with channel names in a single small file. For Ukraine that is one tile of 88 KB gzipped, so the page needs no API call to open. A channel card costs one request, on click. Tile paths include a version and are served &lt;code&gt;immutable&lt;/code&gt;, so a new layout is a new folder, not an overwrite.&lt;/p&gt;

&lt;p&gt;Rendering had one lesson. Drawing text outlines and icon rings for every label on every frame cost 18 ms of JavaScript per frame when zoomed into Kyiv. Rendering each label once into an &lt;code&gt;ImageBitmap&lt;/code&gt; and drawing from a cache cut that to 3.9 ms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Doing it again for other countries
&lt;/h2&gt;

&lt;p&gt;The same pipeline, driven by a per-country config file, now covers Uzbekistan (3,784 channels in 135 cities) and Iran (5,253 channels in 333 cities). What changed was the config: morphology (Uzbek Latin and Cyrillic endings, Persian plural suffixes), accepted scripts, and the list of generic words like "province" and "shahr" to strip from names.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr3amziokf8mluzzbi2nr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr3amziokf8mluzzbi2nr.png" alt="the Uzbekistan map card" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The garbage in alternate names grew with each country: ordinal province names, Soviet-era city names, common words and personal names, even neighbouring cities' names. All of that goes to a per-country exclusion list. For Iran we also had to merge Arabic and Persian letter variants and turn zero-width non-joiners into spaces before matching. The &lt;a href="https://tgscope.io/map/iran" rel="noopener noreferrer"&gt;map of Iran&lt;/a&gt; is the largest of the three.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we would tell someone starting this
&lt;/h2&gt;

&lt;p&gt;Generate candidates loosely and filter on rates, not on lists. Compare how often a spelling is mentioned with how many local channels its population could support, and check the top-20 suspects in every build. Keep a per-country config file for everything that is a judgment call. And measure the frame before you optimise the renderer.&lt;/p&gt;

</description>
      <category>python</category>
      <category>nlp</category>
      <category>datascience</category>
      <category>geospatial</category>
    </item>
    <item>
      <title>Decoding Telegram MTProto proxy links</title>
      <dc:creator>tgscope</dc:creator>
      <pubDate>Wed, 11 Nov 2026 19:59:12 +0000</pubDate>
      <link>https://dev.to/tgscope_629d565fb02dbb743/decoding-telegram-mtproto-proxy-links-1p4f</link>
      <guid>https://dev.to/tgscope_629d565fb02dbb743/decoding-telegram-mtproto-proxy-links-1p4f</guid>
      <description>&lt;p&gt;A Telegram proxy link is a small URL with three fields, and most "the proxy does not connect" problems come from one of those fields being wrong. This post takes a link apart, explains the three secret types you will meet, and shows what a snapshot of 200 working proxies looks like. If you would rather paste a link and get a verdict, there is a &lt;a href="https://tgscope.io/tools/telegram-proxy-link-checker" rel="noopener noreferrer"&gt;Telegram proxy link checker&lt;/a&gt; that does the parsing in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  The anatomy of a link
&lt;/h2&gt;

&lt;p&gt;An MTProto proxy link comes in two spellings that carry the same query string:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tg://proxy?server=203.0.113.10&amp;amp;port=8443&amp;amp;secret=dd0123456789abcdef0123456789abcdef
https://t.me/proxy?server=203.0.113.10&amp;amp;port=8443&amp;amp;secret=dd0123456789abcdef0123456789abcdef
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(The address is from the documentation range; the secret is a placeholder.)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;server&lt;/code&gt; is an IP address or a domain name.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;port&lt;/code&gt; is a TCP port, 1 to 65535.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;secret&lt;/code&gt; is a hex string (or base64) that the client and the proxy share. It is what makes the proxy an MTProto proxy rather than an open relay, and it decides how the traffic is disguised.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our checker also accepts SOCKS5 links, which carry a username and password instead of a secret, and the bare &lt;code&gt;server:port:secret&lt;/code&gt; form.&lt;/p&gt;

&lt;p&gt;Parsing it takes a few lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;urllib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parse&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;urlparse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parse_qs&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_proxy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;link&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;parse_qs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;urlparse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;link&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"server"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"port"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;secret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"secret"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"server"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"secret"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The three secret types
&lt;/h2&gt;

&lt;p&gt;After the transport prefix, the secret is 16 bytes, which is 32 hex characters. The prefix tells you the type:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Secret&lt;/th&gt;
&lt;th&gt;Looks like&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;plain&lt;/td&gt;
&lt;td&gt;32 hex characters&lt;/td&gt;
&lt;td&gt;The original format: the traffic is obfuscated but does not imitate anything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;dd&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;dd&lt;/code&gt; + 32 hex&lt;/td&gt;
&lt;td&gt;Adds random padding to packet sizes to make length analysis harder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FakeTLS (ee)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;ee&lt;/code&gt; + 32 hex + the domain in hex&lt;/td&gt;
&lt;td&gt;The connection looks like a TLS handshake to a real website, named in the secret&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For FakeTLS the tail of the secret is hex-encoded text. Decode it and you get the site the proxy pretends to be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;fake_tls_domain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;secret_hex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;secret_hex&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;startswith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ee"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;tail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromhex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;secret_hex&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tail&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ascii"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"replace"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The checker does the same and shows the disguise domain next to the server and port. Secrets can also arrive base64-encoded, so a decoder should try both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a proxy does not connect
&lt;/h2&gt;

&lt;p&gt;The problems we see come back to the link itself more often than to the server:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A cut-off secret.&lt;/strong&gt; Copying from a chat sometimes drops the last characters, so the secret is no longer a whole number of bytes. A quick length check catches it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A missing or wrong port.&lt;/strong&gt; An empty &lt;code&gt;port=&lt;/code&gt; or a value outside the valid range.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A server that is not a valid address.&lt;/strong&gt; A stray character, a trailing dot or a space from a line break.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A dead server.&lt;/strong&gt; The link is well-formed, but the proxy has stopped. This one a parser cannot tell you, only a real connection test can.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our checker flags the first three before you open the link. It does not connect to the proxy from the browser, because a web page cannot open the kind of connection MTProto needs, and the link you paste is not sent to us. A longer list of symptoms and fixes is in &lt;a href="https://tgscope.io/telegram-proxy/errors" rel="noopener noreferrer"&gt;the proxy errors guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What 200 working proxies look like
&lt;/h2&gt;

&lt;p&gt;To see what works in practice we took the 200 best-ranked proxies from our checker on 9 October 2026. Every one had answered at least 90% of checks. This is the best of what circulates, not the average.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hosting is concentrated.&lt;/strong&gt; 57% ran in Germany and 50.5% with a single provider. 29.5% ran on servers inside Iran, where Telegram has been blocked since 2018.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ports.&lt;/strong&gt; Only 17.5% used 443. 53.5% used 8443, and 76% were on the alternative HTTPS ports 8443, 8880, 2096 and 2053.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secrets.&lt;/strong&gt; 57% plain, 38% dd, 5% FakeTLS. None of the 59 Iranian-hosted proxies used FakeTLS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Names.&lt;/strong&gt; 39 were published under a domain instead of an IP, and 27 of those names carried an "ir" label. A random subdomain costs nothing, so when one name lands on a block list the operator publishes another one pointing at the same server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The practical reading: a proxy on a port that web traffic already uses and a padded secret is the common shape, and FakeTLS stays rare because it needs a believable domain and ideally port 443. The full tables are in our proxy statistics write-up.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ux7lpzy6ocg43mz2gqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9ux7lpzy6ocg43mz2gqw.png" alt="pasting a link into the proxy link checker" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A note on safety
&lt;/h2&gt;

&lt;p&gt;Your messages stay encrypted the whole way, so a proxy owner cannot read them, but they can see your IP address. Treat a free proxy as a way to keep Telegram reachable, not as privacy. If you need a fresh server, the &lt;a href="https://tgscope.io/proxies" rel="noopener noreferrer"&gt;live list of free MTProto proxies&lt;/a&gt; is rechecked every 20 minutes with a real MTProto handshake, not a ping.&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>networking</category>
      <category>security</category>
      <category>python</category>
    </item>
    <item>
      <title>How we date Telegram channels from their numeric IDs</title>
      <dc:creator>tgscope</dc:creator>
      <pubDate>Wed, 11 Nov 2026 19:57:37 +0000</pubDate>
      <link>https://dev.to/tgscope_629d565fb02dbb743/how-we-date-telegram-channels-from-their-numeric-ids-5i5</link>
      <guid>https://dev.to/tgscope_629d565fb02dbb743/how-we-date-telegram-channels-from-their-numeric-ids-5i5</guid>
      <description>&lt;p&gt;Telegram does not show when a channel was created. It does show a numeric ID, and that number turns out to carry a date, as long as you know how Telegram hands IDs out. We mapped 15 ID blocks used between 2015 and 2025 and built a lookup from them. Here is how the dating works, where it breaks, and what the May 2024 jump past 2³¹ means for your code.&lt;/p&gt;

&lt;p&gt;If you only want the result, the &lt;a href="https://tgscope.io/tools/telegram-channel-creation-date" rel="noopener noreferrer"&gt;Telegram channel creation date checker&lt;/a&gt; takes a username, a t.me link or a numeric ID and returns the period the channel was born in. The rest of this post is the method.&lt;/p&gt;

&lt;h2&gt;
  
  
  IDs were sequential, then they were not
&lt;/h2&gt;

&lt;p&gt;Until late 2017 Telegram issued channel IDs in order, so a bigger ID meant a younger channel. Since November 2017 each new channel gets a random number from a block of 100 to 250 million IDs, and every few months Telegram moves on to a fresh block.&lt;/p&gt;

&lt;p&gt;That changes what an ID can tell you. Inside a block the order is random, so the ID cannot give you a day. It can give you the block, and a block has an opening and a closing date.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding block edges without a creation date
&lt;/h2&gt;

&lt;p&gt;Telegram does not expose creation dates, so we needed a proxy. The one we used: a channel cannot post before it exists. Take tens of thousands of channels with neighbouring IDs and look at their last posts. Many channels are abandoned within days of being created, so the earliest last posts in a group of neighbouring IDs sit close to the moment those IDs were first issued.&lt;/p&gt;

&lt;p&gt;Plot ID against last-post date and you get a staircase. Each step is a block opening, and the area below it is empty. We used 247,850 channels whose posts we could date, and only 140 of them (0.06%) fall below the steps.&lt;/p&gt;

&lt;p&gt;The procedure, in short:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Split the ID range into 2-million bins.&lt;/li&gt;
&lt;li&gt;Look for places where the share of channels that went silent before a given date drops to zero from one bin to the next.&lt;/li&gt;
&lt;li&gt;Refine the edges at 0.5-million resolution.&lt;/li&gt;
&lt;li&gt;Define a block's opening date as the start of the first dense run of last posts, meaning at least three channels in a 30-day window for old blocks, or 0.15% of the block's dated channels for newer ones.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Dates are accurate to days for blocks opened since 2021 and rough before that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm80yb26w8wb0fp1y5ljh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm80yb26w8wb0fp1y5ljh.png" alt="how to read a channel's age from its ID" width="800" height="1174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Checking that the order really is random
&lt;/h2&gt;

&lt;p&gt;A correlation test shows the switch. Among channels that went silent while their block was still being filled, we compared the order of IDs with the order of last posts (Spearman rank correlation):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;first block (Sep 2015 to Jan 2017): 0.78&lt;/li&gt;
&lt;li&gt;2017: 0.23&lt;/li&gt;
&lt;li&gt;every block since Nov 2017: between -0.06 and 0.10&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Near 1 means IDs were issued in order, near 0 means the ID order says nothing about age.&lt;/p&gt;

&lt;p&gt;Another check: are blocks used one at a time, or several in parallel? If one block is active, the rate at which its channels go silent should drop when the next block opens, because the supply of short-lived new channels stops. It does. In the block that opened in May 2024, 24 of every 1,000 dated channels went silent in August 2024, 12 in September and 8 in October. One exception: from October 2018 to June 2021 Telegram drew from two blocks together, so an ID between 1.15B and 1.40B only tells you "somewhere between November 2017 and June 2021".&lt;/p&gt;

&lt;p&gt;Sanity checks against known channels also land where they should. The Telegram News channel and the founder's personal channel are both in the first block, which opened on the day Telegram launched channels, September 22, 2015.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 2³¹ problem
&lt;/h2&gt;

&lt;p&gt;One block starts at exactly 2,147,483,648, which is 2³¹, one more than a signed 32-bit integer can hold. It opened on or shortly before May 16, 2024. Of 430 dated channels with IDs in the 3 million just below that number, 22 went silent before May 2024. Of the 353 just above, 1 did.&lt;/p&gt;

&lt;p&gt;What breaks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;

&lt;span class="n"&gt;raw_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2_200_000_000&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That prints &lt;code&gt;-2094967296&lt;/code&gt;. Code that reads raw channel IDs from the client API and stores them in a signed 32-bit column or variable overflows on every channel and supergroup created since May 2024. Typical places are a Postgres &lt;code&gt;integer&lt;/code&gt; column, a Java &lt;code&gt;int&lt;/code&gt;, or an old SQLite schema.&lt;/p&gt;

&lt;p&gt;What does not break: the Bot API. It never exposed the raw value. It shows channels as &lt;code&gt;-100&lt;/code&gt; followed by the ID, a number that has always needed 64 bits, so most bots were unaffected. Both forms work as input to a lookup like ours; just keep the type &lt;code&gt;bigint&lt;/code&gt; end to end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Blocks are being used up faster
&lt;/h2&gt;

&lt;p&gt;Blocks do not last a fixed time. The 200-million block that opened in October 2021 lasted 355 days. The 200-million blocks of 2025 lasted 89, 79 and 52 days. If Telegram retires a block when a fixed share of its numbers is taken, channels and supergroups were being created about seven times faster in August 2025 than in 2022. We cannot check that assumption from outside: a block could also be retired early or filled more thinly.&lt;/p&gt;

&lt;p&gt;Here are a few of the blocks:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Block&lt;/th&gt;
&lt;th&gt;Opened&lt;/th&gt;
&lt;th&gt;Days in use&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.00B to 1.10B&lt;/td&gt;
&lt;td&gt;Sep 22, 2015&lt;/td&gt;
&lt;td&gt;495&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1.60B to 1.80B&lt;/td&gt;
&lt;td&gt;Oct 7, 2021&lt;/td&gt;
&lt;td&gt;355&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2^31 to 2.25B&lt;/td&gt;
&lt;td&gt;May 16, 2024&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.50B to 2.70B&lt;/td&gt;
&lt;td&gt;Feb 16, 2025&lt;/td&gt;
&lt;td&gt;89&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.90B to 3.10B&lt;/td&gt;
&lt;td&gt;Aug 4, 2025&lt;/td&gt;
&lt;td&gt;52&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The full table with all 15 blocks is in our write-up, &lt;a href="https://tgscope.io/rnd/telegram-channel-id-clock" rel="noopener noreferrer"&gt;the Telegram channel ID clock&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the date is and is not
&lt;/h2&gt;

&lt;p&gt;The result is a period, not a day. It is the season a channel was born in, and it is only as good as the block table. Renamed channels are where this helps most: a channel's name and picture can be copied in a minute, an ID cannot. For example, 23 of 79 channels carrying a tap-to-earn game's name had IDs from blocks older than the game's own channel, so they were created earlier and renamed later.&lt;/p&gt;

&lt;p&gt;A minimal lookup is a sorted list of block start IDs and a binary search:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;bisect&lt;/span&gt;

&lt;span class="n"&gt;starts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1_000_000_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1_100_000_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1_150_000_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1_500_000_000&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;labels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Sep 2015"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Jan 2017"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Nov 2017"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"Jun 2021"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;block_of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;channel_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;bisect&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bisect_right&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;starts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;channel_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;labels&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bear in mind the overlap between 1.15B-1.40B and 1.40B-1.50B, and strip the &lt;code&gt;-100&lt;/code&gt; prefix from Bot API IDs before looking anything up.&lt;/p&gt;

&lt;p&gt;The method and the full block table are described in the &lt;a href="https://tgscope.io/rnd/telegram-channel-id-clock" rel="noopener noreferrer"&gt;ID clock research&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>telegram</category>
      <category>datascience</category>
      <category>python</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How we open a map of 3 million Telegram channels with a 90 KB download</title>
      <dc:creator>tgscope</dc:creator>
      <pubDate>Wed, 21 Oct 2026 15:32:54 +0000</pubDate>
      <link>https://dev.to/tgscope_629d565fb02dbb743/how-we-open-a-map-of-3-million-telegram-channels-with-a-90-kb-download-1o35</link>
      <guid>https://dev.to/tgscope_629d565fb02dbb743/how-we-open-a-map-of-3-million-telegram-channels-with-a-90-kb-download-1o35</guid>
      <description>&lt;p&gt;At TGScope we built a semantic map of 3 million public Telegram channels. Channels that talk about similar things sit next to each other, so the whole ecosystem is visible at once: from big regions like crypto or news down to tiny niches.&lt;/p&gt;

&lt;p&gt;Try it: tgscope.io/map&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft85wnuhxoobdcpt6wvvz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft85wnuhxoobdcpt6wvvz.jpg" alt="The whole map: color is the category, dot size is the subscriber count" width="800" height="650"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We had one hard requirement: the map has to be usable within a second, on any device, phones included. That rules out the obvious approach of shipping every point to the browser. This post is about what we did instead.&lt;/p&gt;

&lt;p&gt;The first-frame budget&lt;br&gt;
To draw the first frame the browser fetches three files:&lt;/p&gt;

&lt;p&gt;File    Size&lt;br&gt;
manifest.json (tile index, categories, languages)   1.3 KB&lt;br&gt;
labels.json (area names for three zoom levels)  59 KB&lt;br&gt;
root tile (the largest channels)    32 KB&lt;br&gt;
About 90 KB in total. Everything else streams in as you zoom.&lt;/p&gt;

&lt;p&gt;Quadtree tiles, like a slippy map&lt;br&gt;
The points are cut into a quadtree, the same idea OpenStreetMap uses for its tiles. Each tile holds at most 4,096 channels. The root tile holds the biggest channels, which is enough to show the overall shape of the map. Smaller channels live in deeper tiles, and the client only requests tiles that intersect the viewport and sit no more than two levels below the current zoom. New tiles fade in, so nothing pops.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8pb6oio86ugj91n89fd3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8pb6oio86ugj91n89fd3.jpg" alt=" " width="800" height="500"&gt;&lt;/a&gt;&lt;br&gt;
8 bytes per channel&lt;/p&gt;

&lt;p&gt;A tile is a flat binary buffer. No JSON, no names, no descriptions:&lt;/p&gt;

&lt;p&gt;Bytes   Field&lt;br&gt;
0–1   x inside the tile, uint16&lt;br&gt;
2–3   y inside the tile, uint16&lt;br&gt;
4   category&lt;br&gt;
5   language&lt;br&gt;
6   subscriber tier (7 tiers, 1K to 3M+)&lt;br&gt;
7   padding&lt;br&gt;
A full tile is 32 KB, and decoding it is just reading typed arrays:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;u16&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint16Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;u8&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;tx&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;u16&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;65535&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ty&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;u16&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;65535&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;cat&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;u8&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Names stay on the server&lt;br&gt;
A dot only knows its position, category, language and size. Which channel is behind it is the server's business: the client asks when you hover or click, and at deep zoom it requests names for the visible area in one batch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Folk0g0u47fssg0ki4j8e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Folk0g0u47fssg0ki4j8e.jpg" alt="Click a dot and the server returns the channel card" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This keeps tiles tiny, and as a side effect the catalog can't be downloaded as one file. To collect it you would have to crawl the whole map at maximum zoom.&lt;/p&gt;

&lt;p&gt;WebGL 2: one draw call per tile&lt;br&gt;
Each tile is uploaded to the GPU once and drawn with a single gl.drawArrays(gl.POINTS, ...). Colors, sizes and the language filter are computed in the vertex shader:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u_lang&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;lang&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;u_lang&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;88&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mo"&gt;07&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;u_alpha&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;gl_PointSize&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;u_sizes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;u_dpr&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switching the language filter doesn't touch the data at all. We change one uniform, and every dot on the screen repaints in the same frame.&lt;/p&gt;

&lt;p&gt;Warm start&lt;br&gt;
Channel pages on TGScope show a small preview of the map. While you look at it, the map code, the manifest and the labels are already downloading in the background. By the time you click "open map", almost everything is in the cache.&lt;/p&gt;

&lt;p&gt;What's on the map&lt;br&gt;
3 million public channels, 24 categories, 24 languages&lt;br&gt;
three levels of area labels: 25 regions, 250 topics, 2,500 sub-topics&lt;br&gt;
search by meaning: describe what you want instead of guessing a channel name&lt;br&gt;
a language filter, a channel card on click, and a shareable link to any spot on the map&lt;br&gt;
The layout itself comes from a multilingual embedding model and UMAP, but that's a topic for another post.&lt;/p&gt;

&lt;p&gt;Open the map and tell me in the comments what you'd change in the tile format. I'm curious whether anyone has tried something smaller than 8 bytes per point.&lt;/p&gt;

</description>
      <category>webgl</category>
      <category>ai</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
