## How to Use the CNN API: Retrieve News with Ease
The **CNN API** allows developers to access real-time news from one of the world's leading news outlets—CNN. By leveraging this API, you can retrieve categorized news stories, get detailed reports on specific articles, and stay up to date with the latest news across various sectors like politics, business, health, and entertainment. This blog will provide a comprehensive guide on how to call the CNN API using various methods, highlight creative ideas for using the API, and cover the benefits and features of the API.
---
### What is the CNN API?
The **CNN API**, available via the RapidAPI platform, enables access to CNN's latest news headlines and detailed articles. It simplifies retrieving news articles from categories like **US**, **World**, **Politics**, **Entertainment**, and more. The API can be called to extract both short headlines and full article details with images, descriptions, and videos.
---
### Key Features and Benefits
1. **Access to Real-Time News**: Get the latest breaking news across various categories.
2. **Easy Integration**: The API is built on REST, making it easy to integrate with any system that supports HTTP requests.
3. **Detailed News Articles**: The details endpoint provides rich information such as images, headlines, descriptions, word counts, and even related videos.
4. **Flexibility**: The API allows you to filter news by category, ensuring you retrieve the news that’s most relevant to your audience.
5. **Multimedia Support**: Retrieve not just text-based news but also related images and embedded videos.
6. **Use Case Versatility**: Whether you’re building a news aggregation app, a news chatbot, or simply need up-to-date headlines for your website, the CNN API is your go-to tool.
---
### How to Call the CNN API
#### Example 1: Get News by Category
You can fetch the latest news by category using the following cURL command:
```bash
curl --request GET \
--url 'https://cnn-api.p.rapidapi.com/category?url=https%3A%2F%2Fedition.cnn.com%2Fentertainment' \
--header 'x-rapidapi-host: cnn-api.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'
```
This command retrieves the latest entertainment news from CNN. You can replace the URL with other category links to retrieve news from other sections such as **World**, **US**, **Politics**, or **Health**.
##### Example of Categories:
- US: `https://edition.cnn.com/us`
- World: `https://edition.cnn.com/world`
- Politics: `https://edition.cnn.com/politics`
- Business: `https://edition.cnn.com/business`
- Health: `https://edition.cnn.com/health`
---
#### Example 2: Get Detailed News Article
For a deeper look at specific articles, use the "details" endpoint. Here’s how you can retrieve detailed information like the headline, description, images, videos, and article body:
```bash
curl --request GET \
--url 'https://cnn-api.p.rapidapi.com/details?url=https%3A%2F%2Fedition.cnn.com%2F2024%2F07%2F08%2Fpolitics%2Fbiden-fate-political-career%2Findex.html' \
--header 'x-rapidapi-host: cnn-api.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY'
```
The response provides:
- **Headline**: Article title.
- **Description**: A short summary of the article.
- **Images**: Thumbnail and main images.
- **Video links**: Embedded videos relevant to the story.
- **Word Count**: Total words in the article.
- **Article Body**: Full content of the article.
##### Example Response (Shortened):
```json
{
"headline": "Biden's fate is on the line in the most critical days of his political career",
"description": "The high-stakes week ahead is critical...",
"thumbnailUrl": "https://media.cnn.com/api/v1/images/stellar/prod/gettyimages-2159959397.jpg",
"articleBody": "The high-stakes week ahead is critical to whether President Joe Biden's..."
}
```
---
### Ideas for Using the CNN API
#### 1. **News Aggregation Websites**
If you're developing a news aggregation platform, you can use the CNN API to fetch top headlines in real-time. By pulling articles from different categories (e.g., politics, health, business), you can keep your readers informed with the latest updates across various sectors.
#### 2. **News-Based Mobile Apps**
Create a mobile app that delivers breaking news and updates. Use push notifications to alert users when new articles in specific categories, like sports or entertainment, are available.
#### 3. **Smart Assistants**
Integrate the CNN API with voice-enabled smart assistants like Alexa or Google Assistant, providing users with instant access to news updates on demand.
#### 4. **Custom Newsletters**
Use the API to curate daily or weekly email newsletters for your audience. You can filter articles by categories relevant to their interests and provide them with the most recent news right in their inbox.
#### 5. **Chatbots**
Create an intelligent chatbot that can answer user queries about current events, retrieve the latest news articles, and share breaking headlines. This is useful for customer service platforms or interactive media bots.
---
### Conclusion
The CNN API is an excellent tool for developers seeking to integrate real-time news content into their apps, websites, or services. With a simple, user-friendly design and extensive categories, it’s perfect for a wide range of use cases. Whether you're building a news app, newsletter, or chatbot, the CNN API helps keep your audience informed with the latest headlines and detailed reports from CNN's vast content library.
Be sure to explore its full potential by customizing requests based on categories and fetching detailed articles for a comprehensive news experience.
get details news by URL
details news - Endpoint Features
Object | Description |
---|---|
url |
[Required] |
[
{
"headline": "Martha Stewart has the funniest reason for not wanting to do ‘The Golden Bachelorette’",
"description": "Martha Stewart may be hot in the kitchen, but she’s not looking to replicate that on a dating reality show.",
"thumbnailUrl": "https://media.cnn.com/api/v1/images/stellar/prod/gettyimages-2178806460.jpg?c=original",
"datePublished": "2024-10-23T13:19:27.261Z",
"dateModified": "2024-10-23T13:19:27.261Z",
"image": [
{
"@type": "ImageObject",
"contentUrl": "https://media.cnn.com/api/v1/images/stellar/prod/gettyimages-2178806460.jpg?c=original",
"caption": "Martha Stewart attends Martha Stewart's 100th Book Party Celebration during Food Network New York City Wine & Food Festival presented by Invesco QQQ at Four Twenty Five on October 16, 2024 in New York City.",
"sourceOrganization": {
"@type": "Organization",
"name": "Getty Images"
},
"width": "3000",
"height": "2000",
"creditText": "Astrid Stawiarz/Getty Images",
"dateCreated": "2024-10-16T04:00:00.000Z"
},
{
"@type": "ImageObject",
"contentUrl": "https://media.cnn.com/api/v1/images/stellar/prod/gettyimages-2178806460.jpg?c=original",
"caption": "Martha Stewart on Oct. 16 in New York.",
"sourceOrganization": {
"@type": "Organization",
"name": "Getty Images"
},
"width": "3000",
"height": "2000",
"creditText": "Astrid Stawiarz/Getty Images",
"dateCreated": "2024-10-16T04:00:00.000Z"
}
],
"wordCount": 342,
"articleBody": "Martha Stewart may be hot in the kitchen, but she’s not looking to replicate that on a dating reality show. During a recent appearance with her friend and all-around cool guy Snopp Dogg on “Watch What Happens Live with Andy Cohen,” the topic of the ABC series “The Golden Bachelorette” came up and whether Stewart would be willing to participate. “Absolutely not,” Stewart said. When host Cohen asks if money - say $1 million or $10 million dollars - might entice her to allow a group of older gentleman to vie for her heart, the domestic doyenne said “the guys aren’t hot enough.” That struck Snoop as pretty funny. “So it ain’t about the money, it’s about how hot the guys are,” he said. “She said, $10 million can’t get it if he don’t look right.” The subject of her love life is not a new one for Stewart. In 2022, while playing a game with Drew Barrymore on her daytime talk show, Stewart was asked to wave flags to a series of dating questions - green for yes, red for no and yellow for being on the fence. Asked if she would date a man with as many tattoos as “SNL” alum Pete Davidson, Stewart waved the green flag. But what about dating Davidson himself? Green flag as well. Barrymore then pointed out that “there’s a thing on the internet” where people have expressed their hope that Stewart, 81, would go out with Davidson, 28. “He’s dated so many women,” Stewart said. “I’m not saying that’s bad. I think that’s good. And he’s sort of cute.” Stewart was married to Andrew “Andy” Stewart from 1961 to 1990, with whom she shares a daughter. In the trailer for her new Netflix documentary she had some advice for young women in that “if your married and your husband cheats on you, he’s a piece of s**t. Get out of that marriage.” When the interviewer asked “Didn’t you have an affair early on?” Stewart responded, “Yeah, but I don’t think Andy ever knew that.”",
"video": null,
"articleSection": [
"entertainment"
],
"author": [
{
"@type": "Person",
"name": "Lisa Respers France",
"url": "https://www.cnn.com/profiles/lisa-france"
}
],
"publisher": {
"@type": "NewsMediaOrganization",
"name": "CNN",
"logo": "https://media.cnn.com/api/v1/images/stellar/prod/cnnlogo.png?q=w_60,h_61",
"foundingDate": "1980-06-01",
"url": "https://www.cnn.com",
"sameAs": [
"https://www.facebook.com/cnn/",
"https://x.com/CNN",
"https://www.tiktok.com/@cnn",
"https://www.instagram.com/cnn/",
"https://www.youtube.com/cnn"
]
}
}
]
curl --location --request GET 'https://zylalabs.com/api/6437/cnn+api/9263/details+news?url=https://edition.cnn.com/2024/10/23/entertainment/martha-stewart-golden-bachelorette/index.html' --header 'Authorization: Bearer YOUR_API_KEY'
Get news by category URL
news by category - Endpoint Features
Object | Description |
---|---|
url |
[Required] |
{
"latest": [
{
"headline": "‘Warfare’ aims to be the most authentic Iraq War film yet",
"link": "https://edition.cnn.com/2025/04/08/entertainment/warfare-film-synopsis/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/08/entertainment/ms-rachel-accurso-baby-surrogate/index.html"
},
{
"headline": "YouTube sensation Ms. Rachel welcomes daughter via surrogate",
"link": "https://edition.cnn.com/2025/04/08/entertainment/meghan-sussex-postpartum-preeclampsia-scli-intl/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/07/entertainment/white-lotus-roles-season-3-stars/index.html"
},
{
"headline": "Meghan, Duchess of Sussex opens up about ‘scary’ condition after childbirth",
"link": "https://edition.cnn.com/2025/04/07/entertainment/cast-white-lotus-event-chelsea-ending/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/06/entertainment/elton-john-tammy-faye-flop/index.html"
},
{
"headline": "Can’t get enough ‘White Lotus’? Here’s other places to catch your favorite Season 3 stars",
"link": "https://edition.cnn.com/2025/04/07/entertainment/tracy-chapman-interviews-album/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/08/entertainment/minecraft-movie-chicken-jockey-explained/index.html"
},
{
"headline": "A tearful Aimee Lou Wood reacts to ‘incredibly uncynical’ ending to ‘White Lotus’ Season 3",
"link": "https://edition.cnn.com/2025/04/07/entertainment/madonna-elton-john-feud-over/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/06/entertainment/snl-donald-trump-tariffs-morgan-wallen/index.html"
},
{
"headline": "Elton John thinks his shuttered musical ‘Tammy Faye’ failed because it was ‘too political’",
"link": "https://edition.cnn.com/2025/04/03/entertainment/bruce-springsteen-lost-albums/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/03/entertainment/olivia-munn-blue-origin-space-flight/index.html"
},
{
"headline": "Tracy Chapman is stepping back into the limelight with a re-release of her debut album",
"link": "https://edition.cnn.com/2025/04/07/entertainment/happy-days-cast-reunited/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/06/entertainment/fka-twigs-cancels-coachella-visa-issues/index.html"
},
{
"headline": "‘A Minecraft Movie’ has made chicken jockey a viral thing",
"link": "https://edition.cnn.com/2025/04/07/entertainment/group-chat-tiktok-sydney-robinson/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/04/entertainment/conan-obrien-kennedy-center/index.html"
},
{
"headline": "Madonna says she and Elton John ‘finally buried the hatchet’ after decades-long public feud",
"link": "https://edition.cnn.com/2025/04/08/entertainment/robbie-william-scurvy-wellness/index.html"
},
{
"headline": "‘SNL’ takes on Donald Trump’s tariffs and Morgan Wallen’s ‘God’s country’ comment in cold open",
"link": "https://edition.cnn.com/2025/04/07/entertainment/mike-white-lotus-piper-zion/index.html"
},
{
"headline": "Bruce Springsteen to release 7 ‘Lost Albums’ containing over 80 never-before-heard songs",
"link": "https://edition.cnn.com/2025/04/07/entertainment/video/entertainment-showbiz-hollywood-handmaids-tale-hulu-final-season-gilead-elisabeth-moss-bradley-whitford-samira-wiley"
},
{
"headline": "Olivia Munn has strong feelings about the next Blue Origin space flight: ‘What’s the point?’",
"link": "https://edition.cnn.com/2025/04/03/entertainment/hacks-forged-in-fire-season-4/index.html"
},
{
"headline": "‘Happy Days’ cast members reunited this weekend",
"link": "https://edition.cnn.com/2025/04/02/entertainment/video/noah-wyle-the-pitt-max-digvid"
},
{
"headline": "FKA Twigs cancels Coachella appearance and remaining tour dates due to ‘ongoing visa issues’",
"link": "https://edition.cnn.com/2025/04/06/entertainment/white-lotus-finale-episode-rick-chelsea/index.html"
},
{
"headline": "‘The Group Chat’ is the internet’s latest obsession. Here’s what you need to know about the TikTok series",
"link": "https://edition.cnn.com/2025/04/05/entertainment/will-forte-val-kilmer-roommate/index.html"
},
{
"headline": "Conan O’Brien explains why he went to the Kennedy Center for the Mark Twain Award",
"link": "https://edition.cnn.comhttps://www.cnn.com/interactive/2025/03/entertainment/black-line-dancing-protest-cnnphotos/"
},
{
"headline": "Robbie Williams says he was diagnosed with scurvy earlier this year",
"link": "https://edition.cnn.com/2025/03/26/entertainment/the-studio-seth-rogan-apple-tv/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/03/27/entertainment/survivor-joe-eva-autism-jeff-probst/index.html"
},
{
"headline": "Mike White reveals surprising ‘White Lotus’ coupling that ended up on the cutting room floor",
"link": "https://edition.cnn.com/2025/04/08/entertainment/video/entertainment-showbiz-hollywood-minute-tom-cruise-mission-impossible-handmaids-tale-ever-carradine-josh-charles"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/03/entertainment/tom-cruise-val-kilmer-tribute/index.html"
},
{
"headline": "‘The Handmaid’s Tale’ heads toward the final battle in season six",
"link": "https://edition.cnn.com/2025/04/01/entertainment/shia-labeouf-slauson-rec-documentary/index.html"
},
{
"headline": null,
"link": "https://edition.cnn.com/2025/04/01/entertainment/beatles-biopics-casting-confirmation-scli-intl/index.html"
},
{
"headline": "‘Hacks’ stars and creators feel they’re a family ‘forged in fire’ after Covid, Hollywood strikes and LA fires",
"link": "https://edition.cnn.com/2025/03/29/entertainment/academy-apologizes-hamdan-ballal-response/index.html"
}
]
}
curl --location --request GET 'https://zylalabs.com/api/6437/cnn+api/9264/news+by+category?url=https://edition.cnn.com/entertainment' --header 'Authorization: Bearer YOUR_API_KEY'
Header | Description |
---|---|
Authorization
|
[Required] Should be Bearer access_key . See "Your API Access Key" above when you are subscribed. |
No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.
The CNN API has two main endpoints. The "Get News by Category" endpoint returns a list of headlines and links for articles in specified categories. The "Get Detailed News Article" endpoint provides comprehensive details about a specific article, including the headline, description, images, videos, word count, and the full article body.
Key fields in the "Get News by Category" response include "headline" and "link." For the "Get Detailed News Article," important fields are "headline," "description," "thumbnailUrl," "articleBody," and "video links." These fields provide essential information for displaying news content.
The response data is structured in JSON format. For the category endpoint, it returns an array of articles under the "latest" key. The detailed article endpoint returns a single object with various keys representing different aspects of the article, such as "headline," "description," and "images."
The "Get News by Category" endpoint provides headlines and links to articles across various categories like U.S., World, Politics, and more. The "Get Detailed News Article" endpoint offers in-depth information about a specific article, including multimedia elements and a full text body.
The primary parameter for both endpoints is the "url" parameter, which specifies the CNN article or category URL you want to retrieve. Users can customize their requests by changing the URL to target different news categories or specific articles.
Users can display headlines and links from the category endpoint on news aggregation sites or apps. The detailed article data can be used to create rich content displays, including images and summaries, enhancing user engagement with multimedia elements.
Typical use cases include building news aggregation websites, developing mobile news apps, creating custom newsletters, and integrating with chatbots or smart assistants to provide users with real-time news updates tailored to their interests.
The CNN API sources its data directly from CNN, a reputable news organization. Data accuracy is maintained through regular updates and quality checks performed by CNN's editorial team, ensuring that the information provided is reliable and up-to-date.
Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.
Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world’s most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]
Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.
The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.
Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]
Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.
API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.
Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.
To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.
To check how many API calls you have left for the current month, refer to the ‘X-Zyla-API-Calls-Monthly-Remaining’ field in the response header. For example, if your plan allows 1,000 requests per month and you've used 100, this field in the response header will indicate 900 remaining calls.
To see the maximum number of API requests your plan allows, check the ‘X-Zyla-RateLimit-Limit’ response header. For instance, if your plan includes 1,000 requests per month, this header will display 1,000.
The ‘X-Zyla-RateLimit-Reset’ header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3,600, it means 3,600 seconds are left until the limit resets.
Yes, you can cancel your plan anytime by going to your account and selecting the cancellation option on the Billing page. Please note that upgrades, downgrades, and cancellations take effect immediately. Additionally, upon cancellation, you will no longer have access to the service, even if you have remaining calls left in your quota.
You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]
To give you the opportunity to experience our APIs without any commitment, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost. This trial can be used only once, so we recommend applying it to the API that interests you the most. While most of our APIs offer a free trial, some may not. The trial concludes after 7 days or once you've made 50 requests, whichever occurs first. If you reach the 50 request limit during the trial, you will need to "Start Your Paid Plan" to continue making requests. You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab. Alternatively, if you don't cancel your subscription before the 7th day, your free trial will end, and your plan will automatically be billed, granting you access to all the API calls specified in your plan. Please keep this in mind to avoid unwanted charges.
After 7 days, you will be charged the full amount for the plan you were subscribed to during the trial. Therefore, it’s important to cancel before the trial period ends. Refund requests for forgetting to cancel on time are not accepted.
When you subscribe to an API free trial, you can make up to 50 API calls. If you wish to make additional API calls beyond this limit, the API will prompt you to perform an "Start Your Paid Plan." You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab.
Payout Orders are processed between the 20th and the 30th of each month. If you submit your request before the 20th, your payment will be processed within this timeframe.
Service Level:
100%
Response Time:
14,872ms
Service Level:
98%
Response Time:
99ms
Service Level:
100%
Response Time:
601ms
Service Level:
100%
Response Time:
491ms
Service Level:
100%
Response Time:
346ms
Service Level:
96%
Response Time:
380ms
Service Level:
100%
Response Time:
1,641ms
Service Level:
100%
Response Time:
1,197ms
Service Level:
100%
Response Time:
3,042ms
Service Level:
100%
Response Time:
1,162ms