When you need to add news search to an application, the immediate task is getting useful results into your code without building a search pipeline yourself. By the end of this guide, you’ll be able to call News API, read the returned news fields in Python, and use the same integration from an MCP-compatible AI agent.
What News API returns
News API provides a Search News endpoint that takes a search term and returns news results. The supplied response includes search parameters and a news array with titles, links, snippets, dates, sources, image URLs, and positions.
That makes the endpoint useful for a news-search interface, a topic-monitoring dashboard, or an agent that needs links to relevant coverage. The result snippets are search-result text, so an application should link readers to the source rather than present a snippet as the full article.
Getting started on Zyla API Hub
Open the News API page on Zyla API Hub, create a free account if you don’t already have one, and click Subscribe or Start Free Trial when available. Get your API key from the Hub and use it in the Authorization header as a Bearer token.
Zyla uses subscriptions with quotas, rather than pay-per-call billing. The first API trial is subject to a 7-day or 50-request limit; check the API page for current access options and pricing. Keep the key on your server or in your local environment rather than embedding it in browser code.
Search news with a GET request
The available endpoint is Search News. It searches for the term supplied in q.
Method: GET
Request URL: https://zylalabs.com/api/2088/news-api/8710/search-news
qis a required string containing the search term. The request below usesUSA.glis a required string. The request below usesus.numis an optional string. The request below uses50.
Replace YOUR_API_KEY with your Hub key and run this request:
curl -s -X GET "https://zylalabs.com/api/2088/news-api/8710/search-news?q=USA&gl=us&num=50" \
-H "Authorization: Bearer YOUR_API_KEY"
The following is the supplied response example. Its search term is frauds and scams, so it illustrates the response fields rather than the exact results of the USA request above. The supplied example ends partway through a result and is shown as an excerpt, not as complete parseable JSON.
{"searchParameters":{"q":"frauds and scams","gl":"us","type":"news","engine":"google"},"news":[{"title":"Crypto Scam Tracker","link":"https://dfpi.ca.gov/consumers/crypto/crypto-scam-tracker/","snippet":"Crypto Blackmail Scam – Scammer sends emails or physical mails to victims saying they have personal information about the victim or embarrassing...","date":"3 days ago","source":"CA.gov","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSgiicmdcYcwifMoZJo-zKUAlcEIOZCvDl1-wz0dAAJigCnwL1z3Ty3m8o1fw&s","position":1},{"title":"Common Frauds and Scams | Federal Bureau of Investigation","link":"https://www.fbi.gov/how-we-can-help-you/scams-and-safety/common-frauds-and-scams","snippet":"Learn about some of the most common frauds and scams that the FBI encounters—as well as tips to help you stay safe and what to do if you're...","date":"7 months ago","source":"FBI.gov","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSKdrUO5MRmVg0GI7z198fT6rtJ9ylsRFmKjXykDrvrzaC4wQILPvbvtMqikg&s","position":2},{"title":"Bank transfer fraud losses outpace crypto","link":"https://www.paymentsdive.com/news/bank-transfer-fraud-losses-crypto-federal-trade-commission/743202/","snippet":"The value of fraud losses last year was highest for bank transfers and payments, followed by cryptocurrency transactions, according to a...","date":"1 day ago","source":"Payments Dive","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj9XxTsKfvCq3xM6xpFGVIXaL9i09IEtjl_EKOBwt2lgDXfA6K1eccwZdTwQ&s","position":3},{"title":"New FTC Data Show a Big Jump in Reported Losses to Fraud to $12.5 Billion in 2024","link":"https://www.ftc.gov/news-events/news/press-releases/2025/03/new-ftc-data-show-big-jump-reported-losses-fraud-125-billion-2024","snippet":"Newly released Federal Trade Commission data show that consumers reported losing more than $12.5 billion to fraud in 2024, which represents...","date":"2 weeks ago","source":"Federal Trade Commission (.gov)","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR5Bw4fovNk1XEEElT5Y6JAs56siR5QuVXvijYIBxwSyRuUC0Mk2lBN9ajnLg&s","position":4},{"title":"Fraud Prevention, Worker Protection, and Fighting Alleged Big Tech…","link":"https://www.kelleydrye.com/viewpoints/blogs/ad-law-access/fraud-prevention-worker-protection-and-fighting-alleged-big-tech-censorship-a-roundup-of-the-new-ftcs-agenda-after-the-first-50-days","snippet":"So far, the FTC has issued several business blog posts, formed two new task forces…
For a result list, use title and link for the headline, with source, date, and snippet as supporting text. The example’s date values are relative strings such as 3 days ago; don’t treat them as exact timestamps or assume a timezone. position records the result position, while imageUrl can supply an image reference.
Call the endpoint from Python
This sample uses Python’s standard library, makes the same request as the curl example, and prints fields from each returned news item. Set YOUR_API_KEY in your environment before running it.
import json
import os
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
url = "https://zylalabs.com/api/2088/news-api/8710/search-news?q=USA&gl=us&num=50"
request = Request(
url,
headers={"Authorization": f"Bearer {os.environ['YOUR_API_KEY']}"},
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
data = json.load(response)
for item in data.get("news", []):
print(item.get("title", ""))
print(item.get("source", ""), item.get("date", ""))
print(item.get("link", ""))
print(item.get("snippet", ""))
print()
except HTTPError as exc:
print(f"News API request failed: HTTP {exc.code}")
except URLError as exc:
print(f"Could not reach News API: {exc.reason}")
The script reads the live response, not the truncated example above. It uses get when displaying individual fields so that a missing display value does not stop the entire result list. In a user-facing application, also escape returned text when rendering HTML and treat returned links as external links.
If you cache searches, include the search term and the other request parameters in your cache key. Choose a refresh policy that fits the application: a cached relative date remains the text returned at fetch time, not a continuously updated timestamp.
Use results in an application or AI agent
A topic-monitoring dashboard can run a search for a subject and display the returned headlines, sources, and links for review. A news-search page can use the same fields to build a result list; retain the returned position if you want to preserve the response order. In either case, handle an empty news list without treating it as a request failure.
For an AI workflow, connect a compatible client to https://mcp.zylalabs.com/mcp?apikey=YOUR_API_KEY. Zyla’s MCP endpoint works with Claude Code, Cursor, Windsurf, and other MCP-compatible clients.
Once connected, an agent can use the Hub integration to search for news and work with the returned titles, snippets, sources, and links. Ask it to retain source links in its output so a reader can inspect the underlying coverage, and keep the API key out of prompts or shared transcripts.
FAQ
Which parameters are required to search news?
q and gl are required strings. num is optional; the documented request uses q=USA, gl=us, and num=50.
Does the response include article links?
Yes. The supplied response includes a link for each complete news result shown, along with a title, snippet, source, and relative date.
Can I use the returned date as an exact publication timestamp?
Not from the supplied example. Its dates are relative text, so display them as returned rather than assuming a precise date or timezone.
Can an AI agent call News API?
Yes. Connect an MCP-compatible client to Zyla’s MCP endpoint using your API key, then use the Hub integration for the news-search workflow.
Create a free Zyla account, then Start 7-day trial on News API to get an API key and check the current trial and subscription options.
Official API response
{"searchParameters":{"q":"frauds and scams","gl":"us","type":"news","engine":"google"},"news":[{"title":"Crypto Scam Tracker","link":"https://dfpi.ca.gov/consumers/crypto/crypto-scam-tracker/","snippet":"Crypto Blackmail Scam – Scammer sends emails or physical mails to victims saying they have personal information about the victim or embarrassing...","date":"3 days ago","source":"CA.gov","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSgiicmdcYcwifMoZJo-zKUAlcEIOZCvDl1-wz0dAAJigCnwL1z3Ty3m8o1fw&s","position":1},{"title":"Common Frauds and Scams | Federal Bureau of Investigation","link":"https://www.fbi.gov/how-we-can-help-you/scams-and-safety/common-frauds-and-scams","snippet":"Learn about some of the most common frauds and scams that the FBI encounters—as well as tips to help you stay safe and what to do if you're...","date":"7 months ago","source":"FBI.gov","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSKdrUO5MRmVg0GI7z198fT6rtJ9ylsRFmKjXykDrvrzaC4wQILPvbvtMqikg&s","position":2},{"title":"Bank transfer fraud losses outpace crypto","link":"https://www.paymentsdive.com/news/bank-transfer-fraud-losses-crypto-federal-trade-commission/743202/","snippet":"The value of fraud losses last year was highest for bank transfers and payments, followed by cryptocurrency transactions, according to a...","date":"1 day ago","source":"Payments Dive","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj9XxTsKfvCq3xM6xpFGVIXaL9i09IEtjl_EKOBwt2lgDXfA6K1eccwZdTwQ&s","position":3},{"title":"New FTC Data Show a Big Jump in Reported Losses to Fraud to $12.5 Billion in 2024","link":"https://www.ftc.gov/news-events/news/press-releases/2025/03/new-ftc-data-show-big-jump-reported-losses-fraud-125-billion-2024","snippet":"Newly released Federal Trade Commission data show that consumers reported losing more than $12.5 billion to fraud in 2024, which represents...","date":"2 weeks ago","source":"Federal Trade Commission (.gov)","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR5Bw4fovNk1XEEElT5Y6JAs56siR5QuVXvijYIBxwSyRuUC0Mk2lBN9ajnLg&s","position":4},{"title":"Fraud Prevention, Worker Protection, and Fighting Alleged Big Tech…","link":"https://www.kelleydrye.com/viewpoints/blogs/ad-law-access/fraud-prevention-worker-protection-and-fighting-alleged-big-tech-censorship-a-roundup-of-the-new-ftcs-agenda-after-the-first-50-days","snippet":"So far, the FTC has issued several business blog posts, formed two new task forces…
Official API response
{"searchParameters":{"q":"frauds and scams","gl":"us","type":"news","engine":"google"},"news":[{"title":"Crypto Scam Tracker","link":"https://dfpi.ca.gov/consumers/crypto/crypto-scam-tracker/","snippet":"Crypto Blackmail Scam – Scammer sends emails or physical mails to victims saying they have personal information about the victim or embarrassing...","date":"3 days ago","source":"CA.gov","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSgiicmdcYcwifMoZJo-zKUAlcEIOZCvDl1-wz0dAAJigCnwL1z3Ty3m8o1fw&s","position":1},{"title":"Common Frauds and Scams | Federal Bureau of Investigation","link":"https://www.fbi.gov/how-we-can-help-you/scams-and-safety/common-frauds-and-scams","snippet":"Learn about some of the most common frauds and scams that the FBI encounters—as well as tips to help you stay safe and what to do if you're...","date":"7 months ago","source":"FBI.gov","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSKdrUO5MRmVg0GI7z198fT6rtJ9ylsRFmKjXykDrvrzaC4wQILPvbvtMqikg&s","position":2},{"title":"Bank transfer fraud losses outpace crypto","link":"https://www.paymentsdive.com/news/bank-transfer-fraud-losses-crypto-federal-trade-commission/743202/","snippet":"The value of fraud losses last year was highest for bank transfers and payments, followed by cryptocurrency transactions, according to a...","date":"1 day ago","source":"Payments Dive","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSj9XxTsKfvCq3xM6xpFGVIXaL9i09IEtjl_EKOBwt2lgDXfA6K1eccwZdTwQ&s","position":3},{"title":"New FTC Data Show a Big Jump in Reported Losses to Fraud to $12.5 Billion in 2024","link":"https://www.ftc.gov/news-events/news/press-releases/2025/03/new-ftc-data-show-big-jump-reported-losses-fraud-125-billion-2024","snippet":"Newly released Federal Trade Commission data show that consumers reported losing more than $12.5 billion to fraud in 2024, which represents...","date":"2 weeks ago","source":"Federal Trade Commission (.gov)","imageUrl":"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR5Bw4fovNk1XEEElT5Y6JAs56siR5QuVXvijYIBxwSyRuUC0Mk2lBN9ajnLg&s","position":4},{"title":"Fraud Prevention, Worker Protection, and Fighting Alleged Big Tech…","link":"https://www.kelleydrye.com/viewpoints/blogs/ad-law-access/fraud-prevention-worker-protection-and-fighting-alleged-big-tech-censorship-a-roundup-of-the-new-ftcs-agenda-after-the-first-50-days","snippet":"So far, the FTC has issued several business blog posts, formed two new task forces…