<metaproperty="description"content="Telegram has one of the most generous reward systems in the history of social media. Telegram channel owners can now receive 50% of the revenue from ads displayed in their channels. This page describes the methods used to withdraw channel ad revenue, as well as view detailed revenue stats.">
<metaproperty="og:title"content="Channel ad revenue">
<metaproperty="og:image"content="">
<metaproperty="og:description"content="Telegram has one of the most generous reward systems in the history of social media. Telegram channel owners can now receive 50% of the revenue from ads displayed in their channels. This page describes the methods used to withdraw channel ad revenue, as well as view detailed revenue stats.">
<divclass="dev_page_bread_crumbs"><ulclass="breadcrumb clearfix"><li><ahref="/api">API</a></li><iclass="icon icon-breadcrumb-divider"></i><li><ahref="/api/revenue">Channel ad revenue</a></li></ul></div>
<h1id="dev_page_title">Channel ad revenue</h1>
<divid="dev_page_content"><!-- scroll_nav -->
<p>Telegram has one of the <strong>most generous reward systems</strong> in the history of social media. Telegram channel owners can now receive <strong>50%</strong> of the revenue from ads displayed in their channels.</p>
<p>This page describes the methods used to withdraw channel ad revenue, as well as view detailed revenue stats. </p>
<p>See <ahref="/api/sponsored-messages">here»</a> for more info on how to display the ads in the client UI. </p>
<h3><aclass="anchor"href="#balance-and-transaction-history"id="balance-and-transaction-history"name="balance-and-transaction-history"><iclass="anchor-icon"></i></a>Balance and transaction history</h3>
<p>The channel ad revenue transaction history and balance may be fetched by channel admins if the <ahref="/constructor/channelFull">channelFull</a>.<code>can_view_revenue</code> flag is set and the <ahref="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
<p>The transaction history may be fetched using <ahref="/method/stats.getBroadcastRevenueTransactions">stats.getBroadcastRevenueTransactions</a>, which will return a vector of <ahref="/type/BroadcastRevenueTransaction">BroadcastRevenueTransaction</a> constructors, one of:</p>
<ul>
<li><ahref="/constructor/broadcastRevenueTransactionProceeds">broadcastRevenueTransactionProceeds</a> - Describes earnings from sponsored messages in a channel in some time frame</li>
<li><ahref="/constructor/broadcastRevenueTransactionWithdrawal">broadcastRevenueTransactionWithdrawal</a> - Describes a <ahref="#withdrawing-revenue">withdrawal</a> of ad earnings</li>
<li><ahref="/constructor/broadcastRevenueTransactionRefund">broadcastRevenueTransactionRefund</a> - Describes a refund for failed withdrawal of ad earnings</li>
</ul>
<p>The server will also emit an <ahref="/constructor/updateBroadcastRevenueTransactions">updateBroadcastRevenueTransactions</a> every time a new transaction is added: if the client is currently in the Monetization tab of the channel, this update should apply the new balances (contained in the update), and refresh the transaction list using <ahref="/method/stats.getBroadcastRevenueTransactions">stats.getBroadcastRevenueTransactions</a>. </p>
<p>Note that all balances and currency amounts and graph values are in the smallest unit of the chosen cryptocurrency (currently nanotons for TONs, so to obtain a value in USD divide the chosen amount by <code>10^9</code>, and then divide by <code>usd_rate</code>). </p>
<p>Channel ad revenue statistics may be fetched by channel admins if the <ahref="/constructor/channelFull">channelFull</a>.<code>can_view_revenue</code> flag is set and the <ahref="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
<p>Use <ahref="/method/stats.getBroadcastRevenueStats">stats.getBroadcastRevenueStats</a> to fetch statistics about the revenue earned from sponsored messages in a channel; the returned <ahref="/type/StatsGraph">StatsGraph</a> graphs can be rendered <ahref="/api/stats#graph-visualization">as described here»</a>. </p>
<p>Specifically:</p>
<ul>
<li><code>top_hours_graph</code> - Ad impressions graph</li>
<li><code>revenue_graph</code> - Ad revenue graph (in the smallest unit of the cryptocurrency in which revenue is calculated)</li>
<li><code>balances</code> - Current balance, current withdrawable balance and overall revenue</li>
<li><code>usd_rate</code> - Current conversion rate of the cryptocurrency (<strong>not</strong> in the smallest unit) in which revenue is calculated to USD</li>
</ul>
<p>Note that all balances and currency amounts and graph values are in the smallest unit of the chosen cryptocurrency (currently nanotons for TONs, so to obtain a value in USD divide the chosen amount by <code>10^9</code>, and then divide by <code>usd_rate</code>). </p>
<p>To withdraw a channel's ad revenue, invoke <ahref="/method/stats.getBroadcastRevenueWithdrawalUrl">stats.getBroadcastRevenueWithdrawalUrl</a>, passing the current account's <ahref="/api/srp">2FA password</a> as an <ahref="/type/InputCheckPasswordSRP">InputCheckPasswordSRP</a> constructor, generated <ahref="/api/srp">as specified here»</a>. </p>
<p>Only the channel owner can invoke this method, and only if the <ahref="/api/config#channel-revenue-withdrawal-enabled">channel_revenue_withdrawal_enabled field is equal to <code>true</code> »</a>. </p>
<p>The method will return a unique URL to a <ahref="https://fragment.com/ads">Fragment</a> page where the user will be able to specify and submit the address of the TON wallet where the funds will be sent. </p>
<h4><aclass="anchor"href="#disable-ads-on-the-channel"id="disable-ads-on-the-channel"name="disable-ads-on-the-channel"><iclass="anchor-icon"></i></a>Disable ads on the channel</h4>
<p>After reaching at least the boost level specified in the <ahref="/api/config#channel-restrict-sponsored-level-min"><code>channel_restrict_sponsored_level_min</code> »</a> config parameter, channel owners may disable ads on the channel for all users using <ahref="/method/channels.restrictSponsoredMessages">channels.restrictSponsoredMessages</a>. </p>
<p>If ads are disabled on the channel, the <ahref="/constructor/channelFull">channelFull</a>.<code>restricted_sponsored</code> flag will be set (owners only).</p></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.