プラットフォームインテリジェンス API
Telegram API
テレグラムは、メッセージ、チャンネル、グループ、音声ノート、ボット、メディアを共有する10億以上の毎月のアクティブユーザーを持ち、直接配信、コミュニティ管理、迅速なニュースオーディエンスにとって重要です。
APIリファレンス バージョン: 1.0.0 7 エンドポイント 認証
ベース URL
https://api.pressmonitor.com/telegram/v1 認証
すべてのリクエストはベアラートークン認証を使用します。すべての呼び出しにAuthorizationヘッダーを追加してください。
Authorization: Bearer YOUR_TOKEN GET
/bot-info Bot情報
Bot Info
パラメータ
| 名前 | タイプ | 場所 | 必須 | 説明 |
|---|---|---|---|---|
| username | string | query | はい | ユーザー名 |
コード例
curl --request GET \ --url 'https://api.pressmonitor.com/telegram/v1/bot-info?username=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/telegram/v1/bot-info?username=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/telegram/v1/bot-info" querystring = {"username":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/telegram/v1/bot-info?username=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/telegram/v1/bot-info?username=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); レスポンス
200 成功
GET
/channel-info チャンネル情報
Channel Info
パラメータ
| 名前 | タイプ | 場所 | 必須 | 説明 |
|---|---|---|---|---|
| username | string | query | はい | ユーザー名 |
コード例
curl --request GET \ --url 'https://api.pressmonitor.com/telegram/v1/channel-info?username=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/telegram/v1/channel-info?username=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/telegram/v1/channel-info" querystring = {"username":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/telegram/v1/channel-info?username=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/telegram/v1/channel-info?username=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); レスポンス
200 成功
GET
/get-messages メッセージ取得
Get Messages
パラメータ
| 名前 | タイプ | 場所 | 必須 | 説明 |
|---|---|---|---|---|
| username | string | query | はい | ユーザー名 |
| offset | string | query | いいえ | オフセット |
コード例
curl --request GET \ --url 'https://api.pressmonitor.com/telegram/v1/get-messages?username=SOME_STRING_VALUE&offset=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/telegram/v1/get-messages?username=SOME_STRING_VALUE&offset=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/telegram/v1/get-messages" querystring = {"username":"SOME_STRING_VALUE","offset":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/telegram/v1/get-messages?username=SOME_STRING_VALUE&offset=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/telegram/v1/get-messages?username=SOME_STRING_VALUE&offset=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); レスポンス
200 成功
GET
/group-info グループ情報
Group Info
パラメータ
| 名前 | タイプ | 場所 | 必須 | 説明 |
|---|---|---|---|---|
| username | string | query | はい | ユーザー名 |
コード例
curl --request GET \ --url 'https://api.pressmonitor.com/telegram/v1/group-info?username=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/telegram/v1/group-info?username=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/telegram/v1/group-info" querystring = {"username":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/telegram/v1/group-info?username=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/telegram/v1/group-info?username=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); レスポンス
200 成功
GET
/search 検索
Search
パラメータ
| 名前 | タイプ | 場所 | 必須 | 説明 |
|---|---|---|---|---|
| keyword | string | query | はい | キーワード |
コード例
curl --request GET \ --url 'https://api.pressmonitor.com/telegram/v1/search?keyword=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/telegram/v1/search?keyword=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/telegram/v1/search" querystring = {"keyword":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/telegram/v1/search?keyword=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/telegram/v1/search?keyword=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); レスポンス
200 成功
GET
/search-hashtag ハッシュタグ検索
Search Hashtag
パラメータ
| 名前 | タイプ | 場所 | 必須 | 説明 |
|---|---|---|---|---|
| hashtag | string | query | はい | ハッシュタグ |
| offset | string | query | いいえ | オフセット |
コード例
curl --request GET \ --url 'https://api.pressmonitor.com/telegram/v1/search-hashtag?hashtag=SOME_STRING_VALUE&offset=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/telegram/v1/search-hashtag?hashtag=SOME_STRING_VALUE&offset=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/telegram/v1/search-hashtag" querystring = {"hashtag":"SOME_STRING_VALUE","offset":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/telegram/v1/search-hashtag?hashtag=SOME_STRING_VALUE&offset=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/telegram/v1/search-hashtag?hashtag=SOME_STRING_VALUE&offset=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); レスポンス
200 成功
GET
/user-info ユーザー情報
User Info
パラメータ
| 名前 | タイプ | 場所 | 必須 | 説明 |
|---|---|---|---|---|
| username | string | query | はい | ユーザー名 |
コード例
curl --request GET \ --url 'https://api.pressmonitor.com/telegram/v1/user-info?username=SOME_STRING_VALUE' const http = require("https"); const options = { "method": "GET", "hostname": "api.pressmonitor.com", "port": null, "path": "/telegram/v1/user-info?username=SOME_STRING_VALUE", "headers": {} }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); import requests url = "https://api.pressmonitor.com/telegram/v1/user-info" querystring = {"username":"SOME_STRING_VALUE"} response = requests.request("GET", url, params=querystring) print(response.text) <?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.pressmonitor.com/telegram/v1/user-info?username=SOME_STRING_VALUE", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.pressmonitor.com/telegram/v1/user-info?username=SOME_STRING_VALUE") .get() .build(); Response response = client.newCall(request).execute(); レスポンス
200 成功