Get Following (v3)
curl --request POST \
--url https://api.twexapi.io/v3/twitter/users/following \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "elonmusk",
"count": 20,
"cursor": "1870681402093130182|2076960004551737340"
}
'import requests
url = "https://api.twexapi.io/v3/twitter/users/following"
payload = {
"username": "elonmusk",
"count": 20,
"cursor": "1870681402093130182|2076960004551737340"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
username: 'elonmusk',
count: 20,
cursor: '1870681402093130182|2076960004551737340'
})
};
fetch('https://api.twexapi.io/v3/twitter/users/following', 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://api.twexapi.io/v3/twitter/users/following",
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([
'username' => 'elonmusk',
'count' => 20,
'cursor' => '1870681402093130182|2076960004551737340'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.twexapi.io/v3/twitter/users/following"
payload := strings.NewReader("{\n \"username\": \"elonmusk\",\n \"count\": 20,\n \"cursor\": \"1870681402093130182|2076960004551737340\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.twexapi.io/v3/twitter/users/following")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"elonmusk\",\n \"count\": 20,\n \"cursor\": \"1870681402093130182|2076960004551737340\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twexapi.io/v3/twitter/users/following")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"username\": \"elonmusk\",\n \"count\": 20,\n \"cursor\": \"1870681402093130182|2076960004551737340\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"users": [
{
"userId": "<string>",
"isBlueVerified": true,
"createdAt": "<string>",
"defaultProfile": true,
"defaultProfileImage": true,
"description": "<string>",
"location": "<string>",
"fastFollowersCount": 123,
"favouritesCount": 123,
"followersCount": 123,
"followingCount": 123,
"hasCustomTimelines": true,
"isTranslator": true,
"listedCount": 123,
"mediaCount": 123,
"name": "<string>",
"normalFollowersCount": 123,
"possiblySensitive": true,
"profileImageUrlHttps": "<string>",
"username": "<string>",
"statusesCount": 123,
"verified": true,
"protected": true,
"createdAtDatetime": "<string>",
"pinnedTweetIdsStr": [
"<unknown>"
],
"translatorType": "<string>",
"verified_type": "blue",
"withheldInCountries": [
"<unknown>"
],
"url": "<string>",
"descriptionUrls": [
"<unknown>"
],
"urls": [
"<unknown>"
],
"pinnedTweetIds": [
"<unknown>"
]
}
],
"has_next_page": true,
"next_cursor": "1870681402093130182|2076960004551737340"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Followers & Following Endpoints
Get Following (v3)
Get following list of a user. Page size 10-100; use cursor for more pages. $0.14/1000 users.
POST
/
v3
/
twitter
/
users
/
following
Get Following (v3)
curl --request POST \
--url https://api.twexapi.io/v3/twitter/users/following \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"username": "elonmusk",
"count": 20,
"cursor": "1870681402093130182|2076960004551737340"
}
'import requests
url = "https://api.twexapi.io/v3/twitter/users/following"
payload = {
"username": "elonmusk",
"count": 20,
"cursor": "1870681402093130182|2076960004551737340"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
username: 'elonmusk',
count: 20,
cursor: '1870681402093130182|2076960004551737340'
})
};
fetch('https://api.twexapi.io/v3/twitter/users/following', 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://api.twexapi.io/v3/twitter/users/following",
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([
'username' => 'elonmusk',
'count' => 20,
'cursor' => '1870681402093130182|2076960004551737340'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.twexapi.io/v3/twitter/users/following"
payload := strings.NewReader("{\n \"username\": \"elonmusk\",\n \"count\": 20,\n \"cursor\": \"1870681402093130182|2076960004551737340\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.twexapi.io/v3/twitter/users/following")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"elonmusk\",\n \"count\": 20,\n \"cursor\": \"1870681402093130182|2076960004551737340\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.twexapi.io/v3/twitter/users/following")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"username\": \"elonmusk\",\n \"count\": 20,\n \"cursor\": \"1870681402093130182|2076960004551737340\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"msg": "success",
"data": {
"users": [
{
"userId": "<string>",
"isBlueVerified": true,
"createdAt": "<string>",
"defaultProfile": true,
"defaultProfileImage": true,
"description": "<string>",
"location": "<string>",
"fastFollowersCount": 123,
"favouritesCount": 123,
"followersCount": 123,
"followingCount": 123,
"hasCustomTimelines": true,
"isTranslator": true,
"listedCount": 123,
"mediaCount": 123,
"name": "<string>",
"normalFollowersCount": 123,
"possiblySensitive": true,
"profileImageUrlHttps": "<string>",
"username": "<string>",
"statusesCount": 123,
"verified": true,
"protected": true,
"createdAtDatetime": "<string>",
"pinnedTweetIdsStr": [
"<unknown>"
],
"translatorType": "<string>",
"verified_type": "blue",
"withheldInCountries": [
"<unknown>"
],
"url": "<string>",
"descriptionUrls": [
"<unknown>"
],
"urls": [
"<unknown>"
],
"pinnedTweetIds": [
"<unknown>"
]
}
],
"has_next_page": true,
"next_cursor": "1870681402093130182|2076960004551737340"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Parameters for getting followers / following / verified-followers (v3, no cookie required)
Twitter username (with or without @).
Example:
"elonmusk"
Number of users to return per page (min 10, max 100).
Required range:
10 <= x <= 100Example:
20
Cursor from previous next_cursor to fetch the next page.
Example:
"1870681402093130182|2076960004551737340"
⌘I