You need Twitter profile intel and engagement context in your Node.js app this week, not next month. By the end of this guide, you’ll fetch verified profile details, a user’s following list, and recent replies using the Twitter Data All-in-One API from Zyla API Hub, with copy-pasteable curl and Node.js code you can drop into production.
What you can build with the Twitter Data All-in-One API
The Twitter Data All-in-One API helps you programmatically retrieve:
- Additional profile information (verification, business labels, avatar, account origin details).
- The list of accounts a user follows.
- A user’s recent replies (including counts for retweets, replies, quotes where returned).
Typical use cases include social analytics dashboards, CRM enrichment for leads with Twitter presence, automated brand monitoring, and agentic workflows that need a quick snapshot of a user’s activity and relationships.
All calls run through Zyla API Hub with one account, one API key, and a subscription + quota model (not pay-per-call). Zyla’s marketplace spans more than 10,000 public APIs, so you can reuse the same key across categories as needed.
Getting started on Zyla API Hub
To start, open the API’s page on Zyla: Twitter Data All-in-One API. Click Subscribe or Start Free Trial if available. Zyla’s first API typically offers a 7-day trial or 50 requests; there’s no Free Plan. Check the API page for current access options and pricing.
After subscribing, you’ll get an API key. Authenticate every request with the header: Authorization: Bearer YOUR_API_KEY.
If you don’t have an account yet, create one here: Register.
Endpoint overview
All endpoints below require the Authorization header. The examples use the documented screenname parameter and concrete URLs. Do not add extra parameters.
About profile
Returns additional information about a profile.
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile
- Required query params:
- screenname (string): elonmusk
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
Following
Get the list of accounts the user is following.
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3679/following
- Required query params:
- screenname (string): elonmusk
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3679/following?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
User replies
Retrieve a user’s replies.
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3682/user-replies
- Required query params:
- screenname (string): elonmusk
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3682/user-replies?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
Node.js quickstart (About profile)
This example uses native fetch (Node.js 18+). It calls the About profile endpoint and reads several useful fields: verification, avatar, business label, and origin details.
import { setTimeout as delay } from "node:timers/promises";
const API_URL = "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile?screenname=elonmusk";
const API_KEY = "YOUR_API_KEY"; // Store securely (env var, secret manager)
async function fetchAboutProfile(retries = 3) {
for (let attempt = 1; attempt <= retries; attempt++) {
const res = await fetch(API_URL, {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
});
if (res.ok) {
const data = await res.json();
// Access documented fields
const {
status,
profile,
rest_id,
blue_verified,
affiliates,
business_account,
verified_since,
avatar,
name,
protected: isProtected,
about,
id
} = data;
console.log("Status:", status);
console.log("Profile:", profile, "(id:", id, "rest_id:", rest_id + ")");
console.log("Blue verified:", blue_verified);
console.log("Avatar URL:", avatar);
console.log("Protected:", isProtected);
console.log("Business account:", business_account);
console.log("Verified since (raw):", verified_since);
if (affiliates?.label) {
console.log("Affiliate label description:", affiliates.label.description);
console.log("Affiliate badge URL:", affiliates.label.badge?.url);
console.log("Affiliate link URL:", affiliates.label.url?.url);
}
if (about) {
console.log("Account based in:", about.account_based_in);
console.log("Location accurate:", about.location_accurate);
console.log("Learn more URL:", about.learn_more_url);
console.log("Affiliate username:", about.affiliate_username);
console.log("Source:", about.source);
console.log("Username change count:", about.username_changes?.count);
}
return data;
}
// Simple retry with backoff on non-2xx
if (attempt < retries) {
const waitMs = 250 * attempt;
console.warn(`HTTP ${res.status} - retrying in ${waitMs}ms...`);
await delay(waitMs);
continue;
} else {
const text = await res.text();
throw new Error(`Request failed after ${retries} attempts: ${res.status} ${text}`);
}
}
}
fetchAboutProfile().catch(err => {
console.error("Error:", err.message);
process.exit(1);
});
Expected JSON (About profile)
Below is a documented sample response for the About profile endpoint. Values are as returned in the example.
{"status":"active","profile":"elonmusk","rest_id":"44196397","blue_verified":true,"affiliates":{"label":{"badge":{"url":"https:\/\/pbs.twimg.com\/profile_images\/1955359038532653056\/OSHY3ewP_bigger.jpg"},"description":"X","url":{"url":"https:\/\/twitter.com\/X","urlType":"DeepLink"},"userLabelDisplayType":"Badge","userLabelType":"BusinessLabel"}},"business_account":null,"verified_since":"-156836000000000","avatar":"https:\/\/pbs.twimg.com\/profile_images\/2008546467615580160\/57KcqsTA_normal.jpg","name":"Elon Musk","protected":false,"about":{"account_based_in":"United States","location_accurate":false,"learn_more_url":"https:\/\/help.twitter.com\/managing-your-account\/about-twitter-verified-accounts","affiliate_username":"X","source":"United States App Store","username_changes":{"count":"0"}},"id":"44196397"}
Field notes you’ll likely use:
- status: profile status indicator.
- profile and id/rest_id: identifiers for downstream joins or caches.
- blue_verified: boolean; good for eligibility badges in UI.
- affiliates.label: structured business/affiliate badge, with link and badge URL.
- avatar: current avatar image URL.
- about.account_based_in and about.source: context about account origin.
- verified_since: returned as a string; treat as an opaque value unless you’ve confirmed how you plan to display it.
Additional endpoint examples
Following (curl + usage tips)
Use this to build a follower-graph explorer, surface shared interests, or enrich CRM entries with a list of followed accounts.
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3679/following?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
Documented example response:
{"following":[{"user_id":"1671483632551186433","screen_name":"TechMine_Mw","description":"Malawi’s premier SAAS firm 🌐 | Leaders in digital transformation, website development, design, and marketing 🖥️🎨 | Shaping Malawi’s tech future 🇲🇼","profile_image":"https:\/\/pbs.twimg.com\/profile_images\/1847661011731431425\/FNhbpOqP_normal.jpg","statuses_count":5,"followers_count":6,"friends_count":10,"media_count":3,"name":"TechMine INC."},{"user_id":"44196397","screen_name":"elonmusk","description":"","profile_image":"https:\/\/pbs.twimg.com\/profile_images\/1874558173962481664\/8HSTqIlD_normal.jpg","statuses_count":65409,"followers_count":210941749,"friends_count":926,"media_count":3038,"name":"Elon Musk"}],"status":"ok","more_users":false}
Practical notes:
- Use more_users to decide if your UI should display a “Load more” affordance. Treat it as a boolean signal for additional data availability.
- Counts like followers_count and friends_count are point-in-time and may change frequently; cache accordingly.
User replies (curl + notes)
Use this to surface a user’s interaction patterns or to trigger alerts when they engage in threads relevant to your product.
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3682/user-replies?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
Documented example response excerpt (fields vary by tweet; values shown as provided):
{"timeline":[{"tweet_id":"1867196702865674450","bookmarks":0,"created_at":"Thu Dec 12 13:15:59 +0000 2024","favorites":0,"text":"RT @cb_doge: Every citizen journalist who fought the legacy media narrative and spread the truth this election is the Person of the Year.…","lang":"en","in_reply_to_status_id_str":null,"views":null,"quotes":0,"replies":0,"retweets":10,"conversation_id":"1867196702865674450","media":[],"entities":{"user_mentions":[{"id_str":"1389913567671975937","name":"DogeDesigner","screen_name":"cb_doge"}],"urls":[],"hashtags":[],"symbols":[]},"author":{"rest_id":"44196397","name":"Elon Musk","screen_name":"elonmusk","followers_count":207267106,"favourites_count":99802,"avatar":"https:\/\/pbs.twimg.com\/profile_images\/1858316737780781056\/kPL61o0F_normal.jpg","blue_verified":true},"retweeted":{"id":"1867196122143563838"},"retweeted_tweet":{"tweet_id":"1867196122143563838","bookmarks":0,"created_at":"Thu Dec 12 13:13:41 +0000 2024","favorites":119,"text":"Every citizen journalist who fought the legacy media narrative and spread the truth this election is the Person of the Year. \n\n https:\/\/t.co\/B8boPofzKx","lang":"en","quotes":2,"replies":60,"retweets":10,"conv…
Practical notes:
- created_at values are returned as date-time strings; handle them as-is for display or normalize to your app’s timezone.
- Entities (mentions, urls, hashtags) help with linkifying content or filtering by topic.
- Counts like replies, retweets, quotes are snapshot counts; do not assume long-term stability for analytics without periodic refresh.
Production tips that save time
- Authentication: Always set Authorization: Bearer YOUR_API_KEY. Do not add extra query keys.
- Error handling: On non-2xx, retry with exponential backoff for transient issues. Log the response body for debugging.
- Caching: Profile data changes less frequently than timelines—cache About profile responses longer than reply timelines.
- Rate and quota: The marketplace uses subscription + quota. Your first API on Zyla typically includes a 7-day trial or 50 requests. For current limits, check the API page.
- Nullability: Fields like business_account may be null. Always null-check nested paths (e.g., affiliates.label.badge).
- Internationalization: Text fields may include emojis and non-Latin characters; ensure UTF-8 safe handling end-to-end.
- Security: Keep YOUR_API_KEY in environment variables or a secrets manager; never commit to source control.
Real-world use cases
- Lead enrichment: Pull About profile to flag blue_verified and attach avatar/name for SDR workflows.
- Partnership mapping: Use Following to discover brands and creators a prospect follows before outreach.
- Engagement alerts: Poll User replies and surface threads where your brand or competitors are mentioned.
- Agent tooling: Give your internal AI assistants the ability to fetch a quick profile snapshot and context for decision-making.
Explore the API’s page again here for details and updates: Twitter Data All-in-One API. Browse more categories on the marketplace: Zyla API Hub.
Calling the API from an AI agent via MCP
The Twitter Data All-in-One API can be called from MCP-compatible clients (e.g., Claude Code, Cursor, Windsurf) through Zyla’s MCP endpoint. Point your MCP client to:
When your agent performs a tool call, direct it to invoke the documented Hub URLs (for example, the About profile URL) and include the header Authorization: Bearer YOUR_API_KEY. Use the same request patterns you see in the curl examples. This lets your coding agent retrieve Twitter data on demand while keeping auth centralized in your MCP configuration.
Troubleshooting and observability
- Network timeouts: Set sane timeouts (5–15s). Implement retries on timeouts and 5xx responses.
- Partial data: If a nested field is missing (e.g., affiliates.label), treat it as optional in your schema and keep rendering primary profile fields.
- Auditing: Log request URLs and response status codes (not secrets) to correlate spikes with deploys or traffic.
- Backfills: For batch jobs, stagger requests and respect your quota to avoid throttling; cache stable entities like rest_id.
Copy-paste reference
About profile (curl)
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
Following (curl)
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3679/following?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
User replies (curl)
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3682/user-replies?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
FAQ
How do I authenticate?
Include the header Authorization: Bearer YOUR_API_KEY in every request.
Is there a free plan?
No Free Plan. For your first API on Zyla, you typically get a 7-day trial or 50 requests. Check the API page for current access options and pricing.
Which parameters are required?
For the documented endpoints above, pass screenname as shown (e.g., screenname=elonmusk). Do not add extra parameters.
What is the response shape?
Use the documented examples in this article as a reference. Only rely on fields shown by the API: for About profile (status, profile, rest_id, blue_verified, affiliates, business_account, verified_since, avatar, name, protected, about, id), for Following (following array with user fields, status, more_users), and for User replies (timeline entries with tweet and author fields where provided).
Can I call the API from AI coding agents?
Yes. Use Zyla’s MCP endpoint and have your agent call the same Hub URLs with the Authorization header. See the MCP link above.
Ship your integration today: create your account, subscribe to the API, and get your key here: Register. Explore more social media APIs and beyond on Zyla API Hub and the Twitter Data All-in-One listing at this page.