Pesquisar canais (por texto) (Search for channels (by text))
curl --request POST \
--url https://{host}/api/{session}/channels/search/by-text \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"text": "Donald Trump",
"categories": [],
"limit": 50,
"startCursor": ""
}
'import requests
url = "https://{host}/api/{session}/channels/search/by-text"
payload = {
"text": "Donald Trump",
"categories": [],
"limit": 50,
"startCursor": ""
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'Donald Trump', categories: [], limit: 50, startCursor: ''})
};
fetch('https://{host}/api/{session}/channels/search/by-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/channels/search/by-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Donald Trump',
'categories' => [
],
'limit' => 50,
'startCursor' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/channels/search/by-text"
payload := strings.NewReader("{\n \"text\": \"Donald Trump\",\n \"categories\": [],\n \"limit\": 50,\n \"startCursor\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/channels/search/by-text")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Donald Trump\",\n \"categories\": [],\n \"limit\": 50,\n \"startCursor\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/channels/search/by-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Donald Trump\",\n \"categories\": [],\n \"limit\": 50,\n \"startCursor\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"text": "tecnologia",
"categories": ["tech", "news"],
"page": {
"limit": 10,
"startCursor": ""
}
}
{
"channels": [
{
"id": "123456789@newsletter",
"name": "Tech News Brasil",
"description": "Notícias sobre tecnologia",
"followersCount": 5420
},
{
"id": "987654321@newsletter",
"name": "Inovação e Tecnologia",
"description": "Tendências tecnológicas",
"followersCount": 3210
}
],
"nextCursor": "abc123xyz"
}
Canais
Buscar Canais por Texto
Buscar canais através de texto (nome ou descrição)
POST
/
api
/
{session}
/
channels
/
search
/
by-text
Pesquisar canais (por texto) (Search for channels (by text))
curl --request POST \
--url https://{host}/api/{session}/channels/search/by-text \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"text": "Donald Trump",
"categories": [],
"limit": 50,
"startCursor": ""
}
'import requests
url = "https://{host}/api/{session}/channels/search/by-text"
payload = {
"text": "Donald Trump",
"categories": [],
"limit": 50,
"startCursor": ""
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: 'Donald Trump', categories: [], limit: 50, startCursor: ''})
};
fetch('https://{host}/api/{session}/channels/search/by-text', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/channels/search/by-text",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => 'Donald Trump',
'categories' => [
],
'limit' => 50,
'startCursor' => ''
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/channels/search/by-text"
payload := strings.NewReader("{\n \"text\": \"Donald Trump\",\n \"categories\": [],\n \"limit\": 50,\n \"startCursor\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/channels/search/by-text")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Donald Trump\",\n \"categories\": [],\n \"limit\": 50,\n \"startCursor\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/channels/search/by-text")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Donald Trump\",\n \"categories\": [],\n \"limit\": 50,\n \"startCursor\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"text": "tecnologia",
"categories": ["tech", "news"],
"page": {
"limit": 10,
"startCursor": ""
}
}
{
"channels": [
{
"id": "123456789@newsletter",
"name": "Tech News Brasil",
"description": "Notícias sobre tecnologia",
"followersCount": 5420
},
{
"id": "987654321@newsletter",
"name": "Inovação e Tecnologia",
"description": "Tendências tecnológicas",
"followersCount": 3210
}
],
"nextCursor": "abc123xyz"
}
Descrição
Este endpoint permite buscar canais no WhatsApp usando texto livre. A busca pode ser filtrada por categorias e suporta paginação para navegar pelos resultados.Parâmetros de URL
ID único da sessão WhatsApp autenticada
Corpo da Requisição
Texto para buscar nos canais (nome ou descrição)
Array de categorias para filtrar a busca (opcional)
Resposta
Array de canais encontrados
Cursor para a próxima página de resultados
{
"text": "tecnologia",
"categories": ["tech", "news"],
"page": {
"limit": 10,
"startCursor": ""
}
}
{
"channels": [
{
"id": "123456789@newsletter",
"name": "Tech News Brasil",
"description": "Notícias sobre tecnologia",
"followersCount": 5420
},
{
"id": "987654321@newsletter",
"name": "Inovação e Tecnologia",
"description": "Tendências tecnológicas",
"followersCount": 3210
}
],
"nextCursor": "abc123xyz"
}
Códigos de Status
200- Busca realizada com sucesso400- Parâmetros inválidos ou texto de busca faltando401- Não autorizado500- Erro interno do servidor
Exemplo de Uso
curl -X POST https://api.wappfy.com.br/api/my-session/channels/search/by-text \
-H "Content-Type: application/json" \
-d '{
"text": "tecnologia",
"categories": ["tech"],
"page": {
"limit": 10
}
}'
const session = 'my-session';
const response = await fetch(`https://api.wappfy.com.br/api/${session}/channels/search/by-text`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
text: 'tecnologia',
categories: ['tech'],
page: {
limit: 10
}
})
});
const data = await response.json();
console.log(data.channels);
import requests
session = 'my-session'
response = requests.post(
f'https://api.wappfy.com.br/api/{session}/channels/search/by-text',
json={
'text': 'tecnologia',
'categories': ['tech'],
'page': {
'limit': 10
}
}
)
data = response.json()
print(data['channels'])
Authorizations
Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)
Path Parameters
Nome da sessão (instanceName)
Body
application/json
⌘I
