Search Communities
curl --request GET \
--url https://twitter-x-api.p.rapidapi.com/api/v2/community/search \
--header 'x-rapidapi-key: <api-key>'import requests
url = "https://twitter-x-api.p.rapidapi.com/api/v2/community/search"
headers = {"x-rapidapi-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-rapidapi-key': '<api-key>'}};
fetch('https://twitter-x-api.p.rapidapi.com/api/v2/community/search', 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://twitter-x-api.p.rapidapi.com/api/v2/community/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-rapidapi-key: <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"
"net/http"
"io"
)
func main() {
url := "https://twitter-x-api.p.rapidapi.com/api/v2/community/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rapidapi-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://twitter-x-api.p.rapidapi.com/api/v2/community/search")
.header("x-rapidapi-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://twitter-x-api.p.rapidapi.com/api/v2/community/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"cursor": "WzI1NS43MjMxMywxNjc3OTAxMjM3NjM3ODU3MjgxXQ==",
"has_more": true,
"data": [
{
"id": "1508567430188126209",
"is_nsfw": false,
"member_count": 142585,
"name": "Stock & Crypto Trading",
"topic": "Finance",
"banner_url": "https://pbs.twimg.com/community_banner_img/1832932658630086656/3uFbvMVV?format=jpg&name=orig"
}
]
}{
"message": "Bad request"
}{
"message": "Invalid API key. Go to https://docs.rapidapi.com/docs/keys for more info."
}{
"message": "You are not subscribed to this API."
}{
"message": "Request failed with status 500: Internal Server Error",
"status_code": 500
}Community
Search Communities
Search Communities
GET
/
api
/
v2
/
community
/
search
Search Communities
curl --request GET \
--url https://twitter-x-api.p.rapidapi.com/api/v2/community/search \
--header 'x-rapidapi-key: <api-key>'import requests
url = "https://twitter-x-api.p.rapidapi.com/api/v2/community/search"
headers = {"x-rapidapi-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-rapidapi-key': '<api-key>'}};
fetch('https://twitter-x-api.p.rapidapi.com/api/v2/community/search', 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://twitter-x-api.p.rapidapi.com/api/v2/community/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-rapidapi-key: <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"
"net/http"
"io"
)
func main() {
url := "https://twitter-x-api.p.rapidapi.com/api/v2/community/search"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-rapidapi-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://twitter-x-api.p.rapidapi.com/api/v2/community/search")
.header("x-rapidapi-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://twitter-x-api.p.rapidapi.com/api/v2/community/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-rapidapi-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"cursor": "WzI1NS43MjMxMywxNjc3OTAxMjM3NjM3ODU3MjgxXQ==",
"has_more": true,
"data": [
{
"id": "1508567430188126209",
"is_nsfw": false,
"member_count": 142585,
"name": "Stock & Crypto Trading",
"topic": "Finance",
"banner_url": "https://pbs.twimg.com/community_banner_img/1832932658630086656/3uFbvMVV?format=jpg&name=orig"
}
]
}{
"message": "Bad request"
}{
"message": "Invalid API key. Go to https://docs.rapidapi.com/docs/keys for more info."
}{
"message": "You are not subscribed to this API."
}{
"message": "Request failed with status 500: Internal Server Error",
"status_code": 500
}Authorizations
Rapid API Key. How can I get Rapid API Key?
Query Parameters
Search keyword
Example:
"crypto"
The number of results to be returned
Example:
20