Users
Unfollow User
Unfollow a user on Twitter/X programmatically via API. $0.001 per call. GetXAPI unfollow user endpoint with username or user_id targeting.
POST
/twitter/user/unfollowThis endpoint costs $0.001 per API call.
Unfollows a user on behalf of the auth_token owner. Identify the target by either user_id or username.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
auth_token | string | Yes | User's auth token |
user_id | string | Conditional | Numeric id of the account to unfollow. Provide either user_id or username |
username | string | Conditional | Handle (without @) of the account to unfollow. Provide either user_id or username |
proxy | string | No | Proxy URL (http://, https://, socks5://, or socks4://) |
Provide one of user_id or username.
Notes
- Idempotent — unfollowing an account you don't follow succeeds without error.
Response (200)
{
"status": "success",
"msg": "User unfollowed successfully",
"data": {
"userId": "11348282",
"userName": "NASA",
"name": "NASA",
"following": false
}
}Error Responses
400 - Missing target
{
"error": "Provide user_id or username of the account to unfollow"
}404 - User not found
{
"error": "User not found"
}Examples
curl -X POST "https://api.getxapi.com/twitter/user/unfollow" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"username": "nasa"
}'const response = await fetch("https://api.getxapi.com/twitter/user/unfollow", {
method: "POST",
headers: {
Authorization: "Bearer API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
auth_token: "your_auth_token",
username: "nasa",
}),
});
const data = await response.json();
console.log(data.data);import requests
response = requests.post(
"https://api.getxapi.com/twitter/user/unfollow",
headers={"Authorization": "Bearer API_KEY"},
json={
"auth_token": "your_auth_token",
"username": "nasa",
},
)
print(response.json()["data"])Unfollow by user_id
curl -X POST "https://api.getxapi.com/twitter/user/unfollow" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d '{
"auth_token": "your_auth_token",
"user_id": "11348282"
}'Follow UserNew
Follow a user on Twitter/X programmatically via API. $0.001 per call. GetXAPI follow user endpoint with username or user_id targeting.
User Affiliates
Get affiliated accounts of a verified Twitter/X organization via API. $0.001 per call, ~20 users per call. GetXAPI affiliates endpoint with pagination.