You need to pull live Twitter (X) profile details, follow lists, and a user’s latest replies without building and maintaining a scraper. By the end of this guide you’ll make authenticated requests to the Twitter Data All-in-One API on Zyla API Hub to fetch a profile, get “about” metadata, list who a user follows, and read their replies—ready to drop into your social media workflows this week.
What this API does and when to use it
The Twitter Data All-in-One API provides structured endpoints to retrieve Twitter (X) data for a public account: core profile, additional profile “about” info, following list, and user replies. Teams use it for:
- Onboarding flows that auto-fill user bios, avatars, and names from Twitter.
- CRM/lead enrichment—storing verified status and follower context.
- Creator analytics—tracking new follows and reply activity.
- Moderation and monitoring—scanning recent replies from a handle.
It’s delivered through Zyla API Hub, which offers a single account, one API key, and a subscription-and-quota model across more than 10,000 public APIs. The Twitter Data All-in-One API belongs to the Social Media & Networking category, so it fits cleanly into social data pipelines.
Getting started on Zyla API Hub
Open the Twitter Data All-in-One API page on Zyla, click Subscribe or Start Free Trial, and grab your API key. The first API on an account typically includes a 7-day trial or 50 requests; check the item page for current access options and pricing. All requests use the Authorization: Bearer YOUR_API_KEY header—no extra tokens needed.
Start here: Start 7-day trial on Twitter Data All-in-One API.
You can also browse the broader marketplace at Zyla API Hub to plug multiple APIs into your stack under a single key.
Authentication and request pattern
All endpoints are simple GET requests with the screenname parameter when required, and a Bearer token for auth:
- Header: Authorization: Bearer YOUR_API_KEY
- Param: screenname (string), e.g., elonmusk
Copy the curl examples in this guide as-is, replace YOUR_API_KEY with your key, and you’ll get JSON responses immediately.
Endpoints you’ll use
1) Profile
Fetches a core profile by handle.
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3673/profile
- Params: screenname (required)
Official example:
curl -s -X GET "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3673/profile?screenname=elonmusk" \
-H "Authorization: Bearer YOUR_API_KEY"
Official JSON response:
{
"status": "active",
"profile": "MikeCiesla",
"rest_id": "23880336",
"blue_verified": true,
"affiliates": [],
"business_account": [],
"avatar": "https://pbs.twimg.com/profile_images/1699329166234247168/G1W8YKJy_normal.jpg",
"header_image": "https://pbs.twimg.com/profile_banners/23880336/1695301088",
"desc": "Web3 at Google Cloud",
"name": "MikeCiesla",
"protected": null,
"location": "🦘🇦🇺",
"friends": 969,
"sub_count": 219,
"statuses_count": 48,
"media_count": 2,
"pinned_tweet_ids_str": [],
"created_at": "Thu Mar 12 02:45:15 +0000 2009",
"id": "23880336"
}
What you’ll actually use:
- name, desc, avatar, header_image for UI display.
- blue_verified for verification badges.
- rest_id and id as stable identifiers in your database.
- created_at for account age logic.
2) About profile
Returns additional metadata about a profile (affiliations, verification, “about” context).
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile
- Params: screenname (required)
Example request:
Example response:
This is useful when you need “blue_verified,” affiliation badges, or the “about” block for richer user context. Store rest_id/id alongside your internal user record to avoid re-resolution by screenname later.
3) Following
Returns the list of accounts a user follows.
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3679/following
- Params: screenname (required)
Example request:
Example response:
Key fields: user_id and screen_name to map relationships; followers_count/friends_count for quick scoring; more_users indicates whether more results are available from this call. When caching, favor user_id as the stable key.
4) User replies
Gets the list of replies from a user’s timeline. Useful for community management, influencer monitoring, or building “recent interactions” features.
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3682/user-replies
- Params: screenname (required)
Example request:
Example response (truncated by source):
{"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…
Commonly used fields include tweet_id, created_at, text, retweets, replies, and entities.user_mentions. The created_at value is a timestamp string; if you persist it, convert to your preferred datetime format on write.
One request you can ship now
Below is a minimal Python example to call the About profile endpoint and extract a few fields you’d typically consume in apps or workflows:
import requests
API_KEY = "YOUR_API_KEY"
SCREENNAME = "elonmusk"
url = "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile"
params = {"screenname": SCREENNAME}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(url, params=params, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json()
# Safely read selected fields
rest_id = data.get("rest_id")
name = data.get("name")
blue_verified = data.get("blue_verified")
avatar = data.get("avatar")
about = data.get("about", {}) or {}
account_based_in = about.get("account_based_in")
affiliate_username = about.get("affiliate_username")
print({
"rest_id": rest_id,
"name": name,
"blue_verified": blue_verified,
"avatar": avatar,
"account_based_in": account_based_in,
"affiliate_username": affiliate_username
})
Notes:
- Always pass the Authorization header exactly as shown.
- If you cache responses, store rest_id/id for stable identity across renames.
- For avatars and header images, consider a refresh policy (e.g., daily) since media URLs can change.
Practical implementation details that save time
- Authorization: All endpoints require Authorization: Bearer YOUR_API_KEY. Do not append additional tokens or query auth parameters.
- Parameter surface: Only screenname is required where shown. Do not add undocumented params.
- Timestamps: created_at fields appear as Twitter-style strings (e.g., Thu Mar 12 02:45:15 +0000 2009). Normalize to ISO-8601 on ingest if your backend expects it.
- Identity: Use id/rest_id for deduplication across endpoints (profile, about-profile, replies).
- Following pagination: The response includes more_users as a boolean indicator. The request surface exposed here does not document pagination parameters; design your sync accordingly.
- Caching: Consider short TTLs (e.g., minutes to hours) on profile and about-profile, and tighter loops for following/replies depending on your freshness needs.
- Error handling: Treat non-2xx as retryable or alerting conditions depending on your workflow. Parse JSON defensively since some nested objects may be null or arrays.
Common use cases
1) Enriched sign-in with Twitter
On first sign-in, call Profile and About profile to hydrate the user record with name, desc, avatar, blue_verified, and affiliations. Render a verified badge based on blue_verified.
2) Social proof on landing pages
Pull followers_count and friends_count from Following items for featured accounts you care about. Combine with avatar/name for small, cached profile cards with “as of” timestamps.
3) Creator dashboards
Display the user’s latest replies from User replies with counts for retweets, replies, and quotes. Roll up totals over a day or week and plot trends.
4) CRM enrichment
When a prospect provides a handle, call About profile to confirm verification and affiliate labels. Store rest_id for future lookups even if they change their screenname.
Calling the API from an AI agent via MCP
You can route requests through Zyla’s Model Context Protocol (MCP) endpoint in Claude Code, Cursor, Windsurf, or any MCP-compatible client. Point your agent/tooling to the MCP endpoint and include your API key:
- Endpoint: https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
From there, your agent can invoke the same Hub endpoints documented above. This is useful when you want your coding environment or autonomous agent to fetch Twitter profile data, follow lists, or replies inline during development. For more on the MCP transport, see MCP.
End-to-end flow example
- Get the primary profile record:
- Augment with “about” info (verification, affiliation badge):
- Retrieve who the user is following (for social proof or network graphs):
- List recent replies for engagement analytics:
Persist rest_id/id across calls to keep your data model normalized. For frontends, cache avatars and header images with a reasonable TTL and an ETag-aware CDN where possible.
Troubleshooting checklist
- 401/403 errors: Ensure your Authorization header uses Bearer YOUR_API_KEY and that your subscription on the API page is active.
- Empty or partial arrays: The user may have limited visibility or there may be no recent data in that category. Handle empty states gracefully.
- Field nullability: Some properties (e.g., business_account, affiliates) can be null or empty arrays. Write null-safe mappers.
- Internationalization: Text and description fields are Unicode; ensure UTF-8 end-to-end.
FAQ
Q1: Which header is required for authentication?
Authorization: Bearer YOUR_API_KEY on every request.
Q2: What’s the minimal parameter set?
For the endpoints shown, pass screenname as a required query parameter (e.g., screenname=elonmusk).
Q3: Can I paginate the Following results?
The response includes more_users as a boolean indicator. The request parameters for pagination are not documented here; consult the API page for current behavior.
Q4: Are there guaranteed fields across all users?
Not all fields are guaranteed. Some may be null or absent depending on the account. Always check for existence and handle nulls.
Q5: How do I call it from an AI coding assistant?
Point your MCP-compatible client to https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY and invoke the same Hub endpoints. See the MCP link in this article for details.
Ready to wire this into your stack? Create a free account, get your key, and start building with the 7-day trial from the item page: Start 7-day trial on Twitter Data All-in-One API. If you’re integrating multiple services, remember you can manage them all under a single key on Zyla API Hub.