Your team needs Twitter-style social media data in a Python app this week: profile metadata, who a user follows, and their recent replies. By the end of this guide, you’ll query all of that using the Twitter Data All-in-One API on Zyla API Hub, parse the responses in Python, and even wire it into an AI agent via MCP if you’re automating workflows.
What you can build with the Twitter Data All-in-One API
The Twitter Data All-in-One API returns structured social media data to help you:
- Pull additional information about a public profile (verification, avatar URL, labels, rest_id).
- List the accounts a user is following.
- Fetch the user’s recent replies (including tweet IDs, timestamps, engagement counts, and entities).
This API is available on Zyla API Hub and can be called with a single API key. It fits dashboards, alerting pipelines, ETL jobs, CRM enrichment, and moderation tools that depend on social media context.
Getting started on Zyla API Hub
To call the endpoints, open the API’s page on Zyla: Twitter Data All-in-One API. Click Subscribe or Start Free Trial when available, and copy your API key.
- Authentication: add Authorization: Bearer YOUR_API_KEY to every request.
- Billing: subscription + quota (not pay-per-call).
- Access: first API typically offers a 7-day trial or 50 requests. No Free Plan. Check the API page for current access options and pricing.
If you don’t have an account yet, create one here: Register. You’ll receive a single key that works across subscribed APIs on Zyla API Hub.
Authentication and base URL
All examples below use the Authorization header and real Hub URLs. Replace YOUR_API_KEY with your actual key from Zyla.
- Header: Authorization: Bearer YOUR_API_KEY
- Base pattern: https://zylalabs.com/api/{marketplace_id}/{api-slug}/{endpoint_id}/{path}
Endpoints you’ll use
Below are the available paths on this listing. Each requires the screenname query parameter. Do not include any extra parameters or request bodies.
About profile
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile
- Description: Returns the additional information about the profile.
- Required query params:
- screenname (string): e.g., elonmusk
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"
JSON
{"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 highlights you’ll typically use:
- status: account state string.
- profile and name: handle and display name.
- rest_id and id: user identifiers.
- blue_verified: boolean for verification.
- avatar: profile image URL.
- about.account_based_in and about.username_changes.count: profile metadata useful for compliance and enrichment.
Following
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3679/following
- Description: Get the list of accounts user is following.
- Required query params:
- screenname (string): e.g., elonmusk
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"
JSON
{"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}
Field highlights you’ll typically use:
- following: array of accounts, each with user_id, screen_name, name, description.
- followers_count, friends_count, statuses_count, media_count: quick size signals for ranking and filters.
- more_users: boolean that indicates if more followings exist beyond this response.
User replies
- Method: GET
- URL: https://zylalabs.com/api/3399/twitter-data-all-in-one-api/3682/user-replies
- Description: The list of user’s replies.
- Required query params:
- screenname (string): e.g., elonmusk
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"
The response returns a timeline array of replies with fields like tweet_id, created_at, text, language, engagement counts (favorites, retweets, replies, quotes), author metadata, and entities. Timestamps use a Twitter-style string such as “Thu Dec 12 13:15:59 +0000 2024” (UTC offset included), which you can parse into a datetime.
Python quickstart: fetch profile info and parse fields
This minimal example calls the About profile path, checks the HTTP status, and extracts key fields you’ll likely map into your app’s user model.
Python
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://zylalabs.com/api/3399/twitter-data-all-in-one-api/22582/about-profile"
params = {"screenname": "elonmusk"}
headers = {"Authorization": f"Bearer {API_KEY}"}
resp = requests.get(BASE_URL, params=params, headers=headers, timeout=30)
resp.raise_for_status()
data = resp.json()
# Minimal field extraction
profile = {
"status": data.get("status"),
"screenname": data.get("profile"),
"name": data.get("name"),
"rest_id": data.get("rest_id"),
"id": data.get("id"),
"blue_verified": data.get("blue_verified"),
"avatar": data.get("avatar"),
"account_based_in": (data.get("about") or {}).get("account_based_in"),
"username_change_count": ((data.get("about") or {}).get("username_changes") or {}).get("count"),
}
print(profile)
Practical tips that save time
- Auth header only: All shown paths require Authorization: Bearer YOUR_API_KEY. Do not add other auth params.
- Required parameter: Each endpoint here requires screenname. Use the exact key name: screenname.
- Timestamps: created_at in user replies includes a UTC offset; standardize to UTC when storing.
- Pagination: The Following path includes more_users. If true, plan for follow-up fetches. Refer to the API page for any pagination details when available.
- Caching: Profile metadata (e.g., avatar, verification) is relatively static. Cache About profile responses and refresh on a schedule to reduce calls.
- Error handling: Treat non-2xx as retryable or user-facing errors depending on your SLA. Log the raw JSON for observability.
- Quotas: Zyla uses subscription + quota. Monitor your usage and keep key calls idempotent. Check the API page for current limits.
End-to-end example: retrieve followings and build an index
This outlines a simple pipeline to enrich your CRM with social follow graph signals:
- Lookup the account with About profile (store rest_id, name, blue_verified, avatar).
- Call Following to fetch the accounts they follow (store user_id, screen_name, description).
- If more_users is true, schedule subsequent fetches (implementation details depend on the API page when available).
- Expose a filter in your app: “Show contacts followed by @elonmusk” or “Rank contacts by follower counts.”
When you need to confirm a contact’s public presence and standing, combine About profile (verification and labels) and Following (social graph anchors), then optionally pull User replies to analyze engagement recency and topics.
Calling the API from an AI agent via MCP
If you automate social data tasks using Claude Code, Cursor, Windsurf, or any MCP-compatible client, you can route calls through Zyla’s MCP endpoint:
- Endpoint: MCP
- Authentication for MCP: append apikey=YOUR_API_KEY in the MCP URL as shown.
- Your agent can then invoke the same listing paths (e.g., About profile, Following, User replies) by specifying the Hub URLs and the Authorization header inside the MCP tool configuration, depending on your client’s setup.
Keep your tool descriptions precise and pass only the documented parameter screenname when constructing requests.
Common workflows and patterns
- Profile enrichment on signup: On first login with a handle field, call About profile, store rest_id, avatar URL, blue_verified flag, and country.
- Influencer discovery: Use Following to map who a seed account tracks. Rank by followers_count to shortlist targets.
- Engagement diagnostics: Use User replies to check recent activity and topics before launching outreach or content responses.
- Monitoring: Schedule periodic pulls for a handful of VIP accounts; compare rest_id and avatar for changes to trigger alerts.
Security, deployment, and observability notes
- Keys: Keep YOUR_API_KEY in secret managers or environment variables. Never commit credentials.
- Timeouts: In Python requests, set a finite timeout (e.g., 30s) and implement a short retry policy on transient errors.
- Logging: Log request URL (without credentials), HTTP status, and the top-level keys of the JSON for quick triage.
- Backoff: If you approach quota, reduce polling frequency and cache results like About profile to avoid redundant calls.
Appendix: Additional endpoint examples
Below are copy-pasteable cURL examples for each available path on this listing, using only required parameters.
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"
Where to explore next
- API page with live console and details: Twitter Data All-in-One API
- Zyla API Hub homepage for more Social Media listings: zylalabs.com
FAQ
1) How do I authenticate my requests?
Include the header Authorization: Bearer YOUR_API_KEY in every call to the Hub URLs shown above.
2) Which parameters are required for these endpoints?
Each path in this guide requires the query parameter screenname. Use only screenname; do not add extra parameters or request bodies.
3) Do the responses include timestamps and engagement counts?
Yes. The User replies path includes created_at and counts such as favorites, retweets, replies, and quotes. The timestamp follows a Twitter-style string with a UTC offset.
4) What is the billing model?
Zyla operates on subscription + quota (not pay-per-call). For this API, the first API typically offers a 7-day trial or 50 requests and has no Free Plan. Check the API page for current access options and pricing.
5) Can I use this API in an AI agent?
Yes. Use the MCP endpoint at MCP with your API key and have your agent call the same Hub URLs with the Authorization header.
Ready to ship? Create your account, get an API key, and start integrating the Twitter Data All-in-One API on Zyla API Hub today: Register.