Deep User Analytics: Profile, Followers, Mentions & Relationships
User Analytics Overview
XCROP provides 8 dedicated user endpoints that give you a complete picture of any X/Twitter account — from basic profile data to deep engagement analysis. No connected account needed; everything works with just your API key.
Plus relationship mapping via GET /v2/users/check-follow to check if two accounts follow each other.
Fetching a User Profile
import requests import os API_KEY = os.environ["XCROP_API_KEY"] HEADERS = {"Authorization": "Bearer " + API_KEY} BASE = "https://xcrop.io/api/v2" response = requests.get( BASE + "/users/VitalikButerin", headers=HEADERS ) user = response.json()["data"] print("@" + user["username"] + " — " + user["name"]) print("Bio: " + user["description"][:100]) print("Followers: " + str(user["followers"])) print("Following: " + str(user["following"])) print("Tweets: " + str(user["tweets_count"])) print("Listed: " + str(user["listed"])) print("Verified: " + str(user["verified"]))
Analyzing User Tweets & Engagement
Fetch a user's recent tweets and calculate their average engagement rate:
def get_engagement_stats(username, count=50): """Analyze engagement from recent tweets.""" response = requests.get( BASE + "/users/" + username + "/tweets", headers=HEADERS, params={"count": count, "sort": "latest"} ) tweets = response.json()["data"] total_likes = 0 total_rts = 0 total_replies = 0 total_views = 0 for t in tweets: m = t["metrics"] total_likes += m["likes"] total_rts += m["retweets"] total_replies += m["replies"] total_views += m["views"] n = len(tweets) if n == 0: return None return { "tweets_analyzed": n, "avg_likes": round(total_likes / n), "avg_retweets": round(total_rts / n), "avg_replies": round(total_replies / n), "avg_views": round(total_views / n), "engagement_rate": round((total_likes + total_rts + total_replies) / max(total_views, 1) * 100, 2), } stats = get_engagement_stats("VitalikButerin") print("Avg likes: " + str(stats["avg_likes"])) print("Avg retweets: " + str(stats["avg_retweets"])) print("Avg views: " + str(stats["avg_views"])) print("Engagement rate: " + str(stats["engagement_rate"]) + "%")
Follower Analysis
Get Followers with Sorting
# Get followers sorted by default order response = requests.get( BASE + "/users/VitalikButerin/followers", headers=HEADERS, params={"count": 50} ) followers = response.json()["data"] for f in followers[:10]: print("@" + f["username"] + " — " + str(f["followers"]) + " followers")
Blue Verified Followers Only
Want to find high-profile followers? Use the verified-followers endpoint:
response = requests.get( BASE + "/users/VitalikButerin/verified-followers", headers=HEADERS, params={"count": 50} ) verified = response.json()["data"] print("Verified followers of @VitalikButerin:") for f in verified[:10]: print(" @" + f["username"] + " (" + str(f["followers"]) + " followers)")
This is great for identifying which notable accounts follow a KOL — useful for influence mapping and partnership research.
Tracking Mentions
Monitor who's talking about a specific user:
response = requests.get( BASE + "/users/VitalikButerin/mentions", headers=HEADERS, params={"count": 20, "sort": "latest"} ) mentions = response.json()["data"] print("Recent mentions of @VitalikButerin:") for m in mentions[:5]: print(" @" + m["author"]["username"] + ": " + m["text"][:80]) print(" Likes: " + str(m["metrics"]["likes"]))
Relationship Mapping
Check if two users follow each other — essential for verifying mutual connections, partnership status, or airdrop follow requirements:
response = requests.get( BASE + "/users/check-follow", headers=HEADERS, params={"source": "VitalikButerin", "target": "elonmusk"} ) rel = response.json()["data"] print("@" + rel["source"] + " follows @" + rel["target"] + ": " + str(rel["source_follows_target"])) print("@" + rel["target"] + " follows @" + rel["source"] + ": " + str(rel["target_follows_source"]))
JavaScript Example: Full User Dashboard
const API_KEY = process.env.XCROP_API_KEY; const BASE = "https://xcrop.io/api/v2"; const headers = { Authorization: "Bearer " + API_KEY }; async function userDashboard(username) { // Fetch profile + recent tweets + followers in parallel const [profile, tweets, followers, verified] = await Promise.all([ fetch(BASE + "/users/" + username, { headers }).then(r => r.json()), fetch(BASE + "/users/" + username + "/tweets?count=20&sort=latest", { headers }).then(r => r.json()), fetch(BASE + "/users/" + username + "/followers?count=20", { headers }).then(r => r.json()), fetch(BASE + "/users/" + username + "/verified-followers?count=10", { headers }).then(r => r.json()), ]); const user = profile.data; console.log("=== @" + user.username + " ==="); console.log("Followers: " + user.followers); console.log("Following: " + user.following); // Top tweet by likes const topTweet = tweets.data.sort((a, b) => b.metrics.likes - a.metrics.likes)[0]; if (topTweet) { console.log("\nTop tweet: " + topTweet.text.slice(0, 80)); console.log(" Likes: " + topTweet.metrics.likes); } // Notable followers console.log("\nVerified followers:"); verified.data.slice(0, 5).forEach(f => { console.log(" @" + f.username + " (" + f.followers + " followers)"); }); } userDashboard("VitalikButerin");
Use Case: Influencer Comparison Tool
Compare multiple users side by side to find the best KOLs for partnerships:
import requests import os API_KEY = os.environ["XCROP_API_KEY"] HEADERS = { "Authorization": "Bearer " + API_KEY, "Content-Type": "application/json" } BASE = "https://xcrop.io/api/v2" CANDIDATES = ["DefiIgnas", "Pentosh1", "CryptoHayes", "inversebrah"] # Batch fetch all profiles profiles = requests.post( BASE + "/users/batch", headers=HEADERS, json={"usernames": CANDIDATES} ).json()["data"] # Analyze each results = [] for p in profiles: # Get recent tweets for engagement calc tweets = requests.get( BASE + "/users/" + p["username"] + "/tweets", headers=HEADERS, params={"count": 20, "sort": "latest"} ).json()["data"] total_eng = sum(t["metrics"]["likes"] + t["metrics"]["retweets"] for t in tweets) avg_eng = total_eng / len(tweets) if tweets else 0 eng_rate = avg_eng / max(p["followers"], 1) * 100 results.append({ "username": p["username"], "followers": p["followers"], "avg_engagement": round(avg_eng), "engagement_rate": round(eng_rate, 3), }) # Rank by engagement rate results.sort(key=lambda x: x["engagement_rate"], reverse=True) print("=== Influencer Comparison ===") for i, r in enumerate(results): print(str(i + 1) + ". @" + r["username"]) print(" Followers: " + str(r["followers"])) print(" Avg engagement: " + str(r["avg_engagement"])) print(" Rate: " + str(r["engagement_rate"]) + "%") print()
Credit Usage
With the Pro plan ($9.9/mo, 2M credits), you can build comprehensive analytics dashboards covering hundreds of users daily.
Best Practices
sort=latest for recent activity, sort=popular for top contentcursor param to fetch beyond the first page of followers