Référence API
API Telegram
Accédez aux données des chaînes et groupes Telegram {{i18n.for_ai_agents}}
Version
1.0.0
Points de terminaison
7
URL de base
https://api.pressmonitor.com/telegram/v1 Authentification
Toutes les requêtes utilisent une authentification par jeton Bearer. Ajoutez l’en-tête Authorization à chaque appel.
Authorization: Bearer YOUR_TOKEN GET
/bot-info Informations sur le bot
Informations sur le bot
Paramètres
| Nom | Type | Emplacement | Obligatoire | Description |
|---|---|---|---|---|
| username | string | query | Oui | Nom d’utilisateur |
Exemples de code
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(); Réponses
200 Succès
GET
/channel-info Informations sur la chaîne
Informations sur la chaîne
Paramètres
| Nom | Type | Emplacement | Obligatoire | Description |
|---|---|---|---|---|
| username | string | query | Oui | Nom d’utilisateur |
Exemples de code
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(); Réponses
200 Succès
GET
/get-messages Récupérer les messages
Récupérer les messages
Paramètres
| Nom | Type | Emplacement | Obligatoire | Description |
|---|---|---|---|---|
| username | string | query | Oui | Nom d’utilisateur |
| offset | string | query | Non | Décalage |
Exemples de code
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(); Réponses
200 Succès
GET
/group-info Informations sur le groupe
Informations sur le groupe
Paramètres
| Nom | Type | Emplacement | Obligatoire | Description |
|---|---|---|---|---|
| username | string | query | Oui | Nom d’utilisateur |
Exemples de code
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(); Réponses
200 Succès
GET
/search Recherche
Recherche
Paramètres
| Nom | Type | Emplacement | Obligatoire | Description |
|---|---|---|---|---|
| keyword | string | query | Oui | Mot-clé |
Exemples de code
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(); Réponses
200 Succès
GET
/search-hashtag Recherche de hashtag
Recherche de hashtag
Paramètres
| Nom | Type | Emplacement | Obligatoire | Description |
|---|---|---|---|---|
| hashtag | string | query | Oui | Hashtag |
| offset | string | query | Non | Décalage |
Exemples de code
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(); Réponses
200 Succès
GET
/user-info Informations utilisateur
Informations utilisateur
Paramètres
| Nom | Type | Emplacement | Obligatoire | Description |
|---|---|---|---|---|
| username | string | query | Oui | Nom d'utilisateur |
Exemples de code
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(); Réponses
200 Succès