You need to ship a feature that pulls fresh, section-specific news (for example: “Technology → AI” or “World → Middle East”) without building a custom scraper or wrangling multiple feeds. By the end of this article, you’ll know exactly which endpoint to call to fetch topic news by section, how to filter by country and language, and how to wire it into your app using a copy-pasteable curl or Python snippet.
What this API does and why it’s useful
The Real-Time News Data API on Zyla API Hub provides structured news data you can query in three ways:
- Search: keyword-based search across news articles.
- Top Headlines: latest top stories by country (and optional language/limit).
- Topic News By Section: articles within a specific section of a topic (e.g., Technology) or a publication (e.g., CNN, BBC).
These endpoints return normalized fields like title, link, snippet, media URLs, authors, source details, and a UTC timestamp. Typical use cases include personalized news widgets, editorial dashboards, automated alerts, or enrichment for content recommendation systems.
If you’re new to Zyla, it’s an API marketplace with more than 10,000 public APIs and one standardized way to authenticate and subscribe. You can explore categories and providers directly on Zyla API Hub, then plug the same API key into any listing you subscribe to.
Getting started on Zyla API Hub
Open the Real-Time News Data API page and start a trial. Zyla uses a subscription + quota model (not pay-per-call). For your first API, you can start a 7-day trial or 50 requests. There is no Free Plan. After subscribing, you’ll receive one API key usable across this API’s endpoints.
- Go to the listing: Start 7-day trial on Real-Time News Data API
- Click Subscribe (or Start Free Trial if available) and get your API key.
- Use Authorization: Bearer YOUR_API_KEY in every request.
Need to evaluate other datasets later? You can browse and subscribe to more listings at zylalabs.com with the same account and standard authentication.
Endpoints you’ll use
1) Topic News By Section
Use this to get articles inside a specific section of a topic (like “World, Sports, Technology”) or of a publication (like CNN, BBC). This is the most direct way to implement “API for topic news by section.”
- Method: GET
- URL: https://zylalabs.com/api/7339/real-time-news-data-api/11656/topic-news-by-section
- Description: Get news article in a specific section of a topic (World, Sports, Technology, etc) or publication (CNN, BBC, etc).
- Request params:
- topic (string, required): e.g., TECHNOLOGY
- section (string, required): opaque section identifier
- limit (number, optional): e.g., 500
- country (string, optional): e.g., US
- language (string, optional): e.g., en
Example curl (copy-paste and replace YOUR_API_KEY):
curl -s -X GET "https://zylalabs.com/api/7339/real-time-news-data-api/11653/search?query=Elon+Musk" \
-H "Authorization: Bearer YOUR_API_KEY"
Notes:
- published_datetime_utc values are ISO-8601 timestamps in UTC.
- Filter by country and language if you need localized sections or want to narrow results.
- The section parameter is a required opaque identifier. Use the value you intend to target for the chosen topic or publication.
2) Search
Find articles by a search term. Useful for validating your section-based feed or filling gaps with keyword-matched content.
- Method: GET
- URL: https://zylalabs.com/api/7339/real-time-news-data-api/11653/search
- Description: Search news articles by query with an option to limit the results to a specific time range.
- Request params:
- query (string, required): e.g., Elon Musk
Official example curl (copy-paste this exactly):
Official response example (fields you can parse like title, link, published_datetime_utc, authors, source_name):
{
"status": "OK",
"request_id": "1254b56e-7238-4807-9fa7-bd9256c0b66c",
"data": [
{
"title": "How the roots of the ‘PayPal mafia’ extend to apartheid South Africa",
"link": "https://www.theguardian.com/technology/2025/jan/26/elon-musk-peter-thiel-apartheid-south-africa",
"snippet": "Musk is part of the “PayPal mafia” of libertarian billionaires with roots in South Africa under white rule now hugely influential in the US tech ...",
"photo_url": "https://i.guim.co.uk/img/media/01d10e660767815cd5799030b4ff658664343b13/1_0_2998_1800/master/2998.jpg?width=465&dpr=1&s=none&crop=none",
"thumbnail_url": "https://news.google.com/api/attachments/CC8iL0NnNXphbFpzWm10S09YQnVSWGxTVFJDWEFoalJBeWdLTWdrQklKcEdIcWtXWndJ=-w200-h200-p-df-rw",
"published_datetime_utc": "2025-01-26T16:00:00.000Z",
"authors": [
"Chris McGreal"
],
"source_url": "https://www.theguardian.com",
"source_name": "The Guardian",
"source_logo_url": "https://lh3.googleusercontent.com/SU8FywVNtcrG-wgjvZ_0D1-3JR_pN9LNSgjULFH74N748KVyEdkF1jdbvP4Lr7_ClbPZxL-iPw",
"source_favicon_url": "https://encrypted-tbn0.gstatic.com/faviconV2?url=https://www.theguardian.com&client=NEWS_360&size=96&type=FAVICON&fallback_opts=TYPE,SIZE,URL",
"source_publication_id": "CAAqBggKMJeqezDfswk",
"related_topics": [
{
"topic_id": "CAAqIggKIhxDQkFTRHdvSkwyMHZNR1ppWm13MUVnSmxiaWdBUAE",
"topic_name": "Chris McGreal"
}
]
},
{
"title": "Bill Gates says he thinks it's 'insane' that Elon Musk is allowed to 'destabilize' politics in other countries",
"link": "https://www.businessinsider.com/gates-its-insane-that-musk-can-destabilize-foreign-politics-2025-1",
"snippet": "Bill Gates doesn't like how Elon Musk has involved himself in the politics of foreign countries like the UK and Germany.",
"photo_url": "https://i.insider.com/679751e2eb4be2fff9a22f97?width=700",
"thumbnail_url": "https://news.google.com/api/attachments/CC8iI0NnNVpaRXhyYlRkVE9WRXhTbnB3VFJEZ0F4aUFCU2dLTWdB=-w200-h200-p-df-rw",
"published_datetime_utc": "2025-01-27T09:36:00.000Z",
"authors": [
"Kevin Tan"
],
"source_url": "https://www.businessinsider.com",
"source_name": "Business Insider",
"source_logo_url": "https://lh3.googleusercontent.com/MD0yHuvt1mX8YyHUcdTCsQqMKGubFCwbWmpxzkT1xnE5wZ4aDRmb2zvkgfgG_b0mHNhaSxqO2A",
"source_favicon_url": "https://encrypted-tbn3.gstatic.com/faviconV2?url=https://www.businessinsider.com&c…
Field notes you’ll likely use:
- title, link, snippet: for rendering the card or preview.
- photo_url, thumbnail_url: image assets when available.
- published_datetime_utc: ISO-8601 UTC timestamp you can convert to local time.
- authors, source_name: attribution and labeling.
3) Top Headlines
Quickly fetch the latest headlines by country, with optional language and limit parameters.
- Method: GET
- URL: https://zylalabs.com/api/7339/real-time-news-data-api/11654/top-headlines
- Description: Get the latest news headlines/top stories for a country.
- Request params:
- limit (number, optional): e.g., 500
- country (string, optional): e.g., US
- lang (string, optional): e.g., en
Example curl:
Python example: fetch topic news by section
This script calls the Topic News By Section endpoint, then prints the essential fields. Replace YOUR_API_KEY with your key and adjust topic/section/country/language for your use case.
import os
import requests
API_KEY = os.getenv("ZylaApiKey", "YOUR_API_KEY")
url = "https://zylalabs.com/api/7339/real-time-news-data-api/11656/topic-news-by-section"
params = {
"topic": "TECHNOLOGY",
"section": "CAQiSkNCQVNNUW9JTDIwdk1EZGpNWFlTQldWdUxVZENHZ0pKVENJT0NBUWFDZ29JTDIwdk1ETnliSFFxQ2hJSUwyMHZNRE55YkhRb0FBKi4IACoqCAoiJENCQVNGUW9JTDIwdk1EZGpNWFlTQldWdUxVZENHZ0pKVENnQVABUAE",
"limit": 50,
"country": "US",
"language": "en",
}
headers = {
"Authorization": f"Bearer {API_KEY}"
}
resp = requests.get(url, params=params, headers=headers, timeout=20)
resp.raise_for_status()
data = resp.json()
if data.get("status") == "OK":
for item in data.get("data", []):
title = item.get("title")
link = item.get("link")
published = item.get("published_datetime_utc")
source = item.get("source_name")
print(f"[{published}] {title} — {source} :: {link}")
else:
print("Non-OK status:", data)
Implementation tips:
- Cache responses for a short window based on your UI needs to avoid redundant fetches when users refresh frequently.
- Respect the subscription + quota model; avoid unnecessary polling on every page view. Fan out server-side as needed.
- Timestamps are in UTC; convert once in your API/service layer to prevent repeated timezone logic on the client.
Practical use cases you can deploy this week
- Topic landing pages: Drive “Technology → AI” or “Sports → Soccer” sections from the Topic News By Section endpoint with country/language filters for localization.
- Editorial backfill: When a section has fewer stories than expected, run Search as a fallback for specific keywords and merge results into the feed.
- Market/industry monitors: Combine Technology section articles with Search for named companies to power investor dashboards.
- Alerts/notifications: Poll sections relevant to your users and push updates when new articles appear (compare link or title to your last-seen set).
Calling the API from an AI agent (MCP)
You can also call Zyla APIs via MCP-compatible clients (e.g., Claude Code, Cursor, Windsurf) using the MCP endpoint. Point your agent or tool to:
https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY
From there, issue the same HTTP GET requests shown above with the Authorization header. For more about the MCP transport, see MCP.
Operational details that save time
- Auth: Use the HTTP header Authorization: Bearer YOUR_API_KEY for every request.
- Timestamps: published_datetime_utc is in UTC (ISO-8601). Normalize early in your pipeline.
- Filtering: For Topic News By Section, topic and section are required. country and language are optional refinements; use limit to cap payload size.
- Quotas: Zyla billing is subscription + quota. For the first API, you can start a 7-day trial or 50 requests. Check the API page for current access options and pricing after trial.
- Data model: Article objects include source_name, source_url, and author lists to support proper attribution in your UI.
End-to-end flow to ship the feature
- Start a trial of the Real-Time News Data API and grab your API key: Start 7-day trial on Real-Time News Data API.
- Pick the topic and section identifier you want to power (e.g., TECHNOLOGY + the required section value).
- Call the Topic News By Section endpoint server-side with Authorization: Bearer YOUR_API_KEY.
- Render title, link, snippet, photo_url/thumbnail_url, and source_name. Convert published_datetime_utc to your users’ timezone.
- Add a lightweight cache or ETag-equivalent on your side to eliminate redundant calls on refresh.
- Optionally, layer in Search to fill gaps or create drilldowns by keyword.
FAQ
How do I authenticate?
Include the header Authorization: Bearer YOUR_API_KEY in every request.
Which endpoint returns topic news by section?
GET https://zylalabs.com/api/7339/real-time-news-data-api/11656/topic-news-by-section with required topic and section parameters. Optional parameters include limit, country, and language.
What timezone are publication dates in?
published_datetime_utc is provided in UTC (ISO-8601). Convert it in your client or server layer as needed.
Can I also fetch general headlines by country?
Yes. Use GET https://zylalabs.com/api/7339/real-time-news-data-api/11654/top-headlines with optional limit, country, and lang parameters.
How do I call this from an AI code assistant or agent?
Use the MCP transport at https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY in an MCP-compatible client, then issue the same GET requests with the Authorization header. See MCP.
Ready to implement section-based news today? Start your trial, get your key, and plug in the Topic News By Section endpoint here: Start 7-day trial on Real-Time News Data API.